Class OEnterpriseProfiler
java.lang.Object
com.orientechnologies.common.concur.resource.OSharedResourceAbstract
com.orientechnologies.common.profiler.OAbstractProfiler
com.orientechnologies.agent.profiler.OEnterpriseProfiler
- All Implemented Interfaces:
OProfiler,OProfilerMXBean,OService,OOrientStartupListener,ODistributedLifecycleListener
Profiling utility class. Handles chronos (times), statistics and counters. By default it's used
as Singleton but you can create any instances you want for separate profiling contexts.
To start the recording use call startRecording(). By default record is turned off to avoid a run-time execution cost.
- Author:
- Luca Garulli
-
Nested Class Summary
Nested classes/interfaces inherited from class com.orientechnologies.common.profiler.OAbstractProfiler
OAbstractProfiler.OProfilerHookRuntime, OAbstractProfiler.OProfilerHookStatic, OAbstractProfiler.OProfilerHookValueNested classes/interfaces inherited from interface com.orientechnologies.common.profiler.OProfiler
OProfiler.METRIC_TYPE -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected TimerTaskprotected TimerTaskprotected static final intprotected intstatic final intprotected Dateprotected final AtomicReference<OProfilerData>protected final intprotected AtomicBooleanprotected Set<OEnterpriseProfilerListener>protected OProfilerDataprotected OEnterpriseServerprotected final Timerprotected AtomicLongFields inherited from class com.orientechnologies.common.profiler.OAbstractProfiler
autoDumpTask, dictionary, hooks, listeners, recordingFrom, typesFields inherited from class com.orientechnologies.common.concur.resource.OSharedResourceAbstract
lock -
Constructor Summary
ConstructorsConstructorDescriptionOEnterpriseProfiler(int iElapsedToCreateSnapshot, OAbstractProfiler iParentProfiler, OEnterpriseServer server) -
Method Summary
Modifier and TypeMethodDescriptionprotected Map<String,OAbstractProfiler.OProfilerHookStatic> Must be not called inside a lock.voiddoublecpuUsage()doubledump()voiddump(PrintStream printStream) longgetCounter(String iStatName) String[]getHookValue(String iName) String[]protected AtomicIntegerbooleanvoidonDatabaseChangeStatus(String iNode, String iDatabaseName, ODistributedServerManager.DB_STATUS iNewStatus) Called upon change of database status on a node.voidonNodeJoined(String iNode) Called right after a node joined the cluster.booleanonNodeJoining(String iNode) Called when a node is joining the cluster.voidonNodeLeft(String iNode) Called right after a node left the cluster.voidvoidresetRealtime(String iText) voidsetAutoDump(int iSeconds) protected voidsetTip(String iMessage, AtomicInteger counter) voidshutdown()longbooleanlongstopChrono(String iName, String iDescription, long iStartTime) longstopChrono(String iName, String iDescription, long iStartTime, String iDictionaryName) longstopChrono(String iName, String iDescription, long iStartTime, String iDictionaryName, String iPayload) longstopChrono(String iName, String iDescription, long iStartTime, String iDictionaryName, String iPayload, String user) booleanvoidvoidupdateCounter(String iName, String iDescription, long iPlus) voidupdateCounter(String iName, String iDescription, long iPlus, String iMetadata) longupdateStat(String iName, String iDescription, long iValue) voidMethods inherited from class com.orientechnologies.common.profiler.OAbstractProfiler
dump, dumpEnvironment, getChronosAsString, getDatabaseMetric, getHookAsString, getMetadata, getName, getProcessMetric, getSystemMetric, getType, installMemoryChecker, isRecording, onStartup, registerHookValue, registerHookValue, registerListener, reportTip, startup, threadDump, unregisterHookValue, unregisterListener, updateMetadataMethods inherited from class com.orientechnologies.common.concur.resource.OSharedResourceAbstract
acquireExclusiveLock, acquireSharedLock, releaseExclusiveLock, releaseSharedLockMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.orientechnologies.orient.server.distributed.ODistributedLifecycleListener
onMessageAfterOp, onMessageBeforeOp, onMessageCurrentPayload, onMessageProcessEnd, onMessageProcessStart, onMessageReceived
-
Field Details
-
timer
-
BUFFER_SIZE
protected static final int BUFFER_SIZE- See Also:
-
KEEP_ALIVE
public static final int KEEP_ALIVE- See Also:
-
metricProcessors
protected final int metricProcessors -
lastReset
-
realTime
-
lastSnapshot
-
elapsedToCreateSnapshot
protected int elapsedToCreateSnapshot -
archiverTask
-
autoPause
-
server
-
paused
-
timestamp
-
profilerListeners
-
-
Constructor Details
-
OEnterpriseProfiler
public OEnterpriseProfiler() -
OEnterpriseProfiler
public OEnterpriseProfiler(int iElapsedToCreateSnapshot, OAbstractProfiler iParentProfiler, OEnterpriseServer server)
-
-
Method Details
-
configure
-
shutdown
public void shutdown()- Specified by:
shutdownin interfaceOService- Overrides:
shutdownin classOAbstractProfiler
-
setTip
- Specified by:
setTipin classOAbstractProfiler
-
getTip
- Specified by:
getTipin classOAbstractProfiler
-
getContext
- Specified by:
getContextin interfaceOProfiler
-
startRecording
public boolean startRecording()- Specified by:
startRecordingin interfaceOProfiler- Specified by:
startRecordingin interfaceOProfilerMXBean- Overrides:
startRecordingin classOAbstractProfiler
-
stopRecording
public boolean stopRecording()- Specified by:
stopRecordingin interfaceOProfiler- Specified by:
stopRecordingin interfaceOProfilerMXBean- Overrides:
stopRecordingin classOAbstractProfiler
-
updateCounter
- Specified by:
updateCounterin interfaceOProfiler- Overrides:
updateCounterin classOAbstractProfiler
-
updateCounter
- Specified by:
updateCounterin interfaceOProfiler
-
getCounter
- Specified by:
getCounterin interfaceOProfiler- Specified by:
getCounterin interfaceOProfilerMXBean
-
isEnterpriseEdition
public boolean isEnterpriseEdition()- Specified by:
isEnterpriseEditionin interfaceOProfiler
-
resetRealtime
- Specified by:
resetRealtimein interfaceOProfiler- Specified by:
resetRealtimein interfaceOProfilerMXBean
-
dump
- Specified by:
dumpin interfaceOProfiler- Overrides:
dumpin classOAbstractProfiler
-
toJSON
- Specified by:
toJSONin interfaceOProfiler- Overrides:
toJSONin classOAbstractProfiler
-
metadataToJSON
- Specified by:
metadataToJSONin interfaceOProfiler- Specified by:
metadataToJSONin interfaceOProfilerMXBean- Overrides:
metadataToJSONin classOAbstractProfiler
-
dump
- Specified by:
dumpin interfaceOProfiler- Specified by:
dumpin interfaceOProfilerMXBean- Overrides:
dumpin classOAbstractProfiler
-
startChrono
public long startChrono()- Specified by:
startChronoin interfaceOProfiler- Overrides:
startChronoin classOAbstractProfiler
-
registerProfilerListener
-
unregisterProfilerListener
-
stopChrono
- Specified by:
stopChronoin interfaceOProfiler- Overrides:
stopChronoin classOAbstractProfiler
-
stopChrono
- Specified by:
stopChronoin interfaceOProfiler- Overrides:
stopChronoin classOAbstractProfiler
-
stopChrono
public long stopChrono(String iName, String iDescription, long iStartTime, String iDictionaryName, String iPayload) - Specified by:
stopChronoin interfaceOProfiler
-
stopChrono
public long stopChrono(String iName, String iDescription, long iStartTime, String iDictionaryName, String iPayload, String user) - Specified by:
stopChronoin interfaceOProfiler
-
updateStat
-
dumpCounters
- Specified by:
dumpCountersin interfaceOProfiler- Specified by:
dumpCountersin interfaceOProfilerMXBean- Overrides:
dumpCountersin classOAbstractProfiler
-
dumpChronos
- Specified by:
dumpChronosin interfaceOProfiler- Specified by:
dumpChronosin interfaceOProfilerMXBean- Overrides:
dumpChronosin classOAbstractProfiler
-
dumpStats
-
dumpHookValues
-
getHookValue
- Specified by:
getHookValuein interfaceOProfiler
-
getCountersAsString
- Specified by:
getCountersAsStringin interfaceOProfiler- Specified by:
getCountersAsStringin interfaceOProfilerMXBean- Overrides:
getCountersAsStringin classOAbstractProfiler
-
getStatsAsString
-
getLastReset
- Specified by:
getLastResetin interfaceOProfiler- Specified by:
getLastResetin interfaceOProfilerMXBean- Overrides:
getLastResetin classOAbstractProfiler
-
getCounters
-
getStat
-
getChronos
- Specified by:
getChronosin interfaceOProfiler
-
getChrono
- Specified by:
getChronoin interfaceOProfiler- Overrides:
getChronoin classOAbstractProfiler
-
setAutoDump
public void setAutoDump(int iSeconds) - Specified by:
setAutoDumpin interfaceOProfiler- Specified by:
setAutoDumpin interfaceOProfilerMXBean- Overrides:
setAutoDumpin classOAbstractProfiler
-
archiveHooks
Must be not called inside a lock. -
getStatsAsJson
- Specified by:
getStatsAsJsonin interfaceOProfiler
-
updateStats
public void updateStats() -
cpuUsage
public double cpuUsage() -
cpuUsageFallback
public double cpuUsageFallback() -
onNodeJoining
Description copied from interface:ODistributedLifecycleListenerCalled when a node is joining the cluster. Return false to deny the join.- Specified by:
onNodeJoiningin interfaceODistributedLifecycleListener- Parameters:
iNode- Node name that is joining- Returns:
- true to allow the join, otherwise false
-
onNodeJoined
Description copied from interface:ODistributedLifecycleListenerCalled right after a node joined the cluster.- Specified by:
onNodeJoinedin interfaceODistributedLifecycleListener- Parameters:
iNode- Node name that is joining
-
onNodeLeft
Description copied from interface:ODistributedLifecycleListenerCalled right after a node left the cluster.- Specified by:
onNodeLeftin interfaceODistributedLifecycleListener- Parameters:
iNode- Node name that left
-
onDatabaseChangeStatus
public void onDatabaseChangeStatus(String iNode, String iDatabaseName, ODistributedServerManager.DB_STATUS iNewStatus) Description copied from interface:ODistributedLifecycleListenerCalled upon change of database status on a node. Available statuses are defined in ODistributedServerManager.DB_STATUS.- Specified by:
onDatabaseChangeStatusin interfaceODistributedLifecycleListener- Parameters:
iNode- The node nameiDatabaseName- Database nameiNewStatus- The new status
-