public class DataMetric
extends java.lang.Object
Metric that counts or times the occurrences of a particular kind of event.
Constructor and Description |
---|
DataMetric() |
Modifier and Type | Method and Description |
---|---|
void |
add(long value)
Add an observed value for an occurrence of the measured events for this metric.
|
static DataMetric |
byteInstance(java.lang.String component,
java.lang.String metric)
Return a metric with unit "BYTE".
|
static DataMetricList |
copyAndResetAll()
Reset all metrics as if no measured events have occurred (after copying the previous values).
|
long |
count()
Return the number of occurrences of the measured event.
|
static DataMetric |
createDatabaseTime(java.lang.String component)
Return the 'createDatabaseTime' metric for the specified component.
|
static DataMetric |
createEntityTime(java.lang.String component)
Return the 'createEntityTime' metric for the specified component.
|
static DataMetric |
createIndexTime(java.lang.String component)
Return the 'createIndexTime' metric for the specified component.
|
static DataMetric |
createLinkTime(java.lang.String component)
Return the 'createLinkTime' metric for the specified component.
|
static DataMetric |
createMediaTime(java.lang.String component)
Return the 'createMediaTime' metric for the specified component.
|
static DataMetric |
createTableTime(java.lang.String component)
Return the 'createTableTime' metric for the specified component.
|
static DataMetric |
deleteDatabaseTime(java.lang.String component)
Return the 'deleteDatabaseTime' metric for the specified component.
|
static DataMetric |
deleteEntityTime(java.lang.String component)
Return the 'deleteEntityTime' metric for the specified component.
|
static DataMetric |
deleteLinkTime(java.lang.String component)
Return the 'deleteLinkTime' metric for the specified component.
|
static DataMetric |
deleteStreamTime(java.lang.String component)
Return the 'deleteStreamTime' metric for the specified component.
|
static DataMetric |
deltaDownloadBytes_gzip(java.lang.String component)
Return the 'deltaDownloadBytes_gzip' metric for the specified component.
|
static DataMetric |
deltaDownloadBytes(java.lang.String component)
Return the 'deltaDownloadBytes' metric for the specified component.
|
static DataMetric |
deltaDownloadRows(java.lang.String component)
Return the 'deltaDownloadRows' metric for the specified component.
|
static DataMetric |
deltaDownloadTime(java.lang.String component)
Return the 'executeQueryTime' metric for the specified component.
|
static DataMetric |
downloadMediaTime(java.lang.String component)
Return the 'downloadMediaTime' metric for the specified component.
|
static DataMetric |
downloadPhaseTime(java.lang.String component)
Return the 'downloadPhaseTime' metric for the specified component.
|
static DataMetric |
downloadStreamTime(java.lang.String component)
Return the 'downloadStreamTime' metric for the specified component.
|
static DataMetric |
entityInstance(java.lang.String component,
java.lang.String metric)
Return a metric with unit "ENTITY".
|
static DataMetric |
errorInstance(java.lang.String component,
java.lang.String metric)
Return a metric with unit "ERROR".
|
static java.lang.String |
errorMetricName(java.lang.String method,
java.lang.RuntimeException error)
Return a suitable name for an error metric.
|
static DataMetric |
executeMethodTime(java.lang.String component)
Return the 'executeMethodTime' metric for the specified component.
|
static DataMetric |
executeQueryTime(java.lang.String component)
Return the 'executeQueryTime' metric for the specified component.
|
static DataMetric |
fetchMetadataSize_gzip(java.lang.String component)
Return the 'fetchMetadataSize_gzip' metric for the specified component.
|
static DataMetric |
fetchMetadataSize(java.lang.String component)
Return the 'fetchMetadataSize' metric for the specified component.
|
static DataMetric |
fetchMetadataTime(java.lang.String component)
Return the 'fetchMetadataTime' metric for the specified component.
|
static DataMetric |
followedNextLink(java.lang.String component)
Return the 'followedNextLink' metric for the specified component.
|
java.lang.String |
getComponent()
Return the component which owns this metric.
|
int |
getId()
Return a process-uniquie ID for this metric.
|
static DataMetric |
getInstance(java.lang.String component,
java.lang.String metric,
java.lang.String unit)
Construct a new metric or locate an existing metric.
|
long |
getMaximum()
Return the maximum observed value for occurrences of the measured event.
|
java.lang.String |
getMetric()
Return the name of this metric (should be unique for all metrics in the same
DataMetric.component ). |
long |
getMinimum()
Return the minimum observed value for occurrences of the measured event.
|
long |
getSum()
Return the sum of observed values for occurrences of the measured event.
|
java.lang.String |
getUnit()
Return the measurement unit for this metric.
|
static DataMetric |
initialDownloadBytes_gzip(java.lang.String component)
Return the 'initialDownloadBytes_gzip' metric for the specified component.
|
static DataMetric |
initialDownloadBytes(java.lang.String component)
Return the 'initialDownloadBytes' metric for the specified component.
|
static DataMetric |
initialDownloadRows(java.lang.String component)
Return the 'initialDownloadRows' metric for the specified component.
|
static DataMetric |
initialDownloadTime(java.lang.String component)
Return the 'initialDownloadTime' metric for the specified component.
|
static DataMetric |
linkInstance(java.lang.String component,
java.lang.String metric)
Return a metric with unit "LINK".
|
static DataMetric |
loadMetadataTime(java.lang.String component)
Return the 'loadMetadataTime' metric for the specified component, which includes fetch time and parse time.
|
static void |
logAll()
Log all metrics in CSV format to the
DebugConsole . |
static DataMetric |
methodResultBytes_gzip(java.lang.String component)
Return the 'methodResultBytes_gzip' metric for the specified component.
|
static DataMetric |
methodResultBytes(java.lang.String component)
Return the 'methodResultBytes' metric for the specified component.
|
static DataMetric |
parseMetadataTime(java.lang.String component)
Return the 'parseMetadataTime' metric for the specified component.
|
static DataMetric |
pingServerTime(java.lang.String component)
Return the 'pingServerTime' metric for the specified component.
|
static DataMetric |
queryResultBytes_gzip(java.lang.String component)
Return the 'queryResultBytes_gzip' metric for the specified component.
|
static DataMetric |
queryResultBytes(java.lang.String component)
Return the 'queryResultBytes' metric for the specified component.
|
static DataMetric |
queryResultRows(java.lang.String component)
Return the 'queryResultRows' metric for the specified component.
|
static DataMetric |
requestInstance(java.lang.String component,
java.lang.String metric)
Return a metric with unit "REQUEST".
|
void |
reset()
Reset this metric as if no measured events have occurred.
|
static void |
resetAll()
Reset all metrics as if no measured events have occurred.
|
static DataMetric |
rowInstance(java.lang.String component,
java.lang.String metric)
Return a metric with unit "ROW".
|
static DataMetric |
selectEntityTime(java.lang.String component)
Return the 'selectEntityTime' metric for the specified component.
|
static DataMetric |
timeInstance(java.lang.String component,
java.lang.String metric)
Return a metric with unit "MICROSECOND".
|
static DataMetric |
updateEntityTime(java.lang.String component)
Return the 'updateEntityTime' metric for the specified component.
|
static DataMetric |
updateLinkTime(java.lang.String component)
Return the 'updateLinkTime' metric for the specified component.
|
static DataMetric |
uploadMediaTime(java.lang.String component)
Return the 'uploadMediaTime' metric for the specified component.
|
static DataMetric |
uploadStreamTime(java.lang.String component)
Return the 'uploadStreamTime' metric for the specified component.
|
static DataMetric |
uploadTime(java.lang.String component)
Return the 'uploadTime' metric for the specified component.
|
static DataMetric |
upsertEntityTime(java.lang.String component)
Return the 'upsertEntityTime' metric for the specified component.
|
static DataMetric |
warningInstance(java.lang.String component,
java.lang.String metric)
Return a metric with unit "WARNING".
|
void |
write(com.sap.cloud.server.odata.core.CharBuffer buffer)
Write this metric in CSV format to the specified
buffer . |
static void |
writeAll(com.sap.cloud.server.odata.core.CharBuffer buffer)
Print all metrics in CSV format to the specified
buffer . |
public void add(long value)
Add an observed value for an occurrence of the measured events for this metric.
value
- Observed value (count or time).public static DataMetric byteInstance(java.lang.String component, java.lang.String metric)
Return a metric with unit "BYTE".
component
- Metric owner.metric
- Metric name.public static DataMetricList copyAndResetAll()
Reset all metrics as if no measured events have occurred (after copying the previous values).
public long count()
Return the number of occurrences of the measured event.
public static DataMetric createDatabaseTime(java.lang.String component)
Return the 'createDatabaseTime' metric for the specified component.
component
- Metric owner.public static DataMetric createEntityTime(java.lang.String component)
Return the 'createEntityTime' metric for the specified component.
component
- Metric owner.public static DataMetric createIndexTime(java.lang.String component)
Return the 'createIndexTime' metric for the specified component.
component
- Metric owner.public static DataMetric createLinkTime(java.lang.String component)
Return the 'createLinkTime' metric for the specified component.
component
- Metric owner.public static DataMetric createMediaTime(java.lang.String component)
Return the 'createMediaTime' metric for the specified component.
component
- Metric owner.public static DataMetric createTableTime(java.lang.String component)
Return the 'createTableTime' metric for the specified component.
component
- Metric owner.public static DataMetric deleteDatabaseTime(java.lang.String component)
Return the 'deleteDatabaseTime' metric for the specified component.
component
- Metric owner.public static DataMetric deleteEntityTime(java.lang.String component)
Return the 'deleteEntityTime' metric for the specified component.
component
- Metric owner.public static DataMetric deleteLinkTime(java.lang.String component)
Return the 'deleteLinkTime' metric for the specified component.
component
- Metric owner.public static DataMetric deleteStreamTime(java.lang.String component)
Return the 'deleteStreamTime' metric for the specified component.
component
- Metric owner.public static DataMetric deltaDownloadBytes(java.lang.String component)
Return the 'deltaDownloadBytes' metric for the specified component.
component
- Metric owner.public static DataMetric deltaDownloadBytes_gzip(java.lang.String component)
Return the 'deltaDownloadBytes_gzip' metric for the specified component.
component
- Metric owner.public static DataMetric deltaDownloadRows(java.lang.String component)
Return the 'deltaDownloadRows' metric for the specified component.
component
- Metric owner.public static DataMetric deltaDownloadTime(java.lang.String component)
Return the 'executeQueryTime' metric for the specified component.
component
- Metric owner.public static DataMetric downloadMediaTime(java.lang.String component)
Return the 'downloadMediaTime' metric for the specified component.
component
- Metric owner.public static DataMetric downloadPhaseTime(java.lang.String component)
Return the 'downloadPhaseTime' metric for the specified component.
component
- Metric owner.public static DataMetric downloadStreamTime(java.lang.String component)
Return the 'downloadStreamTime' metric for the specified component.
component
- Metric owner.public static DataMetric entityInstance(java.lang.String component, java.lang.String metric)
Return a metric with unit "ENTITY".
component
- Metric owner.metric
- Metric name.public static DataMetric errorInstance(java.lang.String component, java.lang.String metric)
Return a metric with unit "ERROR".
component
- Metric owner.metric
- Metric name.public static java.lang.String errorMetricName(java.lang.String method, java.lang.RuntimeException error)
Return a suitable name for an error metric.
method
- Data method name.error
- Error for metric that occurred when invoking the data method.public static DataMetric executeMethodTime(java.lang.String component)
Return the 'executeMethodTime' metric for the specified component.
component
- Metric owner.public static DataMetric executeQueryTime(java.lang.String component)
Return the 'executeQueryTime' metric for the specified component.
component
- Metric owner.public static DataMetric fetchMetadataSize(java.lang.String component)
Return the 'fetchMetadataSize' metric for the specified component.
component
- Metric owner.public static DataMetric fetchMetadataSize_gzip(java.lang.String component)
Return the 'fetchMetadataSize_gzip' metric for the specified component.
component
- Metric owner.public static DataMetric fetchMetadataTime(java.lang.String component)
Return the 'fetchMetadataTime' metric for the specified component.
component
- Metric owner.public static DataMetric followedNextLink(java.lang.String component)
Return the 'followedNextLink' metric for the specified component.
component
- Metric owner.public java.lang.String getComponent()
Return the component which owns this metric.
public int getId()
Return a process-uniquie ID for this metric.
public static DataMetric getInstance(java.lang.String component, java.lang.String metric, java.lang.String unit)
Construct a new metric or locate an existing metric.
component
- Value for DataMetric.component
.metric
- Value for DataMetric.metric
.unit
- Value for DataMetric.unit
.public long getMaximum()
Return the maximum observed value for occurrences of the measured event.
public java.lang.String getMetric()
Return the name of this metric (should be unique for all metrics in the same DataMetric.component
).
DataMetric.component
).public long getMinimum()
Return the minimum observed value for occurrences of the measured event.
public long getSum()
Return the sum of observed values for occurrences of the measured event.
public java.lang.String getUnit()
Return the measurement unit for this metric.
public static DataMetric initialDownloadBytes(java.lang.String component)
Return the 'initialDownloadBytes' metric for the specified component.
component
- Metric owner.public static DataMetric initialDownloadBytes_gzip(java.lang.String component)
Return the 'initialDownloadBytes_gzip' metric for the specified component.
component
- Metric owner.public static DataMetric initialDownloadRows(java.lang.String component)
Return the 'initialDownloadRows' metric for the specified component.
component
- Metric owner.public static DataMetric initialDownloadTime(java.lang.String component)
Return the 'initialDownloadTime' metric for the specified component.
component
- Metric owner.public static DataMetric linkInstance(java.lang.String component, java.lang.String metric)
Return a metric with unit "LINK".
component
- Metric owner.metric
- Metric name.public static DataMetric loadMetadataTime(java.lang.String component)
Return the 'loadMetadataTime' metric for the specified component, which includes fetch time and parse time.
component
- Metric owner.public static void logAll()
Log all metrics in CSV format to the DebugConsole
.
public static DataMetric methodResultBytes(java.lang.String component)
Return the 'methodResultBytes' metric for the specified component.
component
- Metric owner.public static DataMetric methodResultBytes_gzip(java.lang.String component)
Return the 'methodResultBytes_gzip' metric for the specified component.
component
- Metric owner.public static DataMetric parseMetadataTime(java.lang.String component)
Return the 'parseMetadataTime' metric for the specified component.
component
- Metric owner.public static DataMetric pingServerTime(java.lang.String component)
Return the 'pingServerTime' metric for the specified component.
component
- Metric owner.public static DataMetric queryResultBytes(java.lang.String component)
Return the 'queryResultBytes' metric for the specified component.
component
- Metric owner.public static DataMetric queryResultBytes_gzip(java.lang.String component)
Return the 'queryResultBytes_gzip' metric for the specified component.
component
- Metric owner.public static DataMetric queryResultRows(java.lang.String component)
Return the 'queryResultRows' metric for the specified component.
component
- Metric owner.public static DataMetric requestInstance(java.lang.String component, java.lang.String metric)
Return a metric with unit "REQUEST".
component
- Metric owner.metric
- Metric name.public void reset()
Reset this metric as if no measured events have occurred.
public static void resetAll()
Reset all metrics as if no measured events have occurred.
public static DataMetric rowInstance(java.lang.String component, java.lang.String metric)
Return a metric with unit "ROW".
component
- Metric owner.metric
- Metric name.public static DataMetric selectEntityTime(java.lang.String component)
Return the 'selectEntityTime' metric for the specified component.
component
- Metric owner.public static DataMetric timeInstance(java.lang.String component, java.lang.String metric)
Return a metric with unit "MICROSECOND".
component
- Metric owner.metric
- Metric name.public static DataMetric updateEntityTime(java.lang.String component)
Return the 'updateEntityTime' metric for the specified component.
component
- Metric owner.public static DataMetric updateLinkTime(java.lang.String component)
Return the 'updateLinkTime' metric for the specified component.
component
- Metric owner.public static DataMetric uploadMediaTime(java.lang.String component)
Return the 'uploadMediaTime' metric for the specified component.
component
- Metric owner.public static DataMetric uploadStreamTime(java.lang.String component)
Return the 'uploadStreamTime' metric for the specified component.
component
- Metric owner.public static DataMetric uploadTime(java.lang.String component)
Return the 'uploadTime' metric for the specified component.
component
- Metric owner.public static DataMetric upsertEntityTime(java.lang.String component)
Return the 'upsertEntityTime' metric for the specified component.
component
- Metric owner.public static DataMetric warningInstance(java.lang.String component, java.lang.String metric)
Return a metric with unit "WARNING".
component
- Metric owner.metric
- Metric name.public void write(com.sap.cloud.server.odata.core.CharBuffer buffer)
Write this metric in CSV format to the specified buffer
.
buffer
- Buffer for metrics to be appended to.public static void writeAll(com.sap.cloud.server.odata.core.CharBuffer buffer)
Print all metrics in CSV format to the specified buffer
.
buffer
- Output buffer.