public class OSessionStoragePerformanceStatistic extends Object
OAbstractPaginatedStorage.startGatheringPerformanceStatisticForCurrentThread()
.
Statistic is gathered on component and system level. Each
ODurableComponent
provides separate data for this
tool which allows to detect performance problems on component level.
To stop gathering of performance statistic call
OAbstractPaginatedStorage.completeGatheringPerformanceStatisticForCurrentThread()
.
List of gathered performance characteristics can be deduced from getXXX methods. There are 2 kind of methods , one kind do not accept any parameters, they return performance data on system level and, other kind accept component name, they return performance data gathered on separate component or on system level if null is passed as method name. If data from component with passed in name is absent then -1 is returned.
Some data are gathered only on system level for example write ahead log performance data or commit time getCommitTime()
.
This container may be used both for gathering information in single thread and in multithreaded environment. Container itself is not thread safe, but it supports data snapshots.
Every time when new data are gathered by container it checks whether minimum interval between two snapshots is passed and makes data snapshot if needed, data snapshot can be used by aggregator which merges statistics from all containers together. Only last snapshot is hold by container.
Also container supports time series functionality by clearing of previous statics after provided time interval.
OPerformanceStatisticManager
Modifier and Type | Class and Description |
---|---|
static class |
OSessionStoragePerformanceStatistic.ComponentType |
static interface |
OSessionStoragePerformanceStatistic.CountersHolder<T extends OSessionStoragePerformanceStatistic.CountersHolder>
Common interface which should implement all classes which contain system/component performance data.
|
static class |
OSessionStoragePerformanceStatistic.IndexCountersHolder |
static interface |
OSessionStoragePerformanceStatistic.NanoTimer
Interface which is used by this tool to get current PC nano time.
|
static class |
OSessionStoragePerformanceStatistic.PerformanceCountersHolder
Container for all performance counters which are shared between durable components and whole system.
|
static class |
OSessionStoragePerformanceStatistic.PerformanceSnapshot
Snapshot of all performance data of current container.
|
static class |
OSessionStoragePerformanceStatistic.RidbagCountersHolder |
static class |
OSessionStoragePerformanceStatistic.StorageCountersHolder
Contains data about storage performance
|
static class |
OSessionStoragePerformanceStatistic.WALCountersHolder
Contains data about write ahead log performance
|
static class |
OSessionStoragePerformanceStatistic.WritCacheCountersHolder
Contains write cache performance characteristics
|
Constructor and Description |
---|
OSessionStoragePerformanceStatistic(long intervalBetweenSnapshots,
long cleanUpInterval) |
OSessionStoragePerformanceStatistic(long intervalBetweenSnapshots,
OSessionStoragePerformanceStatistic.NanoTimer nanoTimer,
long cleanUpInterval) |
Modifier and Type | Method and Description |
---|---|
void |
completeComponentOperation()
Indicates that the most earliest component in stack of components has completed it's operation, so performance data for this
component is stopped to be gathered.
|
long |
getAmountOfPagesPerOperation(String componentName)
Average amount of pages which were read from cache for component with given name during single data operation.
|
long |
getAmountOfPagesReadFromCache() |
long |
getAmountOfPagesReadFromCache(String componentName)
Amount of pages read from cache for component name of which is passed as method argument.
|
long |
getAmountOfPagesReadFromFile() |
long |
getAmountOfPagesReadFromFile(String componentName)
Amount of pages are read from file for component name of which is passed as method argument.
|
long |
getAmountOfPagesWrittenInCache() |
long |
getAmountOfPagesWrittenInCache(String componentName)
Amount of pages written to cache for component name of which is passed as method argument.
|
int |
getCacheHits() |
int |
getCacheHits(String componentName)
Percent of cache hits for component name of which is passed as method argument.
|
long |
getCommitTime() |
long |
getReadSpeedFromCacheInPages() |
long |
getReadSpeedFromCacheInPages(String componentName)
Read speed of data in pages per second on cache level for component name of which is passed as method argument.
|
long |
getReadSpeedFromFileInPages() |
long |
getReadSpeedFromFileInPages(String componentName)
Read speed of data from file system in pages for component name of which is passed as method argument.
|
OSessionStoragePerformanceStatistic.PerformanceSnapshot |
getSnapshot() |
long |
getWriteSpeedInCacheInPages() |
long |
getWriteSpeedInCacheInPages(String componentName)
Write speed of data in pages per second on cache level for component name of which is passed as method argument.
|
void |
incrementPageAccessOnCacheLevel(boolean cacheHit)
Increments counter of page accesses from cache.
|
void |
pushComponentCounters(Map<String,OSessionStoragePerformanceStatistic.PerformanceCountersHolder> counters)
Takes performance data are split by components from last snapshot and aggregates them with data passed inside method as
parameter.
|
void |
pushComponentCounters(String name,
OSessionStoragePerformanceStatistic.PerformanceCountersHolder holder)
Takes performance data for component from last snapshot and aggregates them with data passed inside method as parameter.
|
OSessionStoragePerformanceStatistic.StorageCountersHolder |
pushStorageCounters(OSessionStoragePerformanceStatistic.StorageCountersHolder holder)
Takes storage performance data from last snapshot and aggregates them with data passed inside method as parameter.
|
void |
pushSystemCounters(OSessionStoragePerformanceStatistic.PerformanceCountersHolder holder)
Takes performance data for whole system from last snapshot and aggregates them with data passed inside method as parameter.
|
OSessionStoragePerformanceStatistic.WALCountersHolder |
pushWALCounters(OSessionStoragePerformanceStatistic.WALCountersHolder holder)
Takes write ahead log data from last snapshot and aggregates them with data passed inside method as parameter.
|
OSessionStoragePerformanceStatistic.WritCacheCountersHolder |
pushWriteCacheCounters(OSessionStoragePerformanceStatistic.WritCacheCountersHolder holder)
Takes write cache performance data from last snapshot and aggregates them with data passed inside method as parameter.
|
void |
startCommitTimer()
Starts timer which counts how much time was spent on atomic operation commit.
|
void |
startComponentOperation(String componentName,
OSessionStoragePerformanceStatistic.ComponentType type)
Called inside of
ODurableComponent to notify that
component started to perform operation on data. |
void |
startFullCheckpointTimer()
Starts timer which records how much time is spent on full checkpoint
|
void |
startFuzzyCheckpointTimer()
Starts timer which counts how much time was spent on fuzzy checkpoint operation.
|
void |
startIndexEntryDeletionTimer() |
void |
startIndexEntryReadTimer() |
void |
startIndexEntryUpdateTimer() |
void |
startPageReadFromCacheTimer()
Starts timer which counts how much time was spent on read of page from disk cache.
|
void |
startPageReadFromFileTimer()
Starts timer which counts how much time was spent on read of page from file system.
|
void |
startPageWriteInCacheTimer()
Starts timer which counts how much time was spent on write of page to disk cache.
|
void |
startRecordCreationTimer() |
void |
startRecordDeletionTimer() |
void |
startRecordReadTimer() |
void |
startRecordUpdateTimer() |
void |
startRidBagEntryDeletionTimer() |
void |
startRidBagEntryLoadTimer() |
void |
startRidBagEntryReadTimer() |
void |
startRidBagEntryUpdateTimer() |
void |
startWALFlushTimer()
Starts timer which counts how much time was spent on flushing of data from write ahead log cache.
|
void |
startWALLogRecordTimer()
Starts timer which counts how much time was spent on logging of single write ahead log record
|
void |
startWriteCacheFlushTimer()
Starts timer which counts how much time was spent on operation of flush pages in write cache.
|
void |
stopCommitTimer()
Stops and records results of timer which counts how much time was spent on atomic operation commit.
|
void |
stopFullCheckpointTimer()
Stops and records results of timer which counts how much time was spent on full checkpoint operation.
|
void |
stopFuzzyCheckpointTimer()
Stops and records results of timer which counts how much time was spent on fuzzy checkpoint operation.
|
void |
stopIndexEntryDeletionTimer() |
void |
stopIndexEntryReadTimer() |
void |
stopIndexEntryUpdateTimer() |
void |
stopPageReadFromCacheTimer()
Stops and records results of timer which counts how much time was spent on read of page from disk cache.
|
void |
stopPageReadFromFileTimer(int readPages)
Stops and records results of timer which counts how much time was spent on read of page from file system.
|
void |
stopPageWriteInCacheTimer()
Stops and records results of timer which counts how much time was spent to write page to disk cache.
|
void |
stopRecordCreationTimer() |
void |
stopRecordDeletionTimer() |
void |
stopRecordReadTimer() |
void |
stopRecordUpdateTimer() |
void |
stopRidBagEntryDeletionTimer() |
void |
stopRidBagEntryLoadTimer() |
void |
stopRidBagEntryReadTimer(int entriesRead) |
void |
stopRidBagEntryUpdateTimer() |
void |
stopWALFlushTimer()
Stops timer and records how much time was spent on flushing of data from write ahead log cache.
|
void |
stopWALRecordTimer(boolean isStartRecord,
boolean isStopRecord)
Stops and records results of timer which counts how much time was spent on logging of single write ahead log record.
|
void |
stopWriteCacheFlushTimer(int pagesFlushed)
Stops and records results of timer which counts how much time was spent on operation of flush pages in write cache.
|
ODocument |
toDocument()
Converts properties of given class into values of fields of returned document.
|
static void |
writeMetric(ODocument document,
String metricName,
Number metricValue) |
static void |
writeMetric(ODocument document,
String metricName,
Number metricValue,
OType metricType) |
public OSessionStoragePerformanceStatistic(long intervalBetweenSnapshots, long cleanUpInterval)
intervalBetweenSnapshots
- Minimum interval between two snapshots taken by container.cleanUpInterval
- Minimum interval between two time series, in other words container clears all statistic during
next try of making
snapshot after this interval is over. -1
means that data will not be cleared.public OSessionStoragePerformanceStatistic(long intervalBetweenSnapshots, OSessionStoragePerformanceStatistic.NanoTimer nanoTimer, long cleanUpInterval)
nanoTimer
- Service to get current value of PC nano time.intervalBetweenSnapshots
- Minimum interval between two snapshots taken by container.cleanUpInterval
- Minimum interval between two time series, in other words container clears all statistic during
next try of making
snapshot after this interval is over. -1
means that data will not be cleared.public void startComponentOperation(String componentName, OSessionStoragePerformanceStatistic.ComponentType type)
ODurableComponent
to notify that
component started to perform operation on data. After that all performance characteristic started to be gathered for this
component till method completeComponentOperation()
will be called.
Components can be stacked, so if components c1
and then c2
call this method than performance data for
both components at once started to be gathered.
componentName
- Name of component which started to perform operation on data. Name is case sensitive.public void completeComponentOperation()
public long getReadSpeedFromCacheInPages()
public long getReadSpeedFromCacheInPages(String componentName)
-1
will be returned.componentName
- Name of component data of which should be returned. Name is case sensitive.public long getReadSpeedFromFileInPages()
public long getReadSpeedFromFileInPages(String componentName)
-1
will be returned.componentName
- Name of component data of which should be returned. Name is case sensitive.public long getAmountOfPagesReadFromCache()
public long getAmountOfPagesReadFromCache(String componentName)
-1
will be
returned.componentName
- Name of component data of which should be returned. Name is case sensitive.public long getAmountOfPagesReadFromFile()
public long getAmountOfPagesReadFromFile(String componentName)
-1
will be
returned.componentName
- Name of component data of which should be returned. Name is case sensitive.public long getWriteSpeedInCacheInPages()
public long getWriteSpeedInCacheInPages(String componentName)
-1
will be returned.componentName
- Name of component data of which should be returned. Name is case sensitive.public long getAmountOfPagesWrittenInCache()
public long getAmountOfPagesWrittenInCache(String componentName)
-1
will be
returned.componentName
- Name of component data of which should be returned. Name is case sensitive.public OSessionStoragePerformanceStatistic.PerformanceSnapshot getSnapshot()
public long getCommitTime()
public int getCacheHits()
public int getCacheHits(String componentName)
-1
will be returned.componentName
- Name of component data of which should be returned. Name is case sensitive.public long getAmountOfPagesPerOperation(String componentName)
If null value is passed or data for component with passed in name does not exist then -1
will be returned.
componentName
- Name of component data of which should be returned. Name is case sensitive.public void pushComponentCounters(Map<String,OSessionStoragePerformanceStatistic.PerformanceCountersHolder> counters)
counters
- Performance data for each component.public OSessionStoragePerformanceStatistic.WritCacheCountersHolder pushWriteCacheCounters(OSessionStoragePerformanceStatistic.WritCacheCountersHolder holder)
holder
- Performance data for write cache may be null
public OSessionStoragePerformanceStatistic.StorageCountersHolder pushStorageCounters(OSessionStoragePerformanceStatistic.StorageCountersHolder holder)
holder
- Performance data for storage may be null
public OSessionStoragePerformanceStatistic.WALCountersHolder pushWALCounters(OSessionStoragePerformanceStatistic.WALCountersHolder holder)
holder
- Performance data for write ahead log may be null
public void pushSystemCounters(OSessionStoragePerformanceStatistic.PerformanceCountersHolder holder)
holder
- Performance data for whole system.public void pushComponentCounters(String name, OSessionStoragePerformanceStatistic.PerformanceCountersHolder holder)
name
- Name of component for which performance data are gathered.holder
- Performance data for given component.public ODocument toDocument()
All data related to separate components are stored in field dataByComponent
map which has type
OType.EMBEDDEDMAP
where key of map entry is name of component, and value is document which contains the same fields as
high level document but with values for single component not whole system.
Write ahead log performance data are stored inside of walData
field.
OAbstractPaginatedStorage.startGatheringPerformanceStatisticForCurrentThread()
public void incrementPageAccessOnCacheLevel(boolean cacheHit)
If you wish to gather statistic for current durable component please call
startComponentOperation(String, ComponentType)
method before the call and completeComponentOperation()
after
the call.
public void startPageReadFromFileTimer()
public void stopPageReadFromFileTimer(int readPages)
If you wish to gather statistic for current durable component please call
startComponentOperation(String, ComponentType)
method before the call and completeComponentOperation()
after
the call.
readPages
- Amount of pages which were read by single call to file system.public void startWriteCacheFlushTimer()
public void stopWriteCacheFlushTimer(int pagesFlushed)
pagesFlushed
- Amount of pages were flushed during this operation.public void startFuzzyCheckpointTimer()
public void stopFuzzyCheckpointTimer()
public void startPageReadFromCacheTimer()
public void stopPageReadFromCacheTimer()
If you wish to gather statistic for current durable component please call
startComponentOperation(String, ComponentType)
method before the call and completeComponentOperation()
after
the call.
public void startFullCheckpointTimer()
public void stopFullCheckpointTimer()
public void startPageWriteInCacheTimer()
public void stopPageWriteInCacheTimer()
If you wish to gather statistic for current durable component please call
startComponentOperation(String, ComponentType)
method before the call and completeComponentOperation()
after
the call.
public void startRecordCreationTimer()
public void stopRecordCreationTimer()
public void startRecordDeletionTimer()
public void stopRecordDeletionTimer()
public void startRecordUpdateTimer()
public void stopRecordUpdateTimer()
public void startRecordReadTimer()
public void stopRecordReadTimer()
public void startIndexEntryUpdateTimer()
public void stopIndexEntryUpdateTimer()
public void startIndexEntryDeletionTimer()
public void stopIndexEntryDeletionTimer()
public void startIndexEntryReadTimer()
public void stopIndexEntryReadTimer()
public void startRidBagEntryReadTimer()
public void stopRidBagEntryReadTimer(int entriesRead)
public void startRidBagEntryUpdateTimer()
public void stopRidBagEntryUpdateTimer()
public void startRidBagEntryDeletionTimer()
public void stopRidBagEntryDeletionTimer()
public void startRidBagEntryLoadTimer()
public void stopRidBagEntryLoadTimer()
public void startCommitTimer()
public void stopCommitTimer()
public void startWALLogRecordTimer()
public void stopWALRecordTimer(boolean isStartRecord, boolean isStopRecord)
isStartRecord
- Indicates whether we logged "start atomic operation" recordisStopRecord
- Indicates whether we logged "stop atomic operation" recordpublic void startWALFlushTimer()
public void stopWALFlushTimer()
public static void writeMetric(ODocument document, String metricName, Number metricValue)
Copyright © 2009–2019 OrientDB. All rights reserved.