@Test public void testLoadCsv() throws Exception { val metric = new MetricDefinition(new TagCollection(new HashMap<String, String>() {{ put("unit", "dummy"); put("mtype", "dummy"); }})); val is = ClassLoader.getSystemResourceAsStream(DATA_FILENAME); val frame = MetricFrameLoader.loadCsv(metric, is, true); assertNotNull(frame); assertTrue(frame.getNumRows() > 0); assertEquals(0.0, frame.getMetricDataPoint(0).getValue(), TOLERANCE); assertEquals(3.0, frame.getMetricDataPoint(15).getValue(), TOLERANCE); }
public static MetricFrame loadCsv(File metricDefFile, File metricDataFile, boolean hasHeader) throws IOException { val metricDef = OBJECT_MAPPER.readValue(metricDefFile, MetricDefinition.class); FileInputStream fileInputStream = new FileInputStream(metricDataFile); try { return loadCsv(metricDef, fileInputStream, hasHeader); } finally { if (fileInputStream != null) { safeClose(fileInputStream); } } }
MetricFrameLoader { public static MetricFrame loadCsv(File metricDefFile, File metricDataFile, boolean hasHeader) throws IOException { val metricDef = OBJECT_MAPPER.readValue(metricDefFile, MetricDefinition.class); FileInputStream fileInputStream = new FileInputStream(metricDataFile); try { return loadCsv(metricDef, fileInputStream, hasHeader); } finally { if (fileInputStream != null) { safeClose(fileInputStream); } } } }
MetricFrameLoader { public static MetricFrame loadCsv(File metricDefFile, File metricDataFile, boolean hasHeader) throws IOException { val metricDef = OBJECT_MAPPER.readValue(metricDefFile, MetricDefinition.class); FileInputStream fileInputStream = new FileInputStream(metricDataFile); try { return loadCsv(metricDef, fileInputStream, hasHeader); } finally { if (fileInputStream != null) { safeClose(fileInputStream); } } }  }
MetricFrameLoader { public static MetricFrame loadCsv(File metricDefFile, File metricDataFile, boolean hasHeader) throws IOException { val metricDef = OBJECT_MAPPER.readValue(metricDefFile, MetricDefinition.class); FileInputStream fileInputStream = new FileInputStream(metricDataFile); try { return loadCsv(metricDef, fileInputStream, hasHeader); } finally { if (fileInputStream != null) { safeClose(fileInputStream); } } }  static MetricFrame loadCsv(File metricDefFile, File metricDataFile, boolean hasHeader); static MetricFrame loadCsv(MetricDefinition metricDef, InputStream in, boolean hasHeader); }
MetricFrameLoader { public static MetricFrame loadCsv(File metricDefFile, File metricDataFile, boolean hasHeader) throws IOException { val metricDef = OBJECT_MAPPER.readValue(metricDefFile, MetricDefinition.class); FileInputStream fileInputStream = new FileInputStream(metricDataFile); try { return loadCsv(metricDef, fileInputStream, hasHeader); } finally { if (fileInputStream != null) { safeClose(fileInputStream); } } }  static MetricFrame loadCsv(File metricDefFile, File metricDataFile, boolean hasHeader); static MetricFrame loadCsv(MetricDefinition metricDef, InputStream in, boolean hasHeader);  }