@Override public void teardownTest(BackendListenerContext context) throws Exception { boolean cancelState = timerHandle.cancel(false); log.debug("Canceled state: {}", cancelState); scheduler.shutdown(); try { scheduler.awaitTermination(30, TimeUnit.SECONDS); } catch (InterruptedException e) { log.error("Error waiting for end of scheduler"); Thread.currentThread().interrupt(); } // Send last set of data before ending sendMetrics(); if (samplersToFilter != null) { samplersToFilter.clear(); } graphiteMetricsManager.destroy(); super.teardownTest(context); }
@Override public void teardownTest(BackendListenerContext context) throws Exception { boolean cancelState = timerHandle.cancel(false); log.debug("Canceled state: {}", cancelState); scheduler.shutdown(); try { scheduler.awaitTermination(30, TimeUnit.SECONDS); } catch (InterruptedException e) { log.error("Error waiting for end of scheduler"); Thread.currentThread().interrupt(); } addAnnotation(false); // Send last set of data before ending log.info("Sending last metrics"); sendMetrics(); influxdbMetricsManager.destroy(); super.teardownTest(context); }
@Override public void teardownTest(BackendListenerContext context) throws Exception { if(this.sender.getListSize() > 0) { this.sender.sendRequest(); } this.sender.closeConnection(); super.teardownTest(context); }
@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); }
@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); }