Package org.apache.sling.commons.metrics

# Class MetricsServiceFactory

java.lang.Object
org.apache.sling.commons.metrics.MetricsServiceFactory

public class MetricsServiceFactory extends Object
Utility that provides a MetricsService to any class that has been loaded from an OSGi bundle. This is meant to make it as easy to access the MetricsService as it is to get a Logger, for example.

## Constructor Summary

Constructors
Constructor
Description
`MetricsServiceFactory()`

## Method Summary

Modifier and Type
Method
Description
`static MetricsService`
`getMetricsService(Class<?> c)`
Provide a MetricsService mapped to the Bundle that loaded class c

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### MetricsServiceFactory

public MetricsServiceFactory()

## Method Details

### getMetricsService

public static MetricsService getMetricsService(Class<?> c)
Provide a MetricsService mapped to the Bundle that loaded class c

Parameters:
  `c` - a Class loaded by an OSGi bundle
Returns:
  a MetricsService