Class MetricsContextBase<S extends AllMetricsSnapshot>
- java.lang.Object
-
- com.emc.mongoose.base.metrics.context.MetricsContextBase<S>
-
- All Implemented Interfaces:
MetricsContext<S>,java.lang.AutoCloseable,java.lang.Comparable<MetricsContext<S>>
- Direct Known Subclasses:
DistributedMetricsContextImpl,MetricsContextImpl
public abstract class MetricsContextBase<S extends AllMetricsSnapshot> extends java.lang.Object implements MetricsContext<S>
-
-
Field Summary
Fields Modifier and Type Field Description protected intconcurrencyThresholdprotected SlastSnapshotprotected java.util.Map<java.lang.String,java.lang.Object>metadataprotected longoutputPeriodMillisprotected booleanstdOutColorFlagprotected MetricsContextBasethresholdMetricsCtxprotected longts-
Fields inherited from interface com.emc.mongoose.base.metrics.context.MetricsContext
DEFAULT_RESERVOIR_SIZE, DEFAULT_SNAPSHOT_UPDATE_PERIOD_MILLIS
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedMetricsContextBase(java.util.Map metadata, int concurrencyThreshold, boolean stdOutColorFlag, long outputPeriodMillis)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidclose()java.lang.Stringcomment()intcompareTo(MetricsContext<S> other)intconcurrencyLimit()intconcurrencyThreshold()longelapsedTimeMillis()voidenterThresholdState()voidexitThresholdState()inthashCode()booleanisStarted()com.github.akurilov.commons.system.SizeInBytesitemDataSize()longlastOutputTs()voidlastOutputTs(long ts)SlastSnapshot()java.lang.StringloadStepId()java.util.Mapmetadata()protected abstract MetricsContextBase<S>newThresholdMetricsContext()OpTypeopType()longoutputPeriodMillis()voidrefreshLastSnapshot()longrunId()voidstart()longstartTimeStamp()booleanstdOutColorEnabled()MetricsContextthresholdMetrics()booleanthresholdStateEntered()booleanthresholdStateExited()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.emc.mongoose.base.metrics.context.MetricsContext
avgPersistEnabled, markFail, markFail, markPartSucc, markPartSucc, markSucc, markSucc, sumPersistEnabled
-
-
-
-
Field Detail
-
metadata
protected final java.util.Map<java.lang.String,java.lang.Object> metadata
-
ts
protected final long ts
-
concurrencyThreshold
protected final int concurrencyThreshold
-
stdOutColorFlag
protected final boolean stdOutColorFlag
-
outputPeriodMillis
protected final long outputPeriodMillis
-
thresholdMetricsCtx
protected volatile MetricsContextBase thresholdMetricsCtx
-
lastSnapshot
protected volatile S extends AllMetricsSnapshot lastSnapshot
-
-
Method Detail
-
start
public void start()
- Specified by:
startin interfaceMetricsContext<S extends AllMetricsSnapshot>
-
isStarted
public final boolean isStarted()
- Specified by:
isStartedin interfaceMetricsContext<S extends AllMetricsSnapshot>
-
startTimeStamp
public final long startTimeStamp()
- Specified by:
startTimeStampin interfaceMetricsContext<S extends AllMetricsSnapshot>
-
metadata
public final java.util.Map metadata()
- Specified by:
metadatain interfaceMetricsContext<S extends AllMetricsSnapshot>
-
loadStepId
public final java.lang.String loadStepId()
- Specified by:
loadStepIdin interfaceMetricsContext<S extends AllMetricsSnapshot>
-
runId
public final long runId()
- Specified by:
runIdin interfaceMetricsContext<S extends AllMetricsSnapshot>
-
opType
public final OpType opType()
- Specified by:
opTypein interfaceMetricsContext<S extends AllMetricsSnapshot>
-
concurrencyLimit
public final int concurrencyLimit()
- Specified by:
concurrencyLimitin interfaceMetricsContext<S extends AllMetricsSnapshot>
-
concurrencyThreshold
public final int concurrencyThreshold()
- Specified by:
concurrencyThresholdin interfaceMetricsContext<S extends AllMetricsSnapshot>
-
itemDataSize
public final com.github.akurilov.commons.system.SizeInBytes itemDataSize()
- Specified by:
itemDataSizein interfaceMetricsContext<S extends AllMetricsSnapshot>
-
stdOutColorEnabled
public final boolean stdOutColorEnabled()
- Specified by:
stdOutColorEnabledin interfaceMetricsContext<S extends AllMetricsSnapshot>
-
outputPeriodMillis
public final long outputPeriodMillis()
- Specified by:
outputPeriodMillisin interfaceMetricsContext<S extends AllMetricsSnapshot>
-
lastOutputTs
public final long lastOutputTs()
- Specified by:
lastOutputTsin interfaceMetricsContext<S extends AllMetricsSnapshot>
-
lastOutputTs
public final void lastOutputTs(long ts)
- Specified by:
lastOutputTsin interfaceMetricsContext<S extends AllMetricsSnapshot>
-
lastSnapshot
public final S lastSnapshot()
- Specified by:
lastSnapshotin interfaceMetricsContext<S extends AllMetricsSnapshot>
-
refreshLastSnapshot
public void refreshLastSnapshot()
- Specified by:
refreshLastSnapshotin interfaceMetricsContext<S extends AllMetricsSnapshot>
-
thresholdMetrics
public final MetricsContext thresholdMetrics() throws java.lang.IllegalStateException
- Specified by:
thresholdMetricsin interfaceMetricsContext<S extends AllMetricsSnapshot>- Throws:
java.lang.IllegalStateException
-
enterThresholdState
public final void enterThresholdState() throws java.lang.IllegalStateException- Specified by:
enterThresholdStatein interfaceMetricsContext<S extends AllMetricsSnapshot>- Throws:
java.lang.IllegalStateException
-
newThresholdMetricsContext
protected abstract MetricsContextBase<S> newThresholdMetricsContext()
-
thresholdStateEntered
public final boolean thresholdStateEntered()
- Specified by:
thresholdStateEnteredin interfaceMetricsContext<S extends AllMetricsSnapshot>
-
exitThresholdState
public final void exitThresholdState() throws java.lang.IllegalStateException- Specified by:
exitThresholdStatein interfaceMetricsContext<S extends AllMetricsSnapshot>- Throws:
java.lang.IllegalStateException
-
thresholdStateExited
public final boolean thresholdStateExited()
- Specified by:
thresholdStateExitedin interfaceMetricsContext<S extends AllMetricsSnapshot>
-
hashCode
public final int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
compareTo
public final int compareTo(MetricsContext<S> other)
- Specified by:
compareToin interfacejava.lang.Comparable<S extends AllMetricsSnapshot>
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfaceMetricsContext<S extends AllMetricsSnapshot>
-
elapsedTimeMillis
public long elapsedTimeMillis()
- Specified by:
elapsedTimeMillisin interfaceMetricsContext<S extends AllMetricsSnapshot>
-
comment
public java.lang.String comment()
- Specified by:
commentin interfaceMetricsContext<S extends AllMetricsSnapshot>
-
-