JMeterContext----上下文

http://jmeter.apache.org/api/org/apache/jmeter/threads/JMeterContext.html

 

org.apache.jmeter.threads

Class JMeterContext

  • java.lang.Object
  • org.apache.jmeter.threads.JMeterContext


  • public class JMeterContext
    extends java.lang.Object
    Holds context for a thread. Generated by JMeterContextService. The class is not thread-safe - it is only intended for use within a single thread.

 

Method Summary

All MethodsInstance MethodsConcrete MethodsDeprecated Methods
Modifier and TypeMethod and Description
voidcleanAfterSample()
Clean cached data after sample Internally called by JMeter, never call it directly
voidclear()
Internally called by JMeter, never call it directly
SamplergetCurrentSampler()
StandardJMeterEnginegetEngine()
SampleResultgetPreviousResult()
SamplergetPreviousSampler()
Returns the previousSampler.
java.util.PropertiesgetProperties()
java.util.Map<java.lang.String,java.lang.Object>getSamplerContext()
Sampler context is cleaned up as soon as Post-Processor have ended
JMeterThreadgetThread()
AbstractThreadGroupgetThreadGroup()
intgetThreadNum()
Returns the threadNum.
JMeterVariablesgetVariables()
Gives access to the JMeter variables for the current thread.
booleanisRecording()
booleanisRestartNextLoop()
Deprecated. 
booleanisSamplingStarted()
booleanisStartNextThreadLoop()
voidsetCurrentSampler(Sampler sampler)
Internally called by JMeter, never call it directly
voidsetEngine(StandardJMeterEngine engine)
Internally called by JMeter, never call it directly
voidsetPreviousResult(SampleResult result)
Internally called by JMeter, never call it directly
voidsetRecording(boolean recording)
Internally called by JMeter, never call it directly
voidsetRestartNextLoop(boolean restartNextLoop)
Deprecated. 
voidsetSamplingStarted(boolean b)
Internally called by JMeter, never call it directly
voidsetStartNextThreadLoop(boolean restartNextLoop)
voidsetThread(JMeterThread thread)
Internally called by JMeter, never call it directly
voidsetThreadGroup(AbstractThreadGroup threadgrp)
Internally called by JMeter, never call it directly
voidsetThreadNum(int threadNum)
Internally called by JMeter, never call it directly
voidsetVariables(JMeterVariables vars)
Internally called by JMeter, never call it directly

 

      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • clear
        public void clear()
        Internally called by JMeter, never call it directly
      • getVariables
        public JMeterVariables getVariables()
        Gives access to the JMeter variables for the current thread.
        Returns:
        a pointer to the JMeter variables.
      • getProperties
        public java.util.Properties getProperties()
        Returns:
        a pointer to the JMeter Properties.
      • setVariables
        public void setVariables(JMeterVariables vars)
        Internally called by JMeter, never call it directly
        Parameters:
        vars - JMeterVariables
      • getPreviousResult
        public SampleResult getPreviousResult()
      • setPreviousResult
        public void setPreviousResult(SampleResult result)
        Internally called by JMeter, never call it directly
        Parameters:
        result - SampleResult
      • getCurrentSampler
        public Sampler getCurrentSampler()
      • setCurrentSampler
        public void setCurrentSampler(Sampler sampler)
        Internally called by JMeter, never call it directly
        Parameters:
        sampler - Sampler
      • getPreviousSampler
        public Sampler getPreviousSampler()
        Returns the previousSampler.
        Returns:
        Sampler
      • getThreadNum
        public int getThreadNum()
        Returns the threadNum.
        Returns:
        int
      • setThreadNum
        public void setThreadNum(int threadNum)
        Internally called by JMeter, never call it directly
        Parameters:
        threadNum - number of threads
      • setThread
        public void setThread(JMeterThread thread)
        Internally called by JMeter, never call it directly
        Parameters:
        thread - to use
      • setThreadGroup
        public void setThreadGroup(AbstractThreadGroup threadgrp)
        Internally called by JMeter, never call it directly
        Parameters:
        threadgrp - ThreadGroup to use
      • setEngine
        public void setEngine(StandardJMeterEngine engine)
        Internally called by JMeter, never call it directly
        Parameters:
        engine - to use
      • isSamplingStarted
        public boolean isSamplingStarted()
      • setSamplingStarted
        public void setSamplingStarted(boolean b)
        Internally called by JMeter, never call it directly
        Parameters:
        b - flag whether sampling has started
      • setStartNextThreadLoop
        public void setStartNextThreadLoop(boolean restartNextLoop)
        Parameters:
        restartNextLoop - if set to  true a restart of the loop will occur
      • isStartNextThreadLoop
        public boolean isStartNextThreadLoop()
        Returns:
        true when current loop iteration will be interrupted and JMeter will go to next iteration
      • setRestartNextLoop
        @Deprecated
        public void setRestartNextLoop(boolean restartNextLoop)
        if set to  true current loop iteration will be interrupted and JMeter will go to next iteration
        Parameters:
        restartNextLoop - flag whether to restart
      • isRestartNextLoop
        @Deprecated
        public boolean isRestartNextLoop()
        Deprecated. use isStartNextThreadLoop()
        Returns:
        flag whether restart is set
      • cleanAfterSample
        public void cleanAfterSample()
        Clean cached data after sample Internally called by JMeter, never call it directly
      • getSamplerContext
        public java.util.Map<java.lang.String,java.lang.Object> getSamplerContext()
        Sampler context is cleaned up as soon as Post-Processor have ended
        Returns:
        Context to use within PostProcessors to cache data
      • setRecording
        public void setRecording(boolean recording)
        Internally called by JMeter, never call it directly
        Parameters:
        recording - flag whether recording should be done
        isRecording
public boolean isRecording()

转载于:https://www.cnblogs.com/yigui/p/8478692.html

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值