java.lang.Object
net.i2p.router.web.GraphGenerator.CauseTally
- Enclosing class:
GraphGenerator
Count and oldest age for one
GraphGenerator.StaleCause.Deliberately free of router context and of synchronization: a tally is built and read entirely within the single-threaded sync task, and keeping it plain lets the report wording be unit tested without a running router.
Constructor Summary
ConstructorsMethod Summary
All MethodsModifier and TypeMethodDescription(package private) intcount()How many listeners this cause has been blamed for.(package private) Stringdescribe()Render this cause for the log line.(package private) Stringnames()Render the names recorded for this cause, or an empty string when none were.(package private) voidrecord(long ageMs, boolean sinceLastWrite) Add one listener to this tally.(package private) voidAdd one listener to this tally, naming it.
Constructor Details
CauseTally
CauseTally(GraphGenerator.StaleCause cause) An empty tally for one cause.- Parameters:
cause- the cause this tally counts
Method Details
record
void record(long ageMs, boolean sinceLastWrite) Add one listener to this tally.- Parameters:
ageMs- age fromGraphGenerator.staleAge(long, long, long)sinceLastWrite- true if measured from the last successful write
record
Add one listener to this tally, naming it.The name is what makes the report actionable: a count of stalled listeners with no names leaves the operator to diff every rate on the page against the graphs, which is exactly the work the report exists to save.
- Parameters:
ageMs- age fromGraphGenerator.staleAge(long, long, long)sinceLastWrite- true if measured from the last successful writename- the listener's stat name, or null when not known
count
int count()How many listeners this cause has been blamed for.- Returns:
- number of listeners attributed to this cause
names
String names()Render the names recorded for this cause, or an empty string when none were.- Returns:
- the trailing "name[, name]" clause, without a leading separator
describe
String describe()Render this cause for the log line.- Returns:
cause=countwhen empty, otherwisecause=count (oldest Ns origin)