com.inmobi.conduit.metrics
Class ConduitMetrics

java.lang.Object
  extended by com.inmobi.conduit.metrics.ConduitMetrics

public class ConduitMetrics
extends Object

Metrics manager class. Will use codahale metrics as the implementation. Contains functions to register Gauges/Counters and start/stop reporters


Constructor Summary
ConduitMetrics()
           
 
Method Summary
static
<T extends com.codahale.metrics.Metric>
T
getMetric(String serviceName, String counterType, String context)
          Get a counter from the cache
static void incCounter(String serviceName, String counterType, String context, long value)
           
static void init(Properties config)
          Will create reporters based on config
static AbsoluteGauge registerAbsoluteGauge(String name, Number initalValue)
          Create an AbsoluteGauge
static AbsoluteGauge registerAbsoluteGauge(String serviceName, String counterType, String context)
           
static com.codahale.metrics.Counter registerCounter(String serviceName, String counterType, String context)
          Register a counter
static com.codahale.metrics.Gauge registerGauge(String name, com.codahale.metrics.Gauge gaugeInst)
           
static SlidingTimeWindowGauge registerSlidingWindowGauge(String serviceName, String counterType, String context)
           
static void startAll()
          Will start all reporters
static void stopAll()
          Will stop all reporters
static void updateAbsoluteGauge(String serviceName, String counterType, String context, Number value)
           
static void updateSWGuage(String serviceName, String counterType, String context, long value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConduitMetrics

public ConduitMetrics()
Method Detail

init

public static void init(Properties config)
                 throws IOException
Will create reporters based on config

Throws:
IOException

startAll

public static void startAll()
Will start all reporters


stopAll

public static void stopAll()
Will stop all reporters


registerAbsoluteGauge

public static AbsoluteGauge registerAbsoluteGauge(String serviceName,
                                                  String counterType,
                                                  String context)

registerAbsoluteGauge

public static AbsoluteGauge registerAbsoluteGauge(String name,
                                                  Number initalValue)
Create an AbsoluteGauge


updateAbsoluteGauge

public static void updateAbsoluteGauge(String serviceName,
                                       String counterType,
                                       String context,
                                       Number value)

registerGauge

public static com.codahale.metrics.Gauge registerGauge(String name,
                                                       com.codahale.metrics.Gauge gaugeInst)

registerCounter

public static com.codahale.metrics.Counter registerCounter(String serviceName,
                                                           String counterType,
                                                           String context)
Register a counter


getMetric

public static <T extends com.codahale.metrics.Metric> T getMetric(String serviceName,
                                                                  String counterType,
                                                                  String context)
Get a counter from the cache


incCounter

public static void incCounter(String serviceName,
                              String counterType,
                              String context,
                              long value)

registerSlidingWindowGauge

public static SlidingTimeWindowGauge registerSlidingWindowGauge(String serviceName,
                                                                String counterType,
                                                                String context)

updateSWGuage

public static void updateSWGuage(String serviceName,
                                 String counterType,
                                 String context,
                                 long value)


Copyright © 2014 InMobi. All rights reserved.