Dragoman uses Vert.x DropWizard Metrics to gather and emit metrics.
These metrics include size and throughput values for:
The metrics output is available in several flavours …
The MetricsFacade
wraps Vert.x’s MetricsService
and, using a Vert.x timer, it periodically writes the latest metrics snapshot to the logger: metrics-logger
. The periodicity is controller by the application property: metrics.publication.period.in.millis
.
Although the metrics output is written in JSON, it is quite verbose so not easily readable (human readable, at least). It is expected that anyone wishing to make use of the logged metrics output will write to file and will use a tool (Graylog perhaps) to ingest that file and provide visualisations of it. To facilitate this approach:
metrics-logger
is always written to file when the -Dlog.dir
property is supplied at runtimeThe metrics
endpoint exposes a JSON representation of the lastest metrics snapshot. By default, this emits the entire snapshot but the response can be qualified by:
metrics/get-requests
will only return the get-requests
metric/metrics?regex=responses.*
will return only those metrics having a name which starts with responses
Each metric is exposed via a JMX MBean, all of these MBeans are available in a MBean domain named: dragoman
. These MBeans can be accessed using any JMX client. Here’s a screenshot showing some of these MBeans viewed in JVisualVM (after installing the MBeans Browser plugin):
JVisualVM provides some rudimentary visualisation of numeric metrics. If you double click on a numeric value in the attributes tab then a graph will appear, this will be updated as the underlying value changes. For example: