本文整理了Java中org.apache.jmeter.threads.JMeterContextService.getThreadCounts()
方法的一些代码示例,展示了JMeterContextService.getThreadCounts()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JMeterContextService.getThreadCounts()
方法的具体详情如下:
包路径:org.apache.jmeter.threads.JMeterContextService
类名称:JMeterContextService
方法名:getThreadCounts
暂无
代码示例来源:origin: org.apache.jmeter/ApacheJMeter_components
/**
* @return finished threads
*/
public int getFinishedThreads() {
return JMeterContextService.getThreadCounts().finishedThreads;
}
代码示例来源:origin: org.apache.jmeter/ApacheJMeter_components
/**
* @return started threads
*/
public int getStartedThreads() {
return JMeterContextService.getThreadCounts().startedThreads;
}
代码示例来源:origin: org.apache.jmeter/ApacheJMeter_components
/**
* Add a {@link SampleResult} to be used in the statistics
* @param result {@link SampleResult} not used
*/
public synchronized void add(SampleResult result) {
usersStats.addValue(JMeterContextService.getThreadCounts().activeThreads);
}
代码示例来源:origin: org.apache.jmeter/ApacheJMeter_core
sb.append(')');
if ("+".equals(type)) {
ThreadCounts tc = JMeterContextService.getThreadCounts();
sb.append(" Active: ");
sb.append(tc.activeThreads);
代码示例来源:origin: NovatecConsulting/JMeter-InfluxDB-Writer
@Override
public void teardownTest(BackendListenerContext context) throws Exception {
LOGGER.info("Shutting down influxDB scheduler...");
scheduler.shutdown();
addVirtualUsersMetrics(0, 0, 0, 0, JMeterContextService.getThreadCounts().finishedThreads);
Point endPoint = Point.measurement(TestStartEndMeasurement.MEASUREMENT_NAME).time(System.currentTimeMillis(), TimeUnit.MILLISECONDS)
.tag(TestStartEndMeasurement.Tags.TYPE, TestStartEndMeasurement.Values.FINISHED).tag(TestStartEndMeasurement.Tags.TEST_NAME, testName).build();
exportFileWriter.append(endPoint.lineProtocol());
exportFileWriter.newLine();
try {
scheduler.awaitTermination(30, TimeUnit.SECONDS);
LOGGER.info("influxDB scheduler terminated!");
} catch (InterruptedException e) {
LOGGER.error("Error waiting for end of scheduler");
}
samplersToFilter.clear();
exportFileWriter.close();
super.teardownTest(context);
}
代码示例来源:origin: NovatecConsulting/JMeter-InfluxDB-Writer
/**
* Periodically writes virtual users metrics to influxDB.
*/
public void run() {
try {
ThreadCounts tc = JMeterContextService.getThreadCounts();
addVirtualUsersMetrics(getUserMetrics().getMinActiveThreads(), getUserMetrics().getMeanActiveThreads(), getUserMetrics().getMaxActiveThreads(), tc.startedThreads, tc.finishedThreads);
} catch (Exception e) {
LOGGER.error("Failed writing to influx", e);
}
}
代码示例来源:origin: NovatecConsulting/JMeter-InfluxDB-Writer
/**
* Periodically writes virtual users metrics to influxDB.
*/
public void run() {
try {
ThreadCounts tc = JMeterContextService.getThreadCounts();
addVirtualUsersMetrics(getUserMetrics().getMinActiveThreads(), getUserMetrics().getMeanActiveThreads(), getUserMetrics().getMaxActiveThreads(), tc.startedThreads, tc.finishedThreads);
} catch (Exception e) {
LOGGER.error("Failed writing to influx", e);
}
}
代码示例来源:origin: NovatecConsulting/JMeter-InfluxDB-Writer
@Override
public void teardownTest(BackendListenerContext context) throws Exception {
LOGGER.info("Shutting down influxDB scheduler...");
scheduler.shutdown();
addVirtualUsersMetrics(0,0,0,0,JMeterContextService.getThreadCounts().finishedThreads);
influxDB.write(
influxDBConfig.getInfluxDatabase(),
influxDBConfig.getInfluxRetentionPolicy(),
Point.measurement(TestStartEndMeasurement.MEASUREMENT_NAME).time(System.currentTimeMillis(), TimeUnit.MILLISECONDS)
.tag(TestStartEndMeasurement.Tags.TYPE, TestStartEndMeasurement.Values.FINISHED)
.tag(TestStartEndMeasurement.Tags.NODE_NAME, nodeName)
.tag(TestStartEndMeasurement.Tags.RUN_ID, runId)
.tag(TestStartEndMeasurement.Tags.TEST_NAME, testName)
.addField(TestStartEndMeasurement.Fields.PLACEHOLDER,"1")
.build());
influxDB.disableBatch();
try {
scheduler.awaitTermination(30, TimeUnit.SECONDS);
LOGGER.info("influxDB scheduler terminated!");
} catch (InterruptedException e) {
LOGGER.error("Error waiting for end of scheduler");
}
samplersToFilter.clear();
super.teardownTest(context);
}
内容来源于网络,如有侵权,请联系作者删除!