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 classCallTrackerImpl.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.ModedefaultMode-
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.QuantilecomputeQuantile(long sample, java.util.concurrent.TimeUnit timeUnit)double[]getAverageConcurrency()Returns the average concurrency over a period of time.CallTracker.CallStatsgetCallStats()longgetCurrentCallCountTotal()intgetCurrentConcurrency()longgetCurrentErrorCountTotal()longgetCurrentStartCountTotal()long[]getErrorCount()int[]getErrorFrequency()longgetLastResetTime()int[]getMaxConcurrency()long[]getStartCount()int[]getStartFrequency()longgetTimeSinceLastStartCall()longgetTotalRuntimeNanos()protected booleanisSuccessfulException(java.lang.Throwable exception)voidreset()voidsetTestSuccessful(java.util.function.Predicate<java.lang.Throwable> test)CallCompletionstartCall(long startTimeNanos)voidtrackCallWithError(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:
startCallin interfaceCallTracker
-
trackCallWithError
public void trackCallWithError(long duration, @Nonnull java.util.concurrent.TimeUnit timeUnit, java.lang.Throwable throwable)- Specified by:
trackCallWithErrorin interfaceCallTracker
-
getTotalRuntimeNanos
public long getTotalRuntimeNanos()
-
getCurrentStartCountTotal
public long getCurrentStartCountTotal()
- Specified by:
getCurrentStartCountTotalin interfaceCallTracker
-
getCurrentCallCountTotal
public long getCurrentCallCountTotal()
- Specified by:
getCurrentCallCountTotalin interfaceCallTracker
-
getCurrentErrorCountTotal
public long getCurrentErrorCountTotal()
- Specified by:
getCurrentErrorCountTotalin interfaceCallTracker
-
getCurrentConcurrency
public int getCurrentConcurrency()
- Specified by:
getCurrentConcurrencyin interfaceCallTracker
-
getAverageConcurrency
@Nonnull public double[] getAverageConcurrency()
Returns the average concurrency over a period of time.- Specified by:
getAverageConcurrencyin interfaceCallTracker- Returns:
- array of 1, 5 and 15 minute average concurrency.
-
getMaxConcurrency
@Nonnull public int[] getMaxConcurrency()
- Specified by:
getMaxConcurrencyin interfaceCallTracker
-
getStartFrequency
@Nonnull public int[] getStartFrequency()
- Specified by:
getStartFrequencyin interfaceCallTracker
-
getStartCount
@Nonnull public long[] getStartCount()
- Specified by:
getStartCountin interfaceCallTracker
-
getErrorFrequency
@Nonnull public int[] getErrorFrequency()
- Specified by:
getErrorFrequencyin interfaceCallTracker
-
getErrorCount
public long[] getErrorCount()
- Specified by:
getErrorCountin interfaceCallTracker
-
getCallStats
@Nonnull public CallTracker.CallStats getCallStats()
- Specified by:
getCallStatsin interfaceCallTracker
-
computeQuantile
public AbstractQuantileEstimation.Quantile computeQuantile(long sample, @Nonnull java.util.concurrent.TimeUnit timeUnit)
-
reset
public void reset()
- Specified by:
resetin interfaceCallTracker
-
getLastResetTime
public long getLastResetTime()
- Specified by:
getLastResetTimein interfaceCallTracker
-
getTimeSinceLastStartCall
public long getTimeSinceLastStartCall()
- Specified by:
getTimeSinceLastStartCallin interfaceCallTracker
-
-