@ThreadSafe
public abstract class Stats
extends Object
implements Cloneable, Serializable
Used to hold service statistics.
Modifier | Constructor and Description |
---|---|
protected |
Stats()
Constructs an instance.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addLine(Messages.Entry entry,
Object... params)
Adds a line of text.
|
protected void |
addLine(String format,
Object... params)
Deprecated.
For temporary use.
|
protected void |
addText(String text)
Adds text.
|
void |
buildText()
Builds the text.
|
protected void |
clearMargin()
Clears the margin.
|
void |
clearSnapshot()
Clears the snapshot.
|
protected void |
clearText()
Clears the text.
|
Stats |
clone() |
Stats |
getIntermediate()
Gets intermediate stats.
|
protected Optional<DateTime> |
getLogTime()
Gets the log time.
|
DateTime |
getMarkTime()
Gets the mark time.
|
Optional<Stats> |
getSnapshot()
Gets the snapshot.
|
StringBuilder |
getText()
Gets the text.
|
protected static String |
nanosToString(long elapsed)
Converts elapsed time in nanoseconds to a string.
|
protected void |
setLogTime(DateTime logTime)
Sets the log time.
|
protected void |
setMargin(String margin)
Sets the margin.
|
protected void |
setMarkTime(DateTime markTime)
Sets the mark time.
|
void |
setSnapshot(Stats snapshot)
Sets the snapshot.
|
protected void |
substract(Stats snapshot)
Substract a snapshot to get relative values.
|
String |
toString() |
public void buildText()
public final void clearSnapshot()
public Stats clone()
clone
in class Object
@Nonnull @CheckReturnValue public final Stats getIntermediate()
@Nonnull @CheckReturnValue public final DateTime getMarkTime()
@Nonnull @CheckReturnValue public final Optional<Stats> getSnapshot()
@Nonnull @CheckReturnValue public final StringBuilder getText()
public final void setSnapshot(@Nonnull Stats snapshot)
snapshot
- The snapshot.public String toString()
toString
in class Object
@Nonnull @CheckReturnValue protected static String nanosToString(long elapsed)
elapsed
- The elapsed time in nanoseconds.protected final void addLine(@Nonnull Messages.Entry entry, @Nonnull Object... params)
entry
- The messages entry.params
- The text parameters.@Deprecated protected final void addLine(String format, @Nonnull Object... params)
format
- The text.params
- The text parameters.protected final void addText(@Nonnull String text)
text
- The text.protected final void clearMargin()
protected final void clearText()
@Nonnull @CheckReturnValue protected final Optional<DateTime> getLogTime()
protected final void setLogTime(@Nonnull DateTime logTime)
logTime
- The log time.protected final void setMargin(@Nonnull String margin)
margin
- The margin.protected final void setMarkTime(@Nonnull DateTime markTime)
markTime
- The mark time.protected void substract(@Nonnull Stats snapshot)
snapshot
- The stats snapshot.Copyright © 2003-2019 Serge Brisson. All Rights Reserved.