你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

LongCounter Interface

public interface LongCounter

A counter instrument that records long values.

Counters only allow adding positive values, and guarantee the resulting metrics will be always-increasing monotonic sums.

Method Summary

Modifier and Type Method and Description
abstract void add(long value, TelemetryAttributes attributes, Context context)

Records a value with a set of attributes.

abstract boolean isEnabled()

Flag indicating if metric implementation is detected and functional, use it to minimize performance impact associated with metrics, e.g.

Method Details

add

public abstract void add(long value, TelemetryAttributes attributes, Context context)

Records a value with a set of attributes.

Parameters:

value - The amount of the measurement.
attributes - Collection of attributes representing metric dimensions.
context - The explicit context to associate with this measurement.

isEnabled

public abstract boolean isEnabled()

Flag indicating if metric implementation is detected and functional, use it to minimize performance impact associated with metrics, e.g. measuring latency.

Returns:

true if enabled, false otherwise

Applies to