DUE TO SPAM, SIGN-UP IS DISABLED. Goto Selfserve wiki signup and request an account.
...
| Code Block | ||
|---|---|---|
| ||
metrics:counter:metricname[?options] |
Options
Name | Default | Description |
|---|---|---|
|
| Long value to add to the counter |
|
| Long value to subtract from the counter |
If neither increment or decrement is defined then counter value will be incremented by one. If increment and decrement are both defined only increment operation is called.
...
Message headers can be used to override increment and decrement values specified in the metrics component URI.
Name | Description | Expected type |
|---|---|---|
| Override increment value in URI |
|
| Override decrement value in URI |
|
| Code Block | ||
|---|---|---|
| ||
// update counter simple.counter by 417
from("direct:in")
.setHeader(MetricsConstants.HEADER_COUNTER_INCREMENT, constant(417L))
.to("metric:counter:simple.counter?increment=7")
.to("direct:out"); |
...
| Code Block | ||
|---|---|---|
| ||
metrics:histogram:metricname[?options] |
Options
Name | Default | Description |
|---|---|---|
|
| Value to use in histogram |
If no value is not set nothing is added to histogram and warning is logged.
...
Message header can be used to override value specified in metrics component URI.
Name | Description | Expected type |
|---|---|---|
| Override histogram value in URI |
|
| Code Block | ||
|---|---|---|
| ||
// Adds value 992 to simple.histogram
from("direct:in")
.setHeader(MetricsConstants.HEADER_HISTOGRAM_VALUE, constant(992L))
.to("metric:histogram:simple.histogram?value=700")
.to("direct:out") |
...
| Code Block | ||
|---|---|---|
| ||
metrics:meter:metricname[?options] |
Options
Name | Default | Description |
|---|---|---|
|
| Long value to use as mark |
If mark is not set then meter.mark() is called without argument.
...
Message header can be used to override mark value specified in metrics component URI.
Name | Description | Expected type |
|---|---|---|
| Override mark value in URI |
|
| Code Block | ||
|---|---|---|
| ||
// updates meter simple.meter with value 345
from("direct:in")
.setHeader(MetricsConstants.HEADER_METER_MARK, constant(345L))
.to("metric:meter:simple.meter?mark=123")
.to("direct:out"); |
...
| Code Block | ||
|---|---|---|
| ||
metrics:timer:metricname[?options] |
Options
Name | Default | Description |
|---|---|---|
|
| start or stop |
If no action or invalid value is provided then warning is logged without any timer update. If action start is called on already running timer or stop is called on not running timer then nothing is updated and warning is logged.
...
Message header can be used to override action value specified in metrics component URI.
Name | Description | Expected type |
|---|---|---|
| Override timer action in URI |
|
| Code Block | ||
|---|---|---|
| ||
// sets timer action using header
from("direct:in")
.setHeader(MetricsConstants.HEADER_TIMER_ACTION, TimerAction.start)
.to("metric:timer:simple.timer")
.to("direct:out"); |
...
The MetricsRoutePolicyFactory and MetricsRoutePolicy supports the following options:
Name | Default | Description |
|---|---|---|
|
| Whether to report fine grained statistics to JMX by using the Notice that if JMX is enabled on CamelContext then a |
|
| The JMX domain name. |
|
| Whether to use pretty print when outputting statistics in JSON format. |
| Allow to use a shared | |
|
| The unit to use for rate in the metrics reporter or when dumping the statistics as JSON. |
|
| The unit to use for duration in the metrics reporter or when dumping the statistics as JSON. |
|
| Camel 2.17: The name pattern to use. Uses dot as separators, but you can change that. The values |
...
The following options is supported on the factory:
Name | Default | Description |
|---|---|---|
|
| Whether to report fine grained statistics to JMX by using the Notice that if JMX is enabled on CamelContext then a |
|
| The JMX domain name. |
|
| Whether to use pretty print when outputting statistics in JSON format. |
| Allow to use a shared | |
|
| The unit to use for rate in the metrics reporter or when dumping the statistics as JSON. |
|
| The unit to use for duration in the metrics reporter or when dumping the statistics as JSON |
|
| The name pattern to use. Uses dot as separators, but you can change that. The values |
At runtime the metrics can be accessed from Java API or JMX which allows to gather the data as JSON output.
...