当前位置: 首页>>代码示例>>Java>>正文


Java MonitorConfig.Builder方法代码示例

本文整理汇总了Java中com.netflix.servo.monitor.MonitorConfig.Builder方法的典型用法代码示例。如果您正苦于以下问题:Java MonitorConfig.Builder方法的具体用法?Java MonitorConfig.Builder怎么用?Java MonitorConfig.Builder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.netflix.servo.monitor.MonitorConfig的用法示例。


在下文中一共展示了MonitorConfig.Builder方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: stripCommonTags

import com.netflix.servo.monitor.MonitorConfig; //导入方法依赖的package包/类
private List<Metric> stripCommonTags(List<Metric> metrics) {
    Map<String, String> commonTags = NetflixTagKey.tagsFromEnvironment();
    List<Metric> result = Lists.newArrayListWithCapacity(metrics.size());

    for (Metric metric : metrics) {
        TagList origTags = metric.getConfig().getTags();
        MonitorConfig.Builder builder = MonitorConfig.builder(metric.getConfig().getName());
        for (Tag tag : origTags) {
            if (!commonTags.containsKey(tag.getKey())) {
                builder.withTag(tag);
            }
        }
        Metric noCommonTags = new Metric(builder.build(), metric.getTimestamp(), metric.getValue());
        result.add(noCommonTags);
    }
    return result;
}
 
开发者ID:dmuino,项目名称:atlas-oss-plugin,代码行数:18,代码来源:PushManager.java

示例2: toValidValue

import com.netflix.servo.monitor.MonitorConfig; //导入方法依赖的package包/类
/**
 * Return a new metric where the name and all tags are using the valid character
 * set.
 */
public static Metric toValidValue(Metric metric) {
    MonitorConfig cfg = metric.getConfig();
    MonitorConfig.Builder cfgBuilder = MonitorConfig.builder(toValidCharset(cfg.getName()));
    for (Tag orig : cfg.getTags()) {
        cfgBuilder.withTag(toValidCharset(orig.getKey()), toValidCharset(orig.getValue()));
    }
    cfgBuilder.withPublishingPolicy(cfg.getPublishingPolicy());
    return new Metric(cfgBuilder.build(), metric.getTimestamp(), metric.getValue());
}
 
开发者ID:dmuino,项目名称:atlas-oss-plugin,代码行数:14,代码来源:ValidCharacters.java

示例3: getCounter

import com.netflix.servo.monitor.MonitorConfig; //导入方法依赖的package包/类
public static Counter getCounter(String name, String... tags) {
    MonitorConfig.Builder cfgBuilder = MonitorConfig.builder(name);
    if (tags.length > 0) {
        cfgBuilder.withTags(BasicTagList.of(tags));
    }
    return getCounter(cfgBuilder.build());
}
 
开发者ID:dmuino,项目名称:atlas-oss-plugin,代码行数:8,代码来源:Servo.java

示例4: getTimer

import com.netflix.servo.monitor.MonitorConfig; //导入方法依赖的package包/类
public static Timer getTimer(String name, String... tags) {
    MonitorConfig.Builder cfgBuilder = MonitorConfig.builder(name);
    if (tags.length > 0) {
        cfgBuilder.withTags(BasicTagList.of(tags));
    }
    return getTimer(cfgBuilder.build());
}
 
开发者ID:dmuino,项目名称:atlas-oss-plugin,代码行数:8,代码来源:Servo.java

示例5: withTags

import com.netflix.servo.monitor.MonitorConfig; //导入方法依赖的package包/类
@Override public Id withTags(Iterable<Tag> ts) {
  MonitorConfig.Builder builder = new MonitorConfig.Builder(config);
  for (Tag t : ts) {
    builder.withTag(t.key(), t.value());
  }
  return new ServoId(builder.build());
}
 
开发者ID:Netflix,项目名称:spectator,代码行数:8,代码来源:ServoId.java

示例6: addMetric

import com.netflix.servo.monitor.MonitorConfig; //导入方法依赖的package包/类
private void addMetric(KafkaMetric metric) {
    MetricName metricName = metric.metricName();
    MonitorConfig.Builder builder = MonitorConfig.builder(metricName.name())
        .withTag("group", metricName.group());
    for(Map.Entry<String, String> tag : metricName.tags().entrySet()) {
        builder.withTag(tag.getKey(), tag.getValue());
    }
    MonitorConfig monitorConfig = builder.build();
    gauges.put(Servo.getDoubleGauge(monitorConfig), metric);
}
 
开发者ID:Netflix,项目名称:suro,代码行数:11,代码来源:ServoReporter.java

示例7: getMonitorConfig

import com.netflix.servo.monitor.MonitorConfig; //导入方法依赖的package包/类
public MonitorConfig getMonitorConfig(final String metricName, final Tag tag, final TagList tagList) {
    MonitorConfig mc = monitorConfigMap.get(metricName);
    if (mc != null) return mc;

    final MonitorConfig.Builder monitorConfig = MonitorConfig.builder(metricName);
    if (tagList != null) monitorConfig.withTags(tagList);
    if (tag != null) monitorConfig.withTag(tag);
    mc = monitorConfig.build();
    monitorConfigMap.put(metricName, mc);
    return mc;
}
 
开发者ID:Netflix,项目名称:EVCache,代码行数:12,代码来源:EVCacheConfig.java


注:本文中的com.netflix.servo.monitor.MonitorConfig.Builder方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。