Package io.hyperfoil.api.session
Interface Session
public interface Session
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumBehaviour when a new sequence start is requested but the concurrency factor is exceeded.static interfacestatic interfaceSession.ResourceKey<R extends Session.Resource>static interfacestatic enum -
Method Summary
Modifier and TypeMethodDescriptionintagentId()intagents()intintvoidattach(io.netty.util.concurrent.EventExecutor executor, ThreadData threadData, AgentData agentData, GlobalData globalData, SessionStatistics statistics) voidcurrentRequest(Request request) voidcurrentSequence(SequenceInstance current) <R extends Session.Resource>
voiddeclareResource(Session.ResourceKey<R> key, Supplier<R> resourceSupplier) <R extends Session.Resource>
voiddeclareResource(Session.ResourceKey<R> key, Supplier<R> resourceSupplier, boolean singleton) Reserve space in the session for a resource, stored under given key.<R extends Session.Resource>
voiddeclareSingletonResource(Session.ResourceKey<R> key, R resource) io.netty.util.concurrent.EventExecutorexecutor()void<R extends Session.Resource>
RgetResource(Session.ResourceKey<R> key) intintbooleanisActive()phase()longvoidproceed()Run anything that can be executed.voidpruneStats(Phase phase) voidvoidreset()runId()runTask()voidstart(PhaseInstance phase) startSequence(String name, boolean forceSameIndex, Session.ConcurrencyPolicy policy) statistics(int stepId, String name) voidstop()intuniqueId()
-
Method Details
-
runTask
Runnable runTask() -
reserve
-
uniqueId
int uniqueId()- Returns:
- int >= 0 that's unique across whole simulation
-
agentThreadId
int agentThreadId() -
agentThreads
int agentThreads() -
globalThreadId
int globalThreadId() -
globalThreads
int globalThreads() -
agentId
int agentId() -
agents
int agents() -
runId
String runId() -
executor
io.netty.util.concurrent.EventExecutor executor() -
threadData
ThreadData threadData() -
agentData
AgentData agentData() -
globalData
GlobalData globalData() -
phase
PhaseInstance phase() -
phaseStartTimestamp
long phaseStartTimestamp() -
statistics
-
pruneStats
-
declareResource
<R extends Session.Resource> void declareResource(Session.ResourceKey<R> key, Supplier<R> resourceSupplier) - Type Parameters:
R- Resource type.- Parameters:
key- Unique key (usually the step or handler itself)resourceSupplier- Supplier creating the resource, possible multiple times.
-
declareResource
<R extends Session.Resource> void declareResource(Session.ResourceKey<R> key, Supplier<R> resourceSupplier, boolean singleton) Reserve space in the session for a resource, stored under given key. If this is executed within asequencewith non-zeroconcurrencythe session stores one resource for each concurrent instance. If this behaviour should be avoided setsingletonto true.- Type Parameters:
R- Resource type.- Parameters:
key- Unique key (usually the step or handler itself)resourceSupplier- Supplier creating the resource, possible multiple times.singleton- Is the resource shared amongst concurrent sequences?
-
declareSingletonResource
-
getResource
-
currentSequence
-
currentSequence
SequenceInstance currentSequence() -
attach
void attach(io.netty.util.concurrent.EventExecutor executor, ThreadData threadData, AgentData agentData, GlobalData globalData, SessionStatistics statistics) -
start
-
proceed
void proceed()Run anything that can be executed. -
reset
void reset() -
startSequence
SequenceInstance startSequence(String name, boolean forceSameIndex, Session.ConcurrencyPolicy policy) -
stop
void stop() -
fail
-
isActive
boolean isActive() -
currentRequest
Request currentRequest()- Returns:
- Currently executed request, or
nullif not in scope.
-
currentRequest
-