当前位置: 首页>>代码示例>>Java>>正文


Java JMeterContext.isSamplingStarted方法代码示例

本文整理汇总了Java中org.apache.jmeter.threads.JMeterContext.isSamplingStarted方法的典型用法代码示例。如果您正苦于以下问题:Java JMeterContext.isSamplingStarted方法的具体用法?Java JMeterContext.isSamplingStarted怎么用?Java JMeterContext.isSamplingStarted使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.jmeter.threads.JMeterContext的用法示例。


在下文中一共展示了JMeterContext.isSamplingStarted方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getStringValue

import org.apache.jmeter.threads.JMeterContext; //导入方法依赖的package包/类
/**
 * Executes the function (and caches the value for the duration of the test
 * iteration) if the property is a running version. Otherwise, the raw
 * string representation of the function is provided.
 *
 * @see JMeterProperty#getStringValue()
 */
@Override
public String getStringValue() {
    JMeterContext ctx = JMeterContextService.getContext();// Expensive, so
                                                            // do
    // once
    if (!isRunningVersion() /*|| !ctx.isSamplingStarted()*/) {
        log.debug("Not running version, return raw function string");
        return function.getRawParameters();
    }
    if(!ctx.isSamplingStarted()) {
        return function.execute();
    }
    log.debug("Running version, executing function");
    int iter = ctx.getVariables() != null ? ctx.getVariables().getIteration() : -1;
    if (iter < testIteration) {
        testIteration = -1;
    }
    if (iter > testIteration || cacheValue == null) {
        testIteration = iter;
        cacheValue = function.execute();
    }
    return cacheValue;

}
 
开发者ID:johrstrom,项目名称:cloud-meter,代码行数:32,代码来源:FunctionProperty.java

示例2: add

import org.apache.jmeter.threads.JMeterContext; //导入方法依赖的package包/类
/**
 * Add a cookie.
 *
 * @param c cookie to be added
 */
public void add(Cookie c) {
    String cv = c.getValue();
    String cn = c.getName();
    removeMatchingCookies(c); // Can't have two matching cookies

    if (DELETE_NULL_COOKIES && (null == cv || cv.length()==0)) {
        if (log.isDebugEnabled()) {
            log.debug("Dropping cookie with null value " + c.toString());
        }
    } else {
        if (log.isDebugEnabled()) {
            log.debug("Add cookie to store " + c.toString());
        }
        getCookies().addItem(c);
        if (SAVE_COOKIES)  {
            JMeterContext context = getThreadContext();
            if (context.isSamplingStarted()) {
                context.getVariables().put(COOKIE_NAME_PREFIX+cn, cv);
            }
        }
    }
}
 
开发者ID:johrstrom,项目名称:cloud-meter,代码行数:28,代码来源:CookieManager.java

示例3: add

import org.apache.jmeter.threads.JMeterContext; //导入方法依赖的package包/类
/**
 * Add a cookie.
 */
public void add(Cookie c) {
    String cv = c.getValue();
    String cn = c.getName();
    removeMatchingCookies(c); // Can't have two matching cookies

    if (DELETE_NULL_COOKIES && (null == cv || cv.length()==0)) {
        if (log.isDebugEnabled()) {
            log.debug("Dropping cookie with null value " + c.toString());
        }
    } else {
        if (log.isDebugEnabled()) {
            log.debug("Add cookie to store " + c.toString());
        }
        getCookies().addItem(c);
        if (SAVE_COOKIES)  {
            JMeterContext context = getThreadContext();
            if (context.isSamplingStarted()) {
                context.getVariables().put(COOKIE_NAME_PREFIX+cn, cv);
            }
        }
    }
}
 
开发者ID:botelhojp,项目名称:apache-jmeter-2.10,代码行数:26,代码来源:CookieManager.java


注:本文中的org.apache.jmeter.threads.JMeterContext.isSamplingStarted方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。