![]() The DropWizardMetricMaker#sanitizeMetricName method was added in change Ic0074b53f and used in change I332cb50b8 to prevent work queue metrics from being created with names that Dropwizard rejected. Those changes made the WorkQueue class dependent on the Dropwizard metrics implementation, which is contrary to the way the metrics system was designed: MetricMaker is the metrics interface, and DropWizardMetricMaker is the concrete implementation of it used in open source Gerrit. The reason it was done in this way was to allow Google to replace Dropwizard with their own metrics backend. Instead of calling the static DropWizardMetricMaker method, classes should refer to a method on the MetricMaker interface, so that it also works if the implementation is replaced with something else. Hoist sanitizeMetricName up to MetricMaker as a public method with a default implementation that only returns the input, and override it in the DropWizardMetricMaker. Change-Id: Iacaed3bbf36f17b87680255de8afb265ab73c06b |
||
---|---|---|
.. | ||
dropwizard | ||
proc |