I've opened a ticket here: https://issues.apache.org/jira/browse/SAMZA-1357
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 www.helixeducation.com Blog | Twitter | Facebook | LinkedIn ________________________________________ From: Jagadish Venkatraman <jagadish1...@gmail.com> Sent: Friday, June 30, 2017 9:08 AM To: dev@samza.apache.org 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) Thanks, Jagadish On Fri, Jun 30, 2017 at 7:35 AM, Jeremiah Adams <jad...@helixeducation.com> wrote: > 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 > https://url.serverdata.net/?ahfhEufaAWbezBrUFPG98ZJcterGfIerU3ZwsA3Gv_C0~<https://url.serverdata.net/?a49H2rNGIIBtQOw6md8OcHp-qKE3Xn2gNiZ3dlqAeSDA~> > Blog<https://url.serverdata.net/?a49H2rNGIIBtQOw6md8OcHgFEZu-KYuiu8doY66NWwmmyWxz7kC-27Yfnbdgd2wyh5gjXUa6LMT_NRXsj1g1VVg~~> > | > Twitter<https://url.serverdata.net/?a0Q7ct5_6cOdbJ86kpWB0zwnjt5JsoFoNU2KX2AeBPVE~ > HelixEducation> | > Facebook<https://url.serverdata.net/?aAmyAO_nS_C1aDgBLeKyGTu0tksTt1_mn2PcS8KJXNJPM04iRHKgX96qGgENV-dMSER5wl8zDVRr3RsS0OmcF9A~~> > | > LinkedIn<https://url.serverdata.net/?aanlcNI-cN74Gdz-TD332xAl6lHu7TRNICWoHUFjYf-KlBjrCGHoYR65b3rl-OyW10nWFv6hwYvUSoVHL4b3vGA~~> > -- Jagadish V, Graduate Student, Department of Computer Science, Stanford University