public class SessionCounter extends EventCounter
SessionCounter events may overlap. In other words, a second event may start before
the first one stops. For a given mCurrentInterval, mNow, mPeakEvents, mPriorIntervalintervalSeconds, startTime, totalIntervals| Constructor and Description |
|---|
SessionCounter() |
SessionCounter(String inLabel)
Constructs a new SessionCounter.
|
SessionCounter(String inLabel,
int inIntervalSeconds)
Constructor for the SessionCounter object
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(int inIgnored)
Counts the beginning of a session.
|
protected void |
createIntervals() |
long |
getConcurrency()
Gets the current concurrency, the number of sessions that have been added
(started) without having yet been removed (stopped).
|
long |
getMaximumSessionStartTime() |
long |
getMaximumSessionTime()
Gets the number of milliseconds that elapsed during the longest completed
session.
|
long |
getPeakConcurrency()
Gets the peak concurrency observed over the life of the metric.
|
SessionCounterInterval |
getPeakConcurrencyInterval()
Gets the interval in which the highest concurrency was noted.
|
long |
getRecentSessionTime()
Gets the number of milliseconds that a recent completed session took.
|
static SessionCounter |
getSessionCounter(String inLabel)
Get an instance of a SessionCounter with a particular label from the
MetricRepository, creating one if necessary.
|
static SessionCounter |
getSessionCounter(String inLabel,
int inIntervalSeconds)
Get an instance of a SessionCounter with a particular label from the
MetricRepository.
|
float |
getSessionTime()
Gets the number of milliseconds of elapsed time spent within sessions
observed by this
SessionCounter. |
float |
getSessionTimeMean()
Gets the mean session time in milliseconds.
|
protected void |
normalizeCurrent_ScenarioA() |
protected void |
normalizeCurrent_ScenarioB() |
protected void |
normalizePrior_ScenarioA() |
protected void |
normalizePrior_ScenarioB(long nEmptyIntervals) |
void |
remove()
Removes a single event.
|
void |
remove(int inCount)
Informs this EventCounter that a previously added event is "finished" and
no longer among the concurrent events.
|
void |
reset()
Reset this
SessionCounter to its "zero" condition so that it
can be reused, avoiding the overhead of constructing a new instance. |
void |
start()
Functionally identical to add(), supporting the start/stop terminology
which is more natural then add/remove when the emphasis is on measuring
elapsed time within critical sections.
|
void |
stop()
Functionally identical to remove().
|
getCount, getCumulativeEvents, getCumulativeFreq, getCurrentFreq, getCurrentInterval, getEventCounter, getPeakEvents, getPeakEventsInterval, normalizeadd, getAge, getAgeMillis, getIntervalSeconds, getLabel, getTotalIntervals, setLabel, uptimepublic SessionCounter()
public SessionCounter(String inLabel, int inIntervalSeconds)
inLabel - Descriptive label for this SessionCounterinIntervalSeconds - number of seconds in each interval of this SessionCounterpublic SessionCounter(String inLabel)
inLabel - Description of the Parameterpublic static SessionCounter getSessionCounter(String inLabel)
inLabel - - descriptive label for this SessionCounterpublic static SessionCounter getSessionCounter(String inLabel, int inIntervalSeconds)
inLabel - - descriptive label for this SessionCounterinIntervalSeconds - number of seconds in each interval of this SessionCounterpublic void reset()
SessionCounter to its "zero" condition so that it
can be reused, avoiding the overhead of constructing a new instance.reset in class EventCounterpublic long getConcurrency()
public long getPeakConcurrency()
getPeakConcurrencyInterval().getPeakConcurrency()public SessionCounterInterval getPeakConcurrencyInterval()
public float getSessionTime()
SessionCounter. Incomplete sessions
-- those that have been started and not stopped -- are not included.public long getRecentSessionTime()
public long getMaximumSessionTime()
public long getMaximumSessionStartTime()
public float getSessionTimeMean()
public void add(int inIgnored)
add in class EventCounterinIgnored - - ignored for SessionCounterpublic void start()
public void stop()
public void remove(int inCount)
inCount - - number of events to be removedpublic void remove()
protected void createIntervals()
createIntervals in class EventCounterprotected void normalizeCurrent_ScenarioA()
normalizeCurrent_ScenarioA in class EventCounterprotected void normalizePrior_ScenarioA()
normalizePrior_ScenarioA in class EventCounterprotected void normalizeCurrent_ScenarioB()
normalizeCurrent_ScenarioB in class EventCounterprotected void normalizePrior_ScenarioB(long nEmptyIntervals)
normalizePrior_ScenarioB in class EventCounterCopyright © 2015. All rights reserved.