Class StatsComponentImplBase
java.lang.Object
io.opencensus.stats.StatsComponent
io.opencensus.implcore.stats.StatsComponentImplBase
- Direct Known Subclasses:
StatsComponentImpl, StatsComponentImplLite
Base implementation of
StatsComponent.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final CurrentStateprivate static final CurrentState.Stateprivate final StatsRecorderImplprivate final ViewManagerImpl -
Constructor Summary
ConstructorsConstructorDescriptionStatsComponentImplBase(EventQueue queue, Clock clock) Creates a newStatsComponentImplBase. -
Method Summary
Modifier and TypeMethodDescriptiongetState()Returns the currentStatsCollectionState.Returns the defaultStatsRecorder.Returns the defaultViewManager.voidsetState(StatsCollectionState newState) Sets the currentStatsCollectionState.private static StatsCollectionStateprivate static CurrentState.StatestatsStateToState(StatsCollectionState statsCollectionState)
-
Field Details
-
DEFAULT_STATE
-
currentState
-
viewManager
-
statsRecorder
-
-
Constructor Details
-
StatsComponentImplBase
Creates a newStatsComponentImplBase.- Parameters:
queue- the queue implementation.clock- the clock to use when recording stats.
-
-
Method Details
-
getViewManager
Description copied from class:StatsComponentReturns the defaultViewManager.- Specified by:
getViewManagerin classStatsComponent
-
getStatsRecorder
Description copied from class:StatsComponentReturns the defaultStatsRecorder.- Specified by:
getStatsRecorderin classStatsComponent
-
getState
Description copied from class:StatsComponentReturns the currentStatsCollectionState.When no implementation is available,
getStatealways returnsStatsCollectionState.DISABLED.Once
StatsComponent.getState()is called, subsequent calls toStatsComponent.setState(StatsCollectionState)will throw anIllegalStateException.- Specified by:
getStatein classStatsComponent- Returns:
- the current
StatsCollectionState.
-
setState
Description copied from class:StatsComponentSets the currentStatsCollectionState.When no implementation is available,
setStatedoes not change the state.If state is set to
StatsCollectionState.DISABLED, all stats that are previously recorded will be cleared.- Specified by:
setStatein classStatsComponent- Parameters:
newState- the newStatsCollectionState.
-
statsStateToState
-
stateToStatsState
-