public Map<String, Object> getMonitorGraph(long testId, String targetIP, int dataInterval) {
		Map<String, Object> returnMap = Maps.newHashMap();
		File monitorDataFile = new File(config.getHome().getPerfTestReportDirectory(String.valueOf(testId)),
			MONITOR_FILE_PREFIX + targetIP + ".data");

		try (BufferedReader br = new BufferedReader(new FileReader(monitorDataFile))) {

			List<Long> userMemoryMetrics = new ArrayList<>();
			List<String> cpuUsedMetrics = new ArrayList<>();
			List<String> networkReceivedMetrics = new ArrayList<>();
			List<String> networkSentMetrics = new ArrayList<>();
			List<String> customData1Metrics = new ArrayList<>();
			List<String> customData2Metrics = new ArrayList<>();
			List<String> customData3Metrics = new ArrayList<>();
			List<String> customData4Metrics = new ArrayList<>();
			List<String> customData5Metrics = new ArrayList<>();

			br.readLine(); // skip the header.
			// "ip,system,collectTime,freeMemory,totalMemory,cpuUsedPercentage,receivedPerSec,sentPerSec"
			String line = br.readLine();
			int skipCount = dataInterval;
			// to be compatible with previous version, check the length before
			// adding
			while (StringUtils.isNotBlank(line)) {
				if (skipCount < dataInterval) {
					skipCount++;
					line = br.readLine();
				} else {
					skipCount = 0;
					String[] dataList = StringUtils.split(line, ",");
					if (NULL_STRING.equals(dataList[4]) || UNDEFINED_STRING.equals(dataList[4])) {
						userMemoryMetrics.add(null);
					} else {
						userMemoryMetrics.add(parseLong(dataList[4]) - parseLong(dataList[3]));
					}
					addCustomData(cpuUsedMetrics, 5, dataList);
					addCustomData(networkReceivedMetrics, 6, dataList);
					addCustomData(networkSentMetrics, 7, dataList);
					addCustomData(customData1Metrics, 8, dataList);
					addCustomData(customData2Metrics, 9, dataList);
					addCustomData(customData3Metrics, 10, dataList);
					addCustomData(customData4Metrics, 11, dataList);
					addCustomData(customData5Metrics, 12, dataList);
				}
			}
			returnMap.put("cpu", cpuUsedMetrics);
			returnMap.put("memory", userMemoryMetrics);
			returnMap.put("received", networkReceivedMetrics);
			returnMap.put("sent", networkSentMetrics);
			returnMap.put("customData1", customData1Metrics);
			returnMap.put("customData2", customData2Metrics);
			returnMap.put("customData3", customData3Metrics);
			returnMap.put("customData4", customData4Metrics);
			returnMap.put("customData5", customData5Metrics);
		} catch (IOException e) {
			LOGGER.info("Error while getting monitor {} data file at {}", targetIP, monitorDataFile);
		}

		return returnMap;
	}
Get system monitor data and wrap the data as a string value like "[22,11,12,34,....]", which can be used directly
in JS as a vector.

@param testId       test id
@param targetIP     ip address of the monitor target
@param dataInterval interval value to get data. Interval value "2" means, get one record for every "2" records.
@return return the data in map
ngrinder-controller/src/main/java/org/ngrinder/perftest/service/PerfTestService.java