Search in sources :

Example 1 with SamplePackage

use of org.apache.jmeter.threads.SamplePackage in project jmeter by apache.

the class TransactionController method notifyListeners.

/**
     * Create additional SampleEvent in NON Parent Mode
     */
protected void notifyListeners() {
    // TODO could these be done earlier (or just once?)
    JMeterContext threadContext = getThreadContext();
    JMeterVariables threadVars = threadContext.getVariables();
    SamplePackage pack = (SamplePackage) threadVars.getObject(JMeterThread.PACKAGE_OBJECT);
    if (pack == null) {
        // If child of TransactionController is a ThroughputController and TPC does
        // not sample its children, then we will have this
        // TODO Should this be at warn level ?
        log.warn("Could not fetch SamplePackage");
    } else {
        SampleEvent event = new SampleEvent(res, threadContext.getThreadGroup().getName(), threadVars, true);
        // We must set res to null now, before sending the event for the transaction,
        // so that we can ignore that event in our sampleOccured method
        res = null;
        lnf.notifyListeners(event, pack.getSampleListeners());
    }
}
Also used : JMeterVariables(org.apache.jmeter.threads.JMeterVariables) SamplePackage(org.apache.jmeter.threads.SamplePackage) JMeterContext(org.apache.jmeter.threads.JMeterContext) SampleEvent(org.apache.jmeter.samplers.SampleEvent)

Aggregations

SampleEvent (org.apache.jmeter.samplers.SampleEvent)1 JMeterContext (org.apache.jmeter.threads.JMeterContext)1 JMeterVariables (org.apache.jmeter.threads.JMeterVariables)1 SamplePackage (org.apache.jmeter.threads.SamplePackage)1