Class CallTrackerImpl
- java.lang.Object
-
- com.linkedin.alpini.base.monitoring.CallTrackerImpl
-
- All Implemented Interfaces:
CallTracker
public class CallTrackerImpl extends java.lang.Object implements CallTracker
Tracker for "load average" of a call.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CallTrackerImpl.Mode
-
Nested classes/interfaces inherited from interface com.linkedin.alpini.base.monitoring.CallTracker
CallTracker.CallStats
-
-
Field Summary
Fields Modifier and Type Field Description static CallTrackerImpl.Mode
defaultMode
-
Fields inherited from interface com.linkedin.alpini.base.monitoring.CallTracker
GENERIC_EXCEPTION
-
-
Constructor Summary
Constructors Constructor Description CallTrackerImpl()
CallTrackerImpl(int ncpu)
CallTrackerImpl(int ncpu, ConcurrentAccumulator.Mode accumulatorMode)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AbstractQuantileEstimation.Quantile
computeQuantile(long sample, java.util.concurrent.TimeUnit timeUnit)
double[]
getAverageConcurrency()
Returns the average concurrency over a period of time.CallTracker.CallStats
getCallStats()
long
getCurrentCallCountTotal()
int
getCurrentConcurrency()
long
getCurrentErrorCountTotal()
long
getCurrentStartCountTotal()
long[]
getErrorCount()
int[]
getErrorFrequency()
long
getLastResetTime()
int[]
getMaxConcurrency()
long[]
getStartCount()
int[]
getStartFrequency()
long
getTimeSinceLastStartCall()
long
getTotalRuntimeNanos()
protected boolean
isSuccessfulException(java.lang.Throwable exception)
void
reset()
void
setTestSuccessful(java.util.function.Predicate<java.lang.Throwable> test)
CallCompletion
startCall(long startTimeNanos)
void
trackCallWithError(long duration, java.util.concurrent.TimeUnit timeUnit, java.lang.Throwable throwable)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.linkedin.alpini.base.monitoring.CallTracker
startCall, trackCall, trackCall, trackCallWithError, trackCallWithError, trackCallWithError
-
-
-
-
Field Detail
-
defaultMode
public static CallTrackerImpl.Mode defaultMode
-
-
Constructor Detail
-
CallTrackerImpl
public CallTrackerImpl()
-
CallTrackerImpl
public CallTrackerImpl(@Nonnegative int ncpu)
-
CallTrackerImpl
public CallTrackerImpl(@Nonnegative int ncpu, @Nonnull ConcurrentAccumulator.Mode accumulatorMode)
-
-
Method Detail
-
setTestSuccessful
public void setTestSuccessful(@Nonnull java.util.function.Predicate<java.lang.Throwable> test)
-
isSuccessfulException
protected boolean isSuccessfulException(@Nonnull java.lang.Throwable exception)
-
startCall
@Nonnull public CallCompletion startCall(@Nonnegative long startTimeNanos)
- Specified by:
startCall
in interfaceCallTracker
-
trackCallWithError
public void trackCallWithError(long duration, @Nonnull java.util.concurrent.TimeUnit timeUnit, java.lang.Throwable throwable)
- Specified by:
trackCallWithError
in interfaceCallTracker
-
getTotalRuntimeNanos
public long getTotalRuntimeNanos()
-
getCurrentStartCountTotal
public long getCurrentStartCountTotal()
- Specified by:
getCurrentStartCountTotal
in interfaceCallTracker
-
getCurrentCallCountTotal
public long getCurrentCallCountTotal()
- Specified by:
getCurrentCallCountTotal
in interfaceCallTracker
-
getCurrentErrorCountTotal
public long getCurrentErrorCountTotal()
- Specified by:
getCurrentErrorCountTotal
in interfaceCallTracker
-
getCurrentConcurrency
public int getCurrentConcurrency()
- Specified by:
getCurrentConcurrency
in interfaceCallTracker
-
getAverageConcurrency
@Nonnull public double[] getAverageConcurrency()
Returns the average concurrency over a period of time.- Specified by:
getAverageConcurrency
in interfaceCallTracker
- Returns:
- array of 1, 5 and 15 minute average concurrency.
-
getMaxConcurrency
@Nonnull public int[] getMaxConcurrency()
- Specified by:
getMaxConcurrency
in interfaceCallTracker
-
getStartFrequency
@Nonnull public int[] getStartFrequency()
- Specified by:
getStartFrequency
in interfaceCallTracker
-
getStartCount
@Nonnull public long[] getStartCount()
- Specified by:
getStartCount
in interfaceCallTracker
-
getErrorFrequency
@Nonnull public int[] getErrorFrequency()
- Specified by:
getErrorFrequency
in interfaceCallTracker
-
getErrorCount
public long[] getErrorCount()
- Specified by:
getErrorCount
in interfaceCallTracker
-
getCallStats
@Nonnull public CallTracker.CallStats getCallStats()
- Specified by:
getCallStats
in interfaceCallTracker
-
computeQuantile
public AbstractQuantileEstimation.Quantile computeQuantile(long sample, @Nonnull java.util.concurrent.TimeUnit timeUnit)
-
reset
public void reset()
- Specified by:
reset
in interfaceCallTracker
-
getLastResetTime
public long getLastResetTime()
- Specified by:
getLastResetTime
in interfaceCallTracker
-
getTimeSinceLastStartCall
public long getTimeSinceLastStartCall()
- Specified by:
getTimeSinceLastStartCall
in interfaceCallTracker
-
-