@Test public void testPerf() { String testPoints = "cpu,host=server01,region=uswest value=1i 1434055562000000000\ncpu,host=server01,region=uswest value=1i 1434055562000000000\ncpu,host=server01,region=uswest value=1i 1434055562000000000\ncpu,host=server01,region=uswest value=1i 1434055562000000000\ncpu,host=server01,region=uswest value=1i 1434055562000000000"; for (int i = 0; i < 100000; i++) { InfluxDecoder.pointsFromString("test", testPoints); } }
public static List<Point> pointsFromString(String dbName, String payload) { List<Point> dps = new ArrayList<>(); try { Iterable<String> splits = lineFromPayLoad(payload); for (String split : splits) { Builder builder = pointFromLine(Point.newBuilder(), dbName, split); if (builder != null) { Point point = builder.build(); dps.add(point); } } } catch (Exception e) { e.printStackTrace(); logger.fine("Rejected:" + payload); } return dps; }
InfluxDecoder { public static List<Point> pointsFromString(String dbName, String payload) { List<Point> dps = new ArrayList<>(); try { Iterable<String> splits = lineFromPayLoad(payload); for (String split : splits) { Builder builder = pointFromLine(Point.newBuilder(), dbName, split); if (builder != null) { Point point = builder.build(); dps.add(point); } } } catch (Exception e) { e.printStackTrace(); logger.fine("Rejected:" + payload); } return dps; } }
InfluxDecoder { public static List<Point> pointsFromString(String dbName, String payload) { List<Point> dps = new ArrayList<>(); try { Iterable<String> splits = lineFromPayLoad(payload); for (String split : splits) { Builder builder = pointFromLine(Point.newBuilder(), dbName, split); if (builder != null) { Point point = builder.build(); dps.add(point); } } } catch (Exception e) { e.printStackTrace(); logger.fine("Rejected:" + payload); } return dps; }  }
InfluxDecoder { public static List<Point> pointsFromString(String dbName, String payload) { List<Point> dps = new ArrayList<>(); try { Iterable<String> splits = lineFromPayLoad(payload); for (String split : splits) { Builder builder = pointFromLine(Point.newBuilder(), dbName, split); if (builder != null) { Point point = builder.build(); dps.add(point); } } } catch (Exception e) { e.printStackTrace(); logger.fine("Rejected:" + payload); } return dps; }  static List<String> lineFromPayLoad(String payload); static List<Point> pointsFromString(String dbName, String payload); static Point.Builder pointFromLine(Point.Builder builder, String dbName, String line); }
InfluxDecoder { public static List<Point> pointsFromString(String dbName, String payload) { List<Point> dps = new ArrayList<>(); try { Iterable<String> splits = lineFromPayLoad(payload); for (String split : splits) { Builder builder = pointFromLine(Point.newBuilder(), dbName, split); if (builder != null) { Point point = builder.build(); dps.add(point); } } } catch (Exception e) { e.printStackTrace(); logger.fine("Rejected:" + payload); } return dps; }  static List<String> lineFromPayLoad(String payload); static List<Point> pointsFromString(String dbName, String payload); static Point.Builder pointFromLine(Point.Builder builder, String dbName, String line);  }