Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-10967

Improve Gauge support in metrics

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Commons Metrics 1.2.8
    • Commons Metrics 1.2.10
    • Commons
    • None

    Description

      Currently Sling Metrics only support Gauges via the whiteboard approach (see SLING-5966).

      To leverage gauges you have to register a gauge instance by yourself using the OSGI Framework API and also its whole livecycle. The Sling MetricsService should be able to handle this for you as well like it does for the other metric types (e.g. counter).

      I propose to extend the MetricsService by a new method:

      Gauge<T> registerGauge (String name, Supplier<T> supplier);
      

      which registers a Gauge which on every request to getValue() calls the provided supplier. In most cases the returned Gauge object is not used, but it is returned for consistency with other methods of the MetricsService.

      Attachments

        Activity

          People

            joerghoh Joerg Hoh
            joerghoh Joerg Hoh
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 2h 10m
                2h 10m