Browse Source
The `MetricNameTemplate` is changed to used a `LinkedHashSet` to maintain the same order of the tags that are passed in. This tag order is then maintained when `Metrics.toHtmlTable` generates the MBean names for each of the metrics. The `SenderMetricsRegistry` and `FetcherMetricsRegistry` both contain templates used in the producer and consumer, respectively, and these were changed to use a `LinkedHashSet` to maintain the order of the tags. Before this change, the generated HTML documentation might use MBean names like the following and order them: ``` kafka.connect:type=sink-task-metrics,connector={connector},partition={partition},task={task},topic={topic} kafka.connect:type=sink-task-metrics,connector={connector},task={task} ``` However, after this change, the documentation would use the following order: ``` kafka.connect:type=sink-task-metrics,connector={connector},task={task} kafka.connect:type=sink-task-metrics,connector={connector},task={task},topic={topic},partition={partition} ``` This is more readable as the code that is creating the templates has control over the order of the tags. Note that JMX MBean names use ObjectName that does not maintain order of the properties (tags), so this change should have no impact on the actual JMX MBean names used in the metrics. cc wushujames Author: Randall Hauch <rhauch@gmail.com> Reviewers: James Cheng <jylcheng@yahoo.com>, Ewen Cheslack-Postava <ewen@confluent.io> Closes #3985 from rhauch/kafka-5987pull/3985/merge
Randall Hauch
7 years ago
committed by
Ewen Cheslack-Postava
4 changed files with 66 additions and 17 deletions
Loading…
Reference in new issue