@Override public void increment(String label, int delta, String topic) { Stats.incr(label, delta); }
@Override public void increment(String label, String topic) { Stats.incr(label); }
public static void incr(String name) { Stats.incr(name); }
@Test public void incrementByOne() throws Exception { metricCollector.increment("expectedLabel", "ignored"); PowerMockito.verifyStatic(); Stats.incr("expectedLabel"); }
@Test public void increment() throws Exception { metricCollector.increment("expectedLabel", 42, "ignored"); PowerMockito.verifyStatic(); Stats.incr("expectedLabel", 42); }
public static void incr(String name) { Stats.incr(name); }
public static void incr(String name) { Stats.incr(name); }
public void removeZkNode(String path) throws Exception { try { curator.delete().forPath(path); } catch (Exception e) { LOG.error("Failed to remove zk node {}", path); Stats.incr("merced.zookeeper.failure.remove_zknode"); throw e; } }
public static void incr(String name, int i, String... tags) { Stats.incr(nameMetric(name, tags), i); }
public static void incr(String name, String... tags) { Stats.incr(nameMetric(name, tags)); }
public static void incr(String name, int i, String... tags) { Stats.incr(nameMetric(name, tags), i); }
@Override public BoxedUnit apply(Void aVoid) { Stats.incr(request.getQueueName() + "_checkpoint", request.getRequestsSize()); return null; } }).rescue(new LogAndWrapException<Void>(
@Override public BoxedUnit apply(PinLaterEnqueueResponse response) { Stats.incr(request.getQueueName() + "_enqueue", request.getJobsSize()); return null; } }).rescue(new LogAndWrapException<PinLaterEnqueueResponse>(
@Override public BoxedUnit apply(PinLaterDequeueResponse response) { Stats.incr(request.getQueueName() + "_dequeue", response.getJobsSize()); return null; } }).rescue(new LogAndWrapException<PinLaterDequeueResponse>(
public OperationStats(String methodName, String statsName, Map<String, String> tags) { this.methodName = methodName; this.statsName = statsName; this.tags = tags; Stats.incr(StatsUtil.getStatsName(methodName, statsName, tags)); watch = new StopWatch(); watch.start(); }
public void succeed(Map<String, String> additionalTags) { this.watch.stop(); if (tags == null) { this.tags = additionalTags; } else { this.tags.putAll(additionalTags); } Stats .incr(StatsUtil .getStatsName(this.methodName, this.statsName, StatsUtil.StatsType.SUCCESS, tags)); Stats.addMetric( StatsUtil.getStatsName(this.methodName, this.statsName, StatsUtil.StatsType.TIME, tags), (int) watch.getTime()); }
public void failed() { this.watch.stop(); Stats .incr(StatsUtil .getStatsName(this.methodName, this.statsName, StatsUtil.StatsType.FAILURE, tags)); Stats.addMetric( StatsUtil.getStatsName(this.methodName, this.statsName, StatsUtil.StatsType.TIME, tags), (int) watch.getTime()); }
public void succeed() { this.watch.stop(); Stats .incr(StatsUtil .getStatsName(this.methodName, this.statsName, StatsUtil.StatsType.SUCCESS, tags)); Stats.addMetric( StatsUtil.getStatsName(this.methodName, this.statsName, StatsUtil.StatsType.TIME, tags), (int) watch.getTime()); }
public Future<Foo> giveMeSomeFoo(int id) { Stats.incr("number_of_foo_calls"); // Report stats to Ostrich // Domain objects are immutable. They come with constructors and builders. Foo foo = new Foo.Builder() .bar("test") .bazz("hey, this is a response from " + bazz) .squirrel(42) .build(); // Finagle is async, so wrap the return value in a Future // if the implementation is synchronous return Future.value(foo); } }