private static void serializeCounter(DataOutput out, QueryScopeInfo info, String name, Counter counter) throws IOException { long count = counter.getCount(); serializeMetricInfo(out, info); out.writeUTF(name); out.writeLong(count); }
private static MetricDump.CounterDump deserializeCounter(DataInputView dis) throws IOException { QueryScopeInfo scope = deserializeMetricInfo(dis); String name = dis.readUTF(); long count = dis.readLong(); return new MetricDump.CounterDump(scope, name, count); }
private static MetricDump.GaugeDump deserializeGauge(DataInputView dis) throws IOException { QueryScopeInfo scope = deserializeMetricInfo(dis); String name = dis.readUTF(); String value = dis.readUTF(); return new MetricDump.GaugeDump(scope, name, value); }
private static void serializeCounter(DataOutput out, QueryScopeInfo info, String name, Counter counter) throws IOException { long count = counter.getCount(); serializeMetricInfo(out, info); out.writeUTF(name); out.writeLong(count); }
private static MetricDump.CounterDump deserializeCounter(DataInputView dis) throws IOException { QueryScopeInfo scope = deserializeMetricInfo(dis); String name = dis.readUTF(); long count = dis.readLong(); return new MetricDump.CounterDump(scope, name, count); }
private static void serializeGauge(DataOutput out, QueryScopeInfo info, String name, Gauge<?> gauge) throws IOException { Object value = gauge.getValue(); if (value == null) { throw new NullPointerException("Value returned by gauge " + name + " was null."); } String stringValue = value.toString(); if (stringValue == null) { throw new NullPointerException("toString() of the value returned by gauge " + name + " returned null."); } serializeMetricInfo(out, info); out.writeUTF(name); out.writeUTF(stringValue); }
private static MetricDump.GaugeDump deserializeGauge(DataInputView dis) throws IOException { QueryScopeInfo scope = deserializeMetricInfo(dis); String name = dis.readUTF(); String value = dis.readUTF(); return new MetricDump.GaugeDump(scope, name, value); }
private static void serializeMeter(DataOutput out, QueryScopeInfo info, String name, Meter meter) throws IOException { serializeMetricInfo(out, info); out.writeUTF(name); out.writeDouble(meter.getRate()); }
private static MetricDump.GaugeDump deserializeGauge(DataInputView dis) throws IOException { QueryScopeInfo scope = deserializeMetricInfo(dis); String name = dis.readUTF(); String value = dis.readUTF(); return new MetricDump.GaugeDump(scope, name, value); }
private static void serializeCounter(DataOutput out, QueryScopeInfo info, String name, Counter counter) throws IOException { long count = counter.getCount(); serializeMetricInfo(out, info); out.writeUTF(name); out.writeLong(count); }
private static MetricDump.MeterDump deserializeMeter(DataInputView dis) throws IOException { QueryScopeInfo info = deserializeMetricInfo(dis); String name = dis.readUTF(); double rate = dis.readDouble(); return new MetricDump.MeterDump(info, name, rate); }
private static void serializeMeter(DataOutput out, QueryScopeInfo info, String name, Meter meter) throws IOException { serializeMetricInfo(out, info); out.writeUTF(name); out.writeDouble(meter.getRate()); }
private static MetricDump.MeterDump deserializeMeter(DataInputView dis) throws IOException { QueryScopeInfo info = deserializeMetricInfo(dis); String name = dis.readUTF(); double rate = dis.readDouble(); return new MetricDump.MeterDump(info, name, rate); }
private static void serializeMeter(DataOutput out, QueryScopeInfo info, String name, Meter meter) throws IOException { serializeMetricInfo(out, info); out.writeUTF(name); out.writeDouble(meter.getRate()); }
private static MetricDump.GaugeDump deserializeGauge(DataInputView dis) throws IOException { QueryScopeInfo scope = deserializeMetricInfo(dis); String name = dis.readUTF(); String value = dis.readUTF(); return new MetricDump.GaugeDump(scope, name, value); }
private static void serializeCounter(DataOutput out, QueryScopeInfo info, String name, Counter counter) throws IOException { long count = counter.getCount(); serializeMetricInfo(out, info); out.writeUTF(name); out.writeLong(count); }
private static MetricDump.MeterDump deserializeMeter(DataInputView dis) throws IOException { QueryScopeInfo info = deserializeMetricInfo(dis); String name = dis.readUTF(); double rate = dis.readDouble(); return new MetricDump.MeterDump(info, name, rate); }
private static void serializeGauge(DataOutput out, QueryScopeInfo info, String name, Gauge<?> gauge) throws IOException { Object value = gauge.getValue(); if (value == null) { throw new NullPointerException("Value returned by gauge " + name + " was null."); } String stringValue = value.toString(); if (stringValue == null) { throw new NullPointerException("toString() of the value returned by gauge " + name + " returned null."); } serializeMetricInfo(out, info); out.writeUTF(name); out.writeUTF(stringValue); }
private static MetricDump.MeterDump deserializeMeter(DataInputView dis) throws IOException { QueryScopeInfo info = deserializeMetricInfo(dis); String name = dis.readUTF(); double rate = dis.readDouble(); return new MetricDump.MeterDump(info, name, rate); }
private static void serializeMeter(DataOutput out, QueryScopeInfo info, String name, Meter meter) throws IOException { serializeMetricInfo(out, info); out.writeUTF(name); out.writeDouble(meter.getRate()); }