samza-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeremiah Adams <>
Subject Re: How to Report Timer Snapshot via Snapshot Reporter
Date Wed, 05 Jul 2017 15:54:42 GMT
I've opened a ticket here:

I'll need direction on what is expected for the jira ticket. I am interested in contributing,
depending upon the scope and size of work. Also, seems that number 3 would be the preference.
Are 1 and 3 separate tasks? If not it seems better to implement the Histogram?

Jeremiah Adams
Software Engineer
Blog | Twitter | Facebook | LinkedIn

From: Jagadish Venkatraman <>
Sent: Friday, June 30, 2017 9:08 AM
Subject: Re: How to Report Timer Snapshot via Snapshot Reporter

Hey Jeremiah,

Here's how metrics reporting works:

1. Metrics like (gauges , timers, counters) are registered and created with
a "registry".
2. Metrics are then incremented / set based on business logic.
3. Metrics are reported using "reporters".

I see 3 alternatives:

1. You can contribute the patch to the existing *Metrics**Snapshot*
*Reporter* that also reports these 2 additional statistics and we can merge
it in. Can you please help create a JIRA for it?

2. You can write and configure a custom *MetricsReporter. *It should be
easy to emulate the existing *Metrics**Snapshot**Reporter* class but modify
it and report other statistics.

3. Long term, we want to define a new metric type called *Histogram* that
enables you to get and report p99s, p95s, min, max and averages.

Let me know if you're interested in contributing!

If it helps, Here's the line you'll change for option [1] and [2]:

def timer(timer: Timer) = groupMsg.put(name,
timer.getSnapshot().getAverage(): java.lang.Double)


On Fri, Jun 30, 2017 at 7:35 AM, Jeremiah Adams <>

> I am using the Snapshot Metrics Reporter and a samza.metrics.timer to
> instrument code blocks. The metrics are sent to a kafka topic via the
> metrics reporter.
> I can see the value of the timer in the topic ({"timerName":12.3}). I
> would like to get the entire snapshot (timer.getSnapshot()) so I can see
> min, max and avg values for the timer. How do I get the snapshot sent to
> the metrics topic?
> Currently I am:
> 1 - getting the start time of the block,
> 2 - executing the block
> 3 - getting the end time of the block
> 4 - using duration to get the milliseconds
> 5 - passing the milliseconds into timer.update()
> Jeremiah Adams
> Software Engineer
> Blog<>
| Twitter<
> HelixEducation> | Facebook<>
> LinkedIn<>

Jagadish V,
Graduate Student,
Department of Computer Science,
Stanford University

View raw message