-Refactor MetricsSystemImpl to allow for an on-demand publish system (HADOOP-9090)
Yesterday I filed a JIRA
to propose a refactoring of the MetricsSystemImpl class - the default
(only?) implementation of the Metrics2 system - to factor out some common
code in a base class and have another simple implementation that just does
on-demand publishing of metrics instead of the default periodic publishing.
The main motivation for filing this JIRA and the attached patch is that we
(Microsoft) have a need to publish metrics out of short-lived processes
(think "hadoop fs -ls") and the periodic behavior of the default
implementation doesn't really work well for those. We could write our own
metrics system implementation (and we'll probably do that in the short
term) but that would mean duplicating a lot of great code that's already in
the MetricsSystemImpl class, hence the proposal to factor out the common
code into a base class.
Does that sound reasonable? Please comment on the JIRA directly or reply
here - if the proposal sounds awful (or great) or there's something I'm
fundamentally missing I'd love to hear that feedback.