Package org.linuxforhealth.fhir.config
Class CallTimeMetric
- java.lang.Object
-
- org.linuxforhealth.fhir.config.CallTimeMetric
-
public class CallTimeMetric extends java.lang.Object
Simple mechanism to track how much time we're spending in various calls
-
-
Constructor Summary
Constructors Constructor Description CallTimeMetric(java.lang.String fullMetricName, java.lang.String metricName)
Constructor to create a metric to track the performance of a call or span of code
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accumulateItems(int count)
Add count to the itemCountvoid
accumulateTime(long nanos)
Add nanos to the accumulated time and increment the call countlong
getAccumulatedTime()
long
getCallCount()
java.lang.String
getFullMetricName()
Get the full name of the metric (path + name)long
getItemCount()
Get the current item countjava.lang.String
getMetricName()
static void
render(java.util.logging.Logger logger, java.util.List<CallTimeMetric> metrics)
Render the collection of metrics as a series of fine log messages
-
-
-
Method Detail
-
getFullMetricName
public java.lang.String getFullMetricName()
Get the full name of the metric (path + name)- Returns:
-
getAccumulatedTime
public long getAccumulatedTime()
- Returns:
- the accumulatedTime
-
accumulateTime
public void accumulateTime(long nanos)
Add nanos to the accumulated time and increment the call count- Parameters:
nanos
- the time to add in nanoseconds
-
accumulateItems
public void accumulateItems(int count)
Add count to the itemCount- Parameters:
count
-
-
getItemCount
public long getItemCount()
Get the current item count- Returns:
-
getCallCount
public long getCallCount()
- Returns:
- the callCount
-
getMetricName
public java.lang.String getMetricName()
- Returns:
- the metricName
-
render
public static void render(java.util.logging.Logger logger, java.util.List<CallTimeMetric> metrics)
Render the collection of metrics as a series of fine log messages- Parameters:
logger
-metrics
-
-
-