public final class Stats extends Object
StatsComponent
.Modifier and Type | Method and Description |
---|---|
static StatsCollectionState |
getState()
Returns the current
StatsCollectionState . |
static StatsRecorder |
getStatsRecorder()
Returns the default
StatsRecorder . |
static ViewManager |
getViewManager()
Returns the default
ViewManager . |
static void |
setState(StatsCollectionState state)
Deprecated.
This method is deprecated because other libraries could cache the result of
getState() , use a stale value, and behave incorrectly. It is only safe to call early in
initialization. This method throws IllegalStateException after getState()
has been called, in order to limit changes to the result of getState() . |
public static StatsRecorder getStatsRecorder()
StatsRecorder
.public static ViewManager getViewManager()
ViewManager
.public static StatsCollectionState getState()
StatsCollectionState
.
When no implementation is available, getState
always returns StatsCollectionState.DISABLED
.
Once getState()
is called, subsequent calls to setState(StatsCollectionState)
will throw an IllegalStateException
.
StatsCollectionState
.@Deprecated public static void setState(StatsCollectionState state)
getState()
, use a stale value, and behave incorrectly. It is only safe to call early in
initialization. This method throws IllegalStateException
after getState()
has been called, in order to limit changes to the result of getState()
.StatsCollectionState
.
When no implementation is available, setState
does not change the state.
If state is set to StatsCollectionState.DISABLED
, all stats that are previously
recorded will be cleared.
state
- the new StatsCollectionState
.IllegalStateException
- if getState()
was previously called.