public final class DisabledManager extends Object implements Manager
Manager
implementation that does nothing or returns null
or NullSimon
as expected
from manager in disabled state. Does not support enable()
/disable()
- for this
use SwitchingManager
.HIERARCHY_DELIMITER, ROOT_SIMON_NAME
CPU, MILLIS_IN_SECOND, NANOS_IN_MILLIS, NANOS_IN_SECOND, SYSTEM
Constructor and Description |
---|
DisabledManager() |
Modifier and Type | Method and Description |
---|---|
CompositeCallback |
callback()
Accesses default composite callback of this manager.
|
void |
clear()
Clears the whole manager and starts again with a single newly created Root Simon.
|
ManagerConfiguration |
configuration()
Accesses configuration of this manager.
|
void |
destroySimon(String name)
Removes Simon from the Manager.
|
void |
disable()
Throws
UnsupportedOperationException . |
void |
enable()
Throws
UnsupportedOperationException . |
Counter |
getCounter(String name)
Returns "Null Counter" that always returns empty/null values and cannot measure anything.
|
Simon |
getRootSimon()
Returns "Null Simon" that always returns empty/null values and cannot measure anything.
|
Simon |
getSimon(String name)
Returns "Null Simon" that always returns empty/null values and cannot measure anything.
|
Collection<String> |
getSimonNames()
Returns unmodifiable collection containing names of all existing Simons.
|
Collection<Simon> |
getSimons(SimonFilter simonFilter)
Returns collection containing all existing Simons accepted by specified
SimonFilter . |
Stopwatch |
getStopwatch(String name)
Returns "Null Stopwatch" that always returns empty/null values and cannot measure anything.
|
boolean |
isEnabled()
Returns false.
|
void |
message(String message)
Does nothing here.
|
long |
millisForNano(long nanos)
Converts nano timer value into millis timestamp compatible with
SimonClock.milliTime() without actually
using the timer. |
long |
milliTime()
Gets current time in milliseconds.
|
long |
nanoTime()
Gets current time in nanoseconds.
|
void |
warning(String message,
Exception cause)
Does nothing here.
|
public DisabledManager()
public void destroySimon(String name)
Manager
destroySimon
in interface Manager
name
- name of the Simonpublic void clear()
Manager
public CompositeCallback callback()
Manager
public ManagerConfiguration configuration()
Manager
configuration
in interface Manager
public Counter getCounter(String name)
getCounter
in interface Manager
name
- ignoredpublic Stopwatch getStopwatch(String name)
getStopwatch
in interface Manager
name
- ignoredpublic Simon getRootSimon()
Stopwatch
nor Counter
.getRootSimon
in interface Manager
public Collection<String> getSimonNames()
Manager
getSimonNames
in interface Manager
public Collection<Simon> getSimons(SimonFilter simonFilter)
Manager
SimonFilter
.
If null
filter is provided all Simons are returned in an unmodifiable Collection.
Otherwise new collection with matching Simons is returned.getSimons
in interface Manager
simonFilter
- filter accepting the Simons to result collectionto find out more about possible patterns
public void enable()
UnsupportedOperationException
.public void disable()
UnsupportedOperationException
.public boolean isEnabled()
public long nanoTime()
SimonClock
nanoTime
in interface SimonClock
public long milliTime()
SimonClock
milliTime
in interface SimonClock
public long millisForNano(long nanos)
SimonClock
SimonClock.milliTime()
without actually
using the timer. Method does not just divide nanos by one million, but also works with remembered
values for milli- and nano-timers at one particular moment.millisForNano
in interface SimonClock
nanos
- nano timer valueCopyright © 2019. All rights reserved.