|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.netflix.servo.monitor.Monitors
public final class Monitors
Some helper functions for creating monitor objects.
Method Summary | |
---|---|
static CompositeMonitor<?> |
newCacheMonitor(java.lang.String id,
com.google.common.cache.Cache<?,?> cache)
Creates a new monitor for a cache with standard metrics for the hits, misses, and loads. |
static Counter |
newCounter(java.lang.String name)
Create a new counter instance. |
static Counter |
newCounter(java.lang.String name,
TaggingContext context)
Create a new counter with a name and context. |
static CompositeMonitor<?> |
newObjectMonitor(java.lang.Object obj)
Helper function to easily create a composite for all monitor fields and annotated attributes of a given object. |
static CompositeMonitor<?> |
newObjectMonitor(java.lang.String id,
java.lang.Object obj)
Helper function to easily create a composite for all monitor fields and annotated attributes of a given object. |
static CompositeMonitor<?> |
newThreadPoolMonitor(java.lang.String id,
java.util.concurrent.ThreadPoolExecutor pool)
Creates a new monitor for a thread pool with standard metrics for the pool size, queue size, task counts, etc. |
static Timer |
newTimer(java.lang.String name)
Create a new timer with only the name specified. |
static Timer |
newTimer(java.lang.String name,
TaggingContext context)
Create a new timer with a name and context. |
static Timer |
newTimer(java.lang.String name,
java.util.concurrent.TimeUnit unit)
Create a new timer with only the name specified. |
static Timer |
newTimer(java.lang.String name,
java.util.concurrent.TimeUnit unit,
TaggingContext context)
Create a new timer with a name and context. |
static void |
registerObject(java.lang.Object obj)
Register an object with the default registry. |
static void |
registerObject(java.lang.String id,
java.lang.Object obj)
Register an object with the default registry. |
static void |
unregisterObject(java.lang.Object obj)
Unregister an object from the default registry. |
static void |
unregisterObject(java.lang.String id,
java.lang.Object obj)
Unregister an object from the default registry. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static Timer newTimer(java.lang.String name)
public static Timer newTimer(java.lang.String name, TaggingContext context)
public static Timer newTimer(java.lang.String name, java.util.concurrent.TimeUnit unit)
public static Timer newTimer(java.lang.String name, java.util.concurrent.TimeUnit unit, TaggingContext context)
public static Counter newCounter(java.lang.String name)
public static Counter newCounter(java.lang.String name, TaggingContext context)
public static CompositeMonitor<?> newObjectMonitor(java.lang.Object obj)
public static CompositeMonitor<?> newObjectMonitor(java.lang.String id, java.lang.Object obj)
id
- a unique id associated with this particular instance of the
object. If multiple objects of the same class are registered
they will have the same config and conflict unless the id
values are distinct.obj
- object to search for monitors on. All fields of type
Monitor
and fields/methods with a
Monitor
annotation
will be extracted and returned using
CompositeMonitor.getMonitors()
.
public static CompositeMonitor<?> newThreadPoolMonitor(java.lang.String id, java.util.concurrent.ThreadPoolExecutor pool)
id
- id to differentiate metrics for this pool from others.pool
- thread pool instance to monitor.
public static CompositeMonitor<?> newCacheMonitor(java.lang.String id, com.google.common.cache.Cache<?,?> cache)
id
- id to differentiate metrics for this cache from others.cache
- cache instance to monitor.
public static void registerObject(java.lang.Object obj)
DefaultMonitorRegistry.getInstance().register(Monitors.newObjectMonitor(obj))
.
public static void unregisterObject(java.lang.Object obj)
DefaultMonitorRegistry.getInstance().unregister(Monitors.newObjectMonitor(obj))
.
obj
- Previously registered using Monitors.registerObject(obj)
public static void unregisterObject(java.lang.String id, java.lang.Object obj)
DefaultMonitorRegistry.getInstance().unregister(Monitors.newObjectMonitor(id, obj))
.
obj
- Previously registered using Monitors.registerObject(id, obj)
public static void registerObject(java.lang.String id, java.lang.Object obj)
DefaultMonitorRegistry.getInstance().register(Monitors.newObjectMonitor(id, obj))
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |