org.apache.samza.metrics.Gauge.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(4.0k)|赞(0)|评价(0)|浏览(144)

本文整理了Java中org.apache.samza.metrics.Gauge.<init>()方法的一些代码示例,展示了Gauge.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Gauge.<init>()方法的具体详情如下:
包路径:org.apache.samza.metrics.Gauge
类名称:Gauge
方法名:<init>

Gauge.<init>介绍

暂无

代码示例

代码示例来源:origin: apache/samza

@Override
public <T> Gauge<T> newGauge(String group, String name, T value) {
 return new Gauge<T>(name, value);
}

代码示例来源:origin: org.apache.samza/samza-api

@Override
public <T> Gauge<T> newGauge(String group, String name, T value) {
 return new Gauge<T>(name, value);
}

代码示例来源:origin: org.apache.samza/samza-core_2.12

public <T> Gauge<T> newGauge(String name, T value) {
 return registry.newGauge(groupName, new Gauge<T>((prefix + name).toLowerCase(), value));
}

代码示例来源:origin: apache/samza

public <T> Gauge<T> newGauge(String name, T value) {
 return registry.newGauge(groupName, new Gauge<T>((prefix + name).toLowerCase(), value));
}

代码示例来源:origin: org.apache.samza/samza-core_2.11

public <T> Gauge<T> newGauge(String name, T value) {
 return registry.newGauge(groupName, new Gauge<T>((prefix + name).toLowerCase(), value));
}

代码示例来源:origin: org.apache.samza/samza-core_2.10

public <T> Gauge<T> newGauge(String name, T value) {
 return registry.newGauge(groupName, new Gauge<T>((prefix + name).toLowerCase(), value));
}

代码示例来源:origin: org.apache.samza/samza-core

public <T> Gauge<T> newGauge(String name, T value) {
 return registry.newGauge(groupName, new Gauge<T>((prefix + name).toLowerCase(), value));
}

代码示例来源:origin: apache/samza

public <T> Gauge<T> newGauge(String name, final ValueFunction<T> valueFunc) {
 return registry.newGauge(groupName, new Gauge<T>((prefix + name).toLowerCase(), valueFunc.getValue()) {
  @Override
  public T getValue() {
   return valueFunc.getValue();
  }
 });
}

代码示例来源:origin: org.apache.samza/samza-core_2.10

public <T> Gauge<T> newGauge(String name, final ValueFunction<T> valueFunc) {
 return registry.newGauge(groupName, new Gauge<T>((prefix + name).toLowerCase(), valueFunc.getValue()) {
  @Override
  public T getValue() {
   return valueFunc.getValue();
  }
 });
}

代码示例来源:origin: org.apache.samza/samza-core_2.11

public <T> Gauge<T> newGauge(String name, final ValueFunction<T> valueFunc) {
 return registry.newGauge(groupName, new Gauge<T>((prefix + name).toLowerCase(), valueFunc.getValue()) {
  @Override
  public T getValue() {
   return valueFunc.getValue();
  }
 });
}

代码示例来源:origin: org.apache.samza/samza-core

public <T> Gauge<T> newGauge(String name, final ValueFunction<T> valueFunc) {
 return registry.newGauge(groupName, new Gauge<T>((prefix + name).toLowerCase(), valueFunc.getValue()) {
  @Override
  public T getValue() {
   return valueFunc.getValue();
  }
 });
}

代码示例来源:origin: org.apache.samza/samza-core_2.12

public <T> Gauge<T> newGauge(String name, final ValueFunction<T> valueFunc) {
 return registry.newGauge(groupName, new Gauge<T>((prefix + name).toLowerCase(), valueFunc.getValue()) {
  @Override
  public T getValue() {
   return valueFunc.getValue();
  }
 });
}

代码示例来源:origin: apache/samza

@Override
public <T> Gauge<T> newGauge(String group, String name, T value) {
 if (!gauges.containsKey(group)) {
  gauges.put(group, new ArrayList<>());
 }
 Gauge<T> g = new Gauge<>(name, value);
 gauges.get(group).add(g);
 return g;
}

代码示例来源:origin: apache/samza

@Override
public <T> Gauge<T> newGauge(String group, String name, T value) {
 Gauge<T> gauge = new Gauge<>(name, value);
 return newGauge(group, gauge);
}

代码示例来源:origin: apache/samza

public static Context getMockContext() {
 Context context = new MockContext();
 MetricsRegistry metricsRegistry = mock(MetricsRegistry.class);
 doAnswer(args -> new Timer((String) args.getArguments()[0])).when(metricsRegistry).newTimer(anyString(), anyString());
 doAnswer(args -> new Counter((String) args.getArguments()[0])).when(metricsRegistry).newCounter(anyString(), anyString());
 doAnswer(args -> new Gauge((String) args.getArguments()[0], 0)).when(metricsRegistry).newGauge(anyString(), any());
 doReturn(metricsRegistry).when(context.getContainerContext()).getContainerMetricsRegistry();
 return context;
}

相关文章