Interface Session


public interface Session
  • Method Details

    • runTask

      Runnable runTask()
    • reserve

      void reserve(Scenario scenario)
    • 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

      Statistics statistics(int stepId, String name)
    • pruneStats

      void pruneStats(Phase phase)
    • declareResource

      <R extends Session.Resource> void declareResource(Session.ResourceKey<R> key, Supplier<R> resourceSupplier)
      See declareResource(ResourceKey, Supplier, boolean), with singleton defaulting to false
      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 a sequence with non-zero concurrency the session stores one resource for each concurrent instance. If this behaviour should be avoided set singleton to 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

      <R extends Session.Resource> void declareSingletonResource(Session.ResourceKey<R> key, R resource)
    • getResource

      <R extends Session.Resource> R getResource(Session.ResourceKey<R> key)
    • currentSequence

      void currentSequence(SequenceInstance current)
    • currentSequence

      SequenceInstance currentSequence()
    • attach

      void attach(io.netty.util.concurrent.EventExecutor executor, ThreadData threadData, AgentData agentData, GlobalData globalData, SessionStatistics statistics)
    • start

      void start(PhaseInstance phase)
    • 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

      void fail(Throwable t)
    • isActive

      boolean isActive()
    • currentRequest

      Request currentRequest()
      Returns:
      Currently executed request, or null if not in scope.
    • currentRequest

      void currentRequest(Request request)