org.apache.jmeter.examples.sampler

## Class ExampleSampler

- java.lang.Object
- - org.apache.jmeter.testelement.AbstractTestElement
  - - org.apache.jmeter.samplers.AbstractSampler
    - - org.apache.jmeter.examples.sampler.ExampleSampler

- All Implemented Interfaces:
    Serializable, Cloneable, ConfigMergabilityIndicator, Searchable, Sampler, TestElement

      public class ExampleSampler
      extends AbstractSampler

  Example Sampler (non-Bean version) JMeter creates an instance of a sampler class for every occurrence of the element in every thread. [some additional copies may be created before the test run starts] Thus each sampler is guaranteed to be called by a single thread - there is no need to synchronize access to instance variables. However, access to class fields must be synchronized.
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `DATA`

    - ### Fields inherited from interface org.apache.jmeter.testelement.TestElement

      `COMMENTS, ENABLED, GUI_CLASS, NAME, TEST_CLASS`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ExampleSampler()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `getData()`
    `SampleResult` | `sample(Entry e)` Obtains statistics about the given Entry, and packages the information into a SampleResult.

    - ### Methods inherited from class org.apache.jmeter.samplers.AbstractSampler

      `applies`

    - ### Methods inherited from class org.apache.jmeter.testelement.AbstractTestElement

      `addPropertiesValues, addProperty, addProperty, addTestElement, canRemove, clear, clearTemporary, clearTestElementChildren, clone, emptyTemporary, equals, getComment, getName, getProperty, getPropertyAsBoolean, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsInt, getPropertyAsLong, getPropertyAsLong, getPropertyAsString, getPropertyAsString, getSearchableTokens, getThreadContext, getThreadName, hashCode, isEnabled, isRunningVersion, isTemporary, logProperties, mergeIn, propertyIterator, recoverRunningVersion, removeProperty, setComment, setEnabled, setName, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setRunningVersion, setTemporary, setThreadContext, setThreadName, traverse, traverseCollection, traverseMap, traverseProperty`

    - ### Methods inherited from class java.lang.Object

      `finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.apache.jmeter.testelement.TestElement

      `addTestElement, canRemove, clear, clearTestElementChildren, clone, getComment, getName, getProperty, getPropertyAsBoolean, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsInt, getPropertyAsLong, getPropertyAsLong, getPropertyAsString, getPropertyAsString, getThreadContext, getThreadName, isEnabled, isRunningVersion, isTemporary, propertyIterator, recoverRunningVersion, removeProperty, setComment, setEnabled, setName, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setRunningVersion, setTemporary, setThreadContext, setThreadName, traverse`

- - ### Field Detail

    - #### DATA

          public static final String DATA

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### ExampleSampler

          public ExampleSampler()

  - ### Method Detail

    - #### sample

          public SampleResult sample(Entry e)

      Obtains statistics about the given Entry, and packages the information into a SampleResult.
      Parameters:
        `e` - the Entry (TODO seems to be unused)
      Returns:
        information about the sample

    - #### getData

          public String getData()

      Returns:
        the data for the sample

Copyright © 1998-2017 Apache Software Foundation. All Rights Reserved.