本文整理汇总了Java中com.ibm.streams.operator.metrics.Metric类的典型用法代码示例。如果您正苦于以下问题:Java Metric类的具体用法?Java Metric怎么用?Java Metric使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Metric类属于com.ibm.streams.operator.metrics包,在下文中一共展示了Metric类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createCustomMetric
import com.ibm.streams.operator.metrics.Metric; //导入依赖的package包/类
@Override
public synchronized void createCustomMetric(String name, String description, String kind, LongSupplier value) {
LongSupplier supplier = requireNonNull(value);
Metric cm = context.getMetrics().createCustomMetric(
requireNonNull(name),
requireNonNull(description),
Metric.Kind.valueOf(kind.toUpperCase(Locale.US)));
cm.setValue(supplier.getAsLong());
if (metrics == null) {
metrics = new ArrayList<>();
metricsGetter = getScheduledExecutorService().scheduleWithFixedDelay(this::updateMetrics,
1, 1, TimeUnit.SECONDS);
}
metrics.add(() -> cm.setValue(supplier.getAsLong()));
}
示例2: setIsConnected
import com.ibm.streams.operator.metrics.Metric; //导入依赖的package包/类
/**
* isConnected metric describes current connection status to Elasticsearch server.
* @param isConnected
*/
@CustomMetric(name = "isConnected", kind = Metric.Kind.GAUGE,
description = "Describes whether we are currently connected to Elasticsearch server.")
public void setIsConnected(Metric isConnected) {
this.isConnected = isConnected;
}
示例3: setTotalFailedRequests
import com.ibm.streams.operator.metrics.Metric; //导入依赖的package包/类
/**
* totalFailedRequests describes the number of failed inserts/gets over the lifetime of the operator.
* @param totalFailedRequests
*/
@CustomMetric(name = "totalFailedRequests", kind = Metric.Kind.COUNTER,
description = "The number of failed inserts/gets over the lifetime of the operator.")
public void setTotalFailedRequests(Metric totalFailedRequests) {
this.totalFailedRequests = totalFailedRequests;
}
示例4: setNumInserts
import com.ibm.streams.operator.metrics.Metric; //导入依赖的package包/类
/**
* numInserts metric describes the number of times a record has been successfully written.
* @param numInserts
*/
@CustomMetric(name = "numInserts", kind = Metric.Kind.COUNTER,
description = "The number of times a record has been written to the Elasticsearch server.")
public void setNumInserts(Metric numInserts) {
this.numInserts = numInserts;
}
示例5: setReconnectionCount
import com.ibm.streams.operator.metrics.Metric; //导入依赖的package包/类
/**
* isConnected metric describes current connection status to Elasticsearch server.
* @param reconnectionCount
*/
@CustomMetric(name = "reconnectionCount", kind = Metric.Kind.COUNTER,
description = "The number of times the operator has tried reconnecting to the server since the last successful connection.")
public void setReconnectionCount(Metric reconnectionCount) {
this.reconnectionCount = reconnectionCount;
}
示例6: bytes
import com.ibm.streams.operator.metrics.Metric; //导入依赖的package包/类
/**
* The average size of inserted records, in bytes, within the current type.
* @param avgInsertSizeBytes
*/
@CustomMetric(name = "avgInsertSizeBytes", kind = Metric.Kind.GAUGE,
description = "The average size of inserted records, in bytes (aggregated over all documents within the current type).")
public void setAvgInsertSizeBytes(Metric avgInsertSizeBytes) {
this.avgInsertSizeBytes = avgInsertSizeBytes;
}
示例7: getnPartitions
import com.ibm.streams.operator.metrics.Metric; //导入依赖的package包/类
public Metric getnPartitions() {
return nPartitions;
}
示例8: setnPartitions
import com.ibm.streams.operator.metrics.Metric; //导入依赖的package包/类
@CustomMetric(kind = Kind.GAUGE)
public void setnPartitions(Metric nPartitions) {
this.nPartitions = nPartitions;
}