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


Java Metric类代码示例

本文整理汇总了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()));
}
 
开发者ID:IBMStreams,项目名称:streamsx.topology,代码行数:20,代码来源:FunctionOperatorContext.java

示例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;
}
 
开发者ID:IBMStreams,项目名称:streamsx.elasticsearch,代码行数:10,代码来源:ElasticsearchRestIndex.java

示例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;
}
 
开发者ID:IBMStreams,项目名称:streamsx.elasticsearch,代码行数:10,代码来源:ElasticsearchRestIndex.java

示例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;
}
 
开发者ID:IBMStreams,项目名称:streamsx.elasticsearch,代码行数:10,代码来源:ElasticsearchRestIndex.java

示例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;
}
 
开发者ID:IBMStreams,项目名称:streamsx.elasticsearch,代码行数:10,代码来源:ElasticsearchRestIndex.java

示例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;
}
 
开发者ID:IBMStreams,项目名称:streamsx.elasticsearch,代码行数:10,代码来源:ElasticsearchRestIndex.java

示例7: getnPartitions

import com.ibm.streams.operator.metrics.Metric; //导入依赖的package包/类
public Metric getnPartitions() {
    return nPartitions;
}
 
开发者ID:IBMStreams,项目名称:streamsx.topology,代码行数:4,代码来源:FunctionWindow.java

示例8: setnPartitions

import com.ibm.streams.operator.metrics.Metric; //导入依赖的package包/类
@CustomMetric(kind = Kind.GAUGE)
public void setnPartitions(Metric nPartitions) {
    this.nPartitions = nPartitions;
}
 
开发者ID:IBMStreams,项目名称:streamsx.topology,代码行数:5,代码来源:FunctionWindow.java


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