@Override
	public void startSampling(final ISingleConsole singleConsole, PerfTest perfTest,
	                          IPerfTestService perfTestService) {
		final List<String> targetHostIP = perfTest.getTargetHostIP();
		final Integer samplingInterval = perfTest.getSamplingInterval();
		for (final String target : targetHostIP) {
			scheduledTaskService.runAsync(() -> {
				LOGGER.info(format(perfTest, "Start JVM monitoring for IP:{}", target));
				MonitorClientService client = new MonitorClientService(target, MonitorCollectorPlugin.this.port);
				client.init();
				if (client.isConnected()) {
					File testReportDir = singleConsole.getReportPath();
					File dataFile = null;
					BufferedWriter bw;
					try {
						dataFile = new File(testReportDir, MONITOR_FILE_PREFIX + target + ".data");
						bw = new BufferedWriter(new FileWriter(dataFile, false));
						// write header info
						bw.write(SystemInfo.HEADER);
						bw.newLine();
						bw.flush();
						clientMap.put(client, bw);
					} catch (IOException e) {
						LOGGER.error(format(perfTest, "Error to write to file: {}, Error: {}", dataFile.getPath(), e.getMessage()));
					}
				}
			});
		}
		assignScheduledTask(samplingInterval);
	}
Constructor.

@param config               config
@param scheduledTaskService scheduling service to run monitor task
ngrinder-controller/src/main/java/org/ngrinder/perftest/service/samplinglistener/MonitorCollectorPlugin.java