Class NBBaseComponent
java.lang.Object
io.nosqlbench.nb.api.components.core.NBBaseComponentMetrics
io.nosqlbench.nb.api.components.core.NBBaseComponent
- All Implemented Interfaces:
NBComponent,NBComponentAdvisors,NBComponentEvents,NBComponentMetrics,NBComponentProps,NBComponentServices,NBComponentTimeline,NBProviderSearch,NBTokenWords,NBLabeledElement,AutoCloseable
- Direct Known Subclasses:
AtomicInput,BaseDriverAdapter,BaseOpDispenser,BobyqaOptimizerInstance,CapabilityHook,ClientSystemMetricChecker,ComputeFunctions,ConcurrentSpaceCache,ContainerActivitiesController,CqlUtils,CsvOutputPluginWriter,ExamplePlugin,HdrHistoLog,HistoStats,HttpPlugin,NBBufferedContainer,NBInvokableCommand,NBSessionSafetyMetrics,NBShutdownHook,NBStatusComponent,ParsedOp,S3Uploader,SimFramePlanner,SimRate,StringDriverSpaceCache,TestComponent,UnstartedPeriodicTaskComponent
public class NBBaseComponent
extends NBBaseComponentMetrics
implements NBComponent, NBTokenWords, NBComponentTimeline
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.nosqlbench.nb.api.labels.NBLabeledElement
NBLabeledElement.BasicLabeledElement -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected longprotected Exceptionprotected longprotected final NBLabelsprotected NBMetricsBufferprotected final NBComponentprotected longprotected longprotected NBInvokableStateprotected longFields inherited from interface io.nosqlbench.nb.api.components.core.NBComponent
EMPTY_COMPONENTFields inherited from interface io.nosqlbench.nb.api.components.core.NBComponentProps
HDRDIGITS, SUMMARYFields inherited from interface io.nosqlbench.nb.api.labels.NBLabeledElement
EMPTY -
Constructor Summary
ConstructorsConstructorDescriptionNBBaseComponent(NBComponent parentComponent) NBBaseComponent(NBComponent parentComponent, NBLabels componentSpecificLabelsOnly) NBBaseComponent(NBComponent parentComponent, NBLabels componentSpecificLabelsOnly, Map<String, String> props) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAdvisor(NBAdvisorPoint advisor) voidaddMetricsCloseable(MetricsCloseable metric) attachChild(NBComponent... children) voidfinal voidclose()create()detachChild(NBComponent... children) find()<T> Optional<T> findParentService(Class<T> type) List<NBAdvisorPoint<?>> getComponentProp(String name) longlongThis will be 0L if the component hasn't began the process of closing down.longThis will be 0L if the component hasn't logged an error.longThis will be 0L if the component hasn't fully started, else it will be theSystem.nanoTime()of when the component entered its constructorlongThis will be 0L if the component hasn't completed teardown.voidvoidvoidThis method is called by the engine to report a component going out of scope.setComponentProp(String name, String value) longprotected voidteardown()Override this method in your component implementations when you need to do something to close out your component.toString()Methods inherited from class io.nosqlbench.nb.api.components.core.NBBaseComponentMetrics
addComponentMetric, addListener, findComponentMetrics, findComponentMetrics, getComponentMetric, getComponentMetrics, removeListenerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.nosqlbench.nb.api.components.core.NBComponentAdvisors
getAdvisorResultsMethods inherited from interface io.nosqlbench.nb.api.components.core.NBComponentMetrics
addComponentMetric, findComponentMetrics, findComponentMetrics, findOneComponentMetric, findOneComponentMetric, getComponentMetric, getComponentMetricsMethods inherited from interface io.nosqlbench.nb.api.labels.NBLabeledElement
description
-
Field Details
-
parent
-
labels
-
metricsBuffer
-
bufferOrphanedMetrics
protected boolean bufferOrphanedMetrics -
error
-
started_ns
protected long started_ns -
teardown_ns
protected long teardown_ns -
closed_ns
protected long closed_ns -
errored_ns
protected long errored_ns -
started_epoch_ms
protected long started_epoch_ms -
state
-
-
Constructor Details
-
NBBaseComponent
-
NBBaseComponent
-
NBBaseComponent
public NBBaseComponent(NBComponent parentComponent, NBLabels componentSpecificLabelsOnly, Map<String, String> props)
-
-
Method Details
-
getParent
- Specified by:
getParentin interfaceNBComponent
-
attachChild
- Specified by:
attachChildin interfaceNBComponent
-
detachChild
- Specified by:
detachChildin interfaceNBComponent
-
getChildren
- Specified by:
getChildrenin interfaceNBComponent
-
getLabels
- Specified by:
getLabelsin interfaceNBLabeledElement
-
getComponentOnlyLabels
- Specified by:
getComponentOnlyLabelsin interfaceNBComponent
-
beforeDetach
public void beforeDetach()- Specified by:
beforeDetachin interfaceNBComponent
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceNBComponent- Throws:
RuntimeException
-
onError
-
teardown
protected void teardown()Override this method in your component implementations when you need to do something to close out your component. -
create
- Specified by:
createin interfaceNBComponentServices
-
find
- Specified by:
findin interfaceNBComponentServices
-
toString
-
onEvent
- Specified by:
onEventin interfaceNBComponentEvents
-
findParentService
- Specified by:
findParentServicein interfaceNBProviderSearch
-
getTokens
- Specified by:
getTokensin interfaceNBTokenWords
-
reportExecutionMetric
This method is called by the engine to report a component going out of scope. The metrics for that component will bubble up through the component layers and can be buffered for reporting at multiple levels.- Specified by:
reportExecutionMetricin interfaceNBComponent- Parameters:
m- The metric to report
-
getNanosSinceStart
public long getNanosSinceStart()- Specified by:
getNanosSinceStartin interfaceNBComponent
-
getComponentProp
- Specified by:
getComponentPropin interfaceNBComponentProps
-
setComponentProp
- Specified by:
setComponentPropin interfaceNBComponentProps
-
getComponentState
- Specified by:
getComponentStatein interfaceNBComponentTimeline
-
nanosof_start
public long nanosof_start()Description copied from interface:NBComponentTimelineThis will be 0L if the component hasn't fully started, else it will be theSystem.nanoTime()of when the component entered its constructor- Specified by:
nanosof_startin interfaceNBComponentTimeline- Returns:
- nanosecond time of component construction
-
nanosof_close
public long nanosof_close()Description copied from interface:NBComponentTimelineThis will be 0L if the component hasn't began the process of closing down.- Specified by:
nanosof_closein interfaceNBComponentTimeline- Returns:
- nanosecond time of invoking
close()
-
nanosof_teardown
public long nanosof_teardown()Description copied from interface:NBComponentTimelineThis will be 0L if the component hasn't completed teardown. Otherwise it will be theSystem.nanoTime()when the base teardown logic in the component has completed. For this reason, it is imperative that any overrides toteardown()are called, and called last in the overridden teardown method.- Specified by:
nanosof_teardownin interfaceNBComponentTimeline- Returns:
- nanosecond time of teardown completion
-
nanosof_error
public long nanosof_error()Description copied from interface:NBComponentTimelineThis will be 0L if the component hasn't logged an error. Otherwise it will be theSystem.nanoTime()of when the error was reported.- Specified by:
nanosof_errorin interfaceNBComponentTimeline- Returns:
- nanosecond time of the error
-
started_epoch_ms
public long started_epoch_ms()- Specified by:
started_epoch_msin interfaceNBComponentTimeline
-
addMetricsCloseable
-
addAdvisor
- Specified by:
addAdvisorin interfaceNBComponentAdvisors
-
getAdvisors
- Specified by:
getAdvisorsin interfaceNBComponentAdvisors
-