public interface Simon extends HasAttributes
Modifier and Type | Method and Description |
---|---|
List<Simon> |
getChildren()
Returns list of children - direct sub-simons.
|
long |
getFirstUsage()
Returns ms timestamp of the first usage of this Simon.
|
long |
getLastUsage()
Returns ms timestamp of the last usage of this Simon.
|
Manager |
getManager()
Returns Simon's
Manager . |
String |
getName()
Returns Simon name.
|
String |
getNote()
Returns note for the Simon.
|
Simon |
getParent()
Returns parent Simon.
|
SimonState |
getState()
Returns state of the Simon that can be enabled, disabled or inherited.
|
boolean |
isEnabled()
Returns true, if the Simon is enabled or if the enabled state is inherited.
|
Sample |
sample()
Samples Simon values and returns them in a Java Bean derived from Sample interface.
|
Sample |
sampleIncrement(Object key)
Samples increment in Simon values since the previous call of this method with the
same key.
|
Sample |
sampleIncrementNoReset(Object key)
Samples current value of incremental Simon.
|
void |
setNote(String note)
Sets note for the Simon.
|
void |
setState(SimonState state,
boolean overrule)
Sets the state of the Simon.
|
boolean |
stopIncrementalSampling(Object key)
Stops incremental sampling for the key, removing any internal information for the key.
|
getAttribute, getAttribute, getAttributeNames, getCopyAsSortedMap, removeAttribute, setAttribute
String getName()
null
for anonymous Simons.List<Simon> getChildren()
Manager getManager()
Manager
.Manager
SimonState getState()
void setState(SimonState state, boolean overrule)
state
- a new state.overrule
- specifies whether this change is forced to the whole subtree.IllegalArgumentException
- if state
is null
.boolean isEnabled()
String getNote()
void setNote(String note)
note
- note for the Simon.long getFirstUsage()
long getLastUsage()
Sample sample()
Sample sampleIncrement(Object key)
sample()
. Any subsequent calls with the key
provide increments.
Clients can use any sampling key (any Object) which enables safe access to their own increments.
Using String does not guarantee this as any client can potentially guess the key. This
may or may not be an issue.key
- sampling key used to access incremental sampleSample
with value incrementsSample sampleIncrementNoReset(Object key)
sampleIncrement(Object)
but
does not reset the incremental Simon. This method does not start incremental sampling
and keeps returning values from sample()
for any key that was not used with
sampleIncrement(Object)
before.key
- sampling key used to access incremental sampleSample
with value incrementssampleIncrement(Object)
boolean stopIncrementalSampling(Object key)
sampleIncrement(Object)
for the key will be considered the first
call for the key.key
- sampling key used to access incremental sampleCopyright © 2019. All rights reserved.