Class ContainerActivitiesController
- All Implemented Interfaces:
NBComponent,NBComponentAdvisors,NBComponentEvents,NBComponentMetrics,NBComponentProps,NBComponentServices,NBComponentTimeline,NBProviderSearch,NBTokenWords,NBLabeledElement,AutoCloseable
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.nosqlbench.nb.api.labels.NBLabeledElement
NBLabeledElement.BasicLabeledElement -
Field Summary
Fields inherited from class io.nosqlbench.nb.api.components.core.NBBaseComponent
bufferOrphanedMetrics, closed_ns, error, errored_ns, labels, metricsBuffer, parent, started_epoch_ms, started_ns, state, teardown_nsFields 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidawait(ActivityDef activityDef, long timeoutMs) booleanvoidbooleanawaitActivity(ActivityDef activityDef, long timeoutMs) booleanawaitActivity(String alias, long timeoutMs) booleanawaitActivity(Map<String, String> activityDefMap) booleanawaitAllThreadsOnline(Activity activity, long timeoutMs) booleanawaitAllThreadsOnline(ActivityDef activityDef, long timeoutMs) booleanawaitCompletion(long waitTimeMillis) Await completion of all running activities, but do not force shutdownActivity.voidforceStop(ActivityDef activityDef) Force stopping an activity, given an activity def.voidStop an activity, given the name by which it is known already in the scenario.voidStop an activity, given an activity def map.voidforceStopActivities(int waitTimeMillis) Force the scenario to stop running.getActivity(String activityName) getActivityDef(String alias) Return all the names of the activites that are known to this scenario.booleanisRunningActivity(ActivityDef activityDef) booleanisRunningActivity(String alias) booleanisRunningActivity(Map<String, String> activityDefMap) voidnotifyException(Thread t, Throwable e) voidvoidvoidvoidrun(ActivityDef activityDef) voidrun(ActivityDef activityDef, long timeoutMs) Synchronously run the defined activity with a timeout in seconds.voidvoidvoidshutdown()start(ActivityDef activityDef) Start an activity, given the activity definition for it.Start an activity, given the name by which it is known already in the scenario.Start an activity, given a map which holds the activity definition for it.voidvoidstop(ActivityDef activityDef) Stop an activity, given an activity def.voidStop an activity, given the name by which it is known already in the scenario.voidStop an activity, given an activity def map.voidwaitMillis(long waitMillis) Wait for a bit.Methods inherited from class io.nosqlbench.nb.api.components.core.NBBaseComponent
addAdvisor, addMetricsCloseable, attachChild, beforeDetach, close, create, detachChild, find, findParentService, getAdvisors, getChildren, getComponentOnlyLabels, getComponentProp, getComponentState, getLabels, getNanosSinceStart, getParent, getTokens, nanosof_close, nanosof_error, nanosof_start, nanosof_teardown, onError, onEvent, reportExecutionMetric, setComponentProp, started_epoch_ms, teardown, toStringMethods 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
-
Constructor Details
-
ContainerActivitiesController
-
-
Method Details
-
start
Start an activity, given the activity definition for it. The activity will be known in the scenario by the alias parameter.- Parameters:
activityDef- string in alias=value1;driver=value2;... format
-
start
-
start
-
run
-
run
Synchronously run the defined activity with a timeout in seconds.- Parameters:
activityDef- A definition for an activity to runtimeoutMs- seconds to await completion of the activity.
-
run
-
run
-
run
-
run
-
isRunningActivity
-
isRunningActivity
-
isRunningActivity
-
stop
Stop an activity, given an activity def. The only part of the activity def that is important is the alias parameter. This method retains the activity def signature to provide convenience for scripting.
For example, sc.stop("alias=foo")
- Parameters:
activityDef- An activity def, including at least the alias parameter.
-
awaitAllThreadsOnline
-
stop
-
awaitAllThreadsOnline
-
stop
Stop an activity, given an activity def map. The only part of the map that is important is the alias parameter. This method retains the map signature to provide convenience for scripting.
- Parameters:
activityDefMap- A map, containing at least the alias parameter
-
stop
Stop an activity, given the name by which it is known already in the scenario. This causes the activity to stop all threads, but keeps the thread objects handy for starting again. This can be useful for certain testing scenarios in which you want to stop some workloads and start others based on other conditions. Alternately, you can provide one or more aliases in the same command, and all matching names will be stopped.- Parameters:
spec- The name of the activity that is already known to the scenario
-
forceStop
Force stopping an activity, given an activity def. The only part of the activity def that is important is the alias parameter. This method retains the activity def signature to provide convenience for scripting.
For example, sc.forceStop("alias=foo")
- Parameters:
activityDef- An activity def, including at least the alias parameter.
-
forceStop
Stop an activity, given an activity def map. The only part of the map that is important is the alias parameter. This method retains the map signature to provide convenience for scripting.
- Parameters:
activityDefMap- A map, containing at least the alias parameter
-
forceStop
Stop an activity, given the name by which it is known already in the scenario. This causes the activity to stop all threads, but keeps the thread objects handy for starting again. This can be useful for certain testing scenarios in which you want to stop some workloads and start others based on other conditions. Alternately, you can provide one or more aliases in the same command, and all matching names will be stopped.- Parameters:
spec- The name of the activity that is already known to the scenario
-
waitMillis
public void waitMillis(long waitMillis) Wait for a bit. This is not the best approach, and will be replaced with a different system in the future.- Parameters:
waitMillis- time to wait, in milliseconds
-
getAliases
-
forceStopActivities
public void forceStopActivities(int waitTimeMillis) Force the scenario to stop running. Stop all activity threads, and after waitTimeMillis, force stop all activity threads. An activity will stop its threads cooperatively in this time as long as the internal cycles complete before the timer expires.- Parameters:
waitTimeMillis- grace period during which an activity may cooperatively shut down
-
awaitCompletion
public boolean awaitCompletion(long waitTimeMillis) Await completion of all running activities, but do not force shutdownActivity. This method is meant to provide the blocking point for calling logic. It waits. If there is an error which should propagate into the scenario, then it should be thrown from this method.- Parameters:
waitTimeMillis- The time to wait, usually set very high- Returns:
- true, if all activities completed before the timer expired, false otherwise
-
await
-
awaitActivity
-
await
-
awaitActivity
-
await
-
awaitActivity
-
getActivityExecutorMap
- Returns:
- an unmodifyable String to executor map of all activities known to this scenario
-
getActivityDefs
-
reportMetrics
public void reportMetrics() -
getSoloActivity
-
getActivity
-
getProgressMeters
-
notifyException
-
getActivityDef
-
shutdown
public void shutdown()
-