@Test public void testNormalizesSpace() { AtomicLong leading = Stats.exportLong(" leading space"); AtomicLong trailing = Stats.exportLong("trailing space "); AtomicLong surround = Stats.exportLong(" surround space "); leading.incrementAndGet(); trailing.incrementAndGet(); surround.incrementAndGet(); assertCounter("__leading_space", 1); assertCounter("trailing_space___", 1); assertCounter("___surround_space___", 1); }
public static AtomicLong exportLong(String name) { final AtomicLong longVar = new AtomicLong(0L); export(new StatImpl<Long>(name) { @Override public Long read() { return longVar.get(); } }); return longVar; }
Stats { public static AtomicLong exportLong(String name) { final AtomicLong longVar = new AtomicLong(0L); export(new StatImpl<Long>(name) { @Override public Long read() { return longVar.get(); } }); return longVar; } }
Stats { public static AtomicLong exportLong(String name) { final AtomicLong longVar = new AtomicLong(0L); export(new StatImpl<Long>(name) { @Override public Long read() { return longVar.get(); } }); return longVar; }  }
Stats { public static AtomicLong exportLong(String name) { final AtomicLong longVar = new AtomicLong(0L); export(new StatImpl<Long>(name) { @Override public Long read() { return longVar.get(); } }); return longVar; }  static String normalizeName(String name); static Stat<T> export(Stat<T> var); static AtomicInteger exportInt(final String name); static AtomicLong exportLong(String name); static Iterable<Stat<?>> getVariables(); @VisibleForTesting static void flush(); @VisibleForTesting static Stat<T> getVariable(String name); }
Stats { public static AtomicLong exportLong(String name) { final AtomicLong longVar = new AtomicLong(0L); export(new StatImpl<Long>(name) { @Override public Long read() { return longVar.get(); } }); return longVar; }  static String normalizeName(String name); static Stat<T> export(Stat<T> var); static AtomicInteger exportInt(final String name); static AtomicLong exportLong(String name); static Iterable<Stat<?>> getVariables(); @VisibleForTesting static void flush(); @VisibleForTesting static Stat<T> getVariable(String name); static final StatsProvider STATS_PROVIDER; static final StatRegistry STAT_REGISTRY; }