220.8. Metric type histogram
metrics:histogram:metricname[?options]
metrics:histogram:metricname[?options]
220.8.1. 选项 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
名称 | default | 描述 |
---|---|---|
value | - | 在直方图中使用的值 |
如果没有设置任何 值
,则会将任何值添加到直方图,则会记录警告。
// adds value 9923 to simple.histogram from("direct:in") .to("metric:histogram:simple.histogram?value=9923") .to("direct:out");
// adds value 9923 to simple.histogram
from("direct:in")
.to("metric:histogram:simple.histogram?value=9923")
.to("direct:out");
// nothing is added to simple.histogram; warning is logged from("direct:in") .to("metric:histogram:simple.histogram") .to("direct:out");
// nothing is added to simple.histogram; warning is logged
from("direct:in")
.to("metric:histogram:simple.histogram")
.to("direct:out");
220.8.2. Headers 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
消息标头可用于覆盖指标组件 URI 中指定的值。
名称 | 描述 | 预期类型 |
---|---|---|
CamelMetricsHistogramValue | 覆盖 URI 中的直方图值 | Long |
// adds value 992 to simple.histogram from("direct:in") .setHeader(MetricsConstants.HEADER_HISTOGRAM_VALUE, constant(992L)) .to("metrics:histogram:simple.histogram?value=700") .to("direct:out")
// adds value 992 to simple.histogram
from("direct:in")
.setHeader(MetricsConstants.HEADER_HISTOGRAM_VALUE, constant(992L))
.to("metrics:histogram:simple.histogram?value=700")
.to("direct:out")