private Measurement createSimpleMeasurement(String name, double value) { final Map<String, String> tags = new HashMap<>(1); tags.put("host", globalConfiguration.hostname); tags.put("systemName", globalConfiguration.systemName); final Map<String, String> fields = new HashMap<>(); return Measurement.createSimple(name, value, System.currentTimeMillis(), TimeUnit.MILLISECONDS, tags, fields); }
private Measurement createMeasurement(final String service, final double value) { final Map<String, String> tags = new HashMap<>(2); tags.put("host", globalConfiguration.hostname); tags.put("systemName", globalConfiguration.systemName); return Measurement.createSimple(service, value, System.currentTimeMillis(), TimeUnit.MILLISECONDS, tags, new HashMap<String, String>()); }
private Measurement createMeasurement(long numberOfUnreachableNode) { final Map<String, String> tags = new HashMap<>(1); tags.put("host", globalConfiguration.hostname); tags.put("systemName", globalConfiguration.systemName); final Map<String, String> fields = new HashMap<>(); return Measurement.createSimple(DEFAULT_NUMBER_OF_UNREACHABLE_NODES_MEASUREMENT_NAME, (double) numberOfUnreachableNode, System.currentTimeMillis(), TimeUnit.MILLISECONDS, tags, fields); }
private Measurement createMeasurement() { final Map<String, String> tags = new HashMap<>(1); tags.put("host", globalConfiguration.hostname); tags.put("systemName", globalConfiguration.systemName); Measurement measurement = Measurement .createSimple(service, 1.0, System.currentTimeMillis(), TimeUnit.MILLISECONDS, tags, new HashMap<String, String>()); return measurement; } }
private Measurement createMeasurement(String service, String statementType, String consistencyLevel, double rate) { final Map<String, String> tags = new HashMap<>(1); tags.put("host", globalConfiguration.hostname); tags.put("systemName", globalConfiguration.systemName); tags.put("statementType", statementType); tags.put("consistencyLevel", consistencyLevel); return Measurement.createSimple(service, rate, System.currentTimeMillis(), TimeUnit.MILLISECONDS, tags, new HashMap<String, String>()); } }
private Measurement createSlowQueryCountMeasurement(double count, StatementType statementType) { final Map<String, String> tags = new HashMap<>(2); tags.put("host", globalConfiguration.hostname); tags.put("systemName", globalConfiguration.systemName); tags.put("statementType", statementType.toString()); return Measurement.createSimple(slowQueryCountMeasurementName, count, System.currentTimeMillis(), TimeUnit.MILLISECONDS, tags, new HashMap<String, String>()); } }
fields.put("consistencyLevel", query.consistencyLevel().name()); final Measurement measurement = Measurement.createSimple(service, (double) query.executionTimeInMilliseconds(), query.startTimeInMilliseconds(), TimeUnit.MILLISECONDS, tags, fields);