[
https://issues.apache.org/jira/browse/SLING-5966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15672884#comment-15672884
]
Chetan Mehrotra commented on SLING-5966:
----------------------------------------
Added support in 1770122. Now other bundles can register a service of type
{{org.apache.sling.commons.metrics.Gauge}}. As part of service registration the
client code should provide a {{name}} property. Then this instance would be
registered with {{MetricsRegistry}} via whiteboard pattern
{code}
public interface Gauge<T> {
/**
* Service property name which determines the name of the Gauge
*/
String NAME = "name";
/**
* Returns the metric's current value.
*
* @return the metric's current value
*/
T getValue();
}
{code}
> Add Gauge support to metrics
> ----------------------------
>
> Key: SLING-5966
> URL: https://issues.apache.org/jira/browse/SLING-5966
> Project: Sling
> Issue Type: New Feature
> Components: Commons
> Affects Versions: Commons Metrics 1.0.0
> Reporter: Stefan Egli
> Assignee: Chetan Mehrotra
> Labels: docs-impacting
> Fix For: Commons Metrics 1.2.2
>
>
> It would be useful to have support for {{Gauge}} in Sling Commons Metrics
> (the same way as is done for the four other supported metrics types)
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)