public class Monitor
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static void |
cancelMeasurePerfFor(PerformanceEventName eventName)
This method will remove the temporary metrics data for the specific performance event.
|
static void |
cancelMeasurePerfFor(PerformanceEventName eventName,
long extraId)
This method will remove the temporary metrics data for the specific performance event.
|
protected static void |
enable()
Enable Monitor will fetch the sampling rates from the server and send the logs from
MonitorLoggingStore
|
static long |
generateExtraId()
This method will generate an unique number each time when it has been called.
|
static boolean |
isEnabled() |
static void |
startMeasurePerfFor(PerformanceEventName eventName)
start to measure the performance for the specific event, which is the target function(s)
|
static void |
startMeasurePerfFor(PerformanceEventName eventName,
long extraId)
start to measure the performance for the specific event, which is the target function(s)
|
static void |
stopMeasurePerfFor(PerformanceEventName eventName)
stop to measure the performance for the specific event, which is the target function(s)
calculate the metrics data and create a new log which will be sent to the server later
|
static void |
stopMeasurePerfFor(PerformanceEventName eventName,
long extraId)
stop to measure the performance for the specific event, which is the target function(s)
calculate the metrics data and create a new log which will be sent to the server later
|
protected static void enable()
public static void startMeasurePerfFor(PerformanceEventName eventName, long extraId)
need to call stopMeasurePerfFor for the same event at the point you want to stop measuring
eventName - indicates the target function(s)extraId - is an extra id that will be used with the performance event name, each
measurement tracks the same event name and extra id. Especially For the case that
startMeasurePerfFor and stopMeasurePerfFor are called from the different threadspublic static void startMeasurePerfFor(PerformanceEventName eventName)
need to call stopMeasurePerfFor for the same event at the point you want to stop measuring
This method will use the current thread id as the default extra id. If startMeasurePerfFor and stopMeasurePerfFor are called from the different threads, don't use this method. Please pass performance event name and an extra id generated by generateExtraId for both startMeasurePerfFor and stopMeasurePerfFor.
eventName - indicates the target function(s)public static void stopMeasurePerfFor(PerformanceEventName eventName, long extraId)
need to call startMeasurePerfFor for the same event at the point you want to start measuring
eventName - indicates the target function(s)extraId - is an extra id that will be used with the performance event name, each
measurement tracks the same event name and extra id. Especially For the case that
startMeasurePerfFor and stopMeasurePerfFor are called from the different threadspublic static void stopMeasurePerfFor(PerformanceEventName eventName)
need to call startMeasurePerfFor for the same event at the point you want to start measuring
This method will use the current thread id as the default extra id. If startMeasurePerfFor and stopMeasurePerfFor are called from the different threads, don't use this method. Please pass performance event name and an extra id generated by generateExtraId for both startMeasurePerfFor and stopMeasurePerfFor.
eventName - indicates the target function(s)public static void cancelMeasurePerfFor(PerformanceEventName eventName)
If startMeasurePerfFor and stopMeasurePerfFor has been passed the extra id generated by generateExtraId, please pass the same extra id into the param.
eventName - the target function(s)public static void cancelMeasurePerfFor(PerformanceEventName eventName, long extraId)
eventName - the target function(s)extraId - is the one you used in the call startMeasurePerfFor the target performance eventpublic static long generateExtraId()
public static boolean isEnabled()