gerrit/javatests/com/google/gerrit/metrics
David Pursehouse 7b518731ad DropWizardMetricMaker: Move sanitizeMetricName to MetricMaker base class
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
2018-06-08 09:37:02 +09:00
..
dropwizard DropWizardMetricMaker: Move sanitizeMetricName to MetricMaker base class 2018-06-08 09:37:02 +09:00
proc Move Truth rules to a subdirectory of lib 2018-05-16 14:20:06 -07:00