how to calculate derivative in druid

165 views
Skip to first unread message

Song Yu

unread,
Sep 7, 2018, 1:04:22 PM9/7/18
to Druid User
Hi guys,

I have a metric of total_cpu_time ingested to druid. But it's a accumulated value, I want to calculate the cpu_usage which will be calculating derivative of two records (total_cpu_time1 - total_cpu_time2) /(time1-time2)
do you have any idea how can I implement this post-aggregation function?

thanks,

song

Eyal Yurman

unread,
Sep 12, 2018, 3:44:00 PM9/12/18
to Druid User
Hi Song,

Have you considered looking at AVG(total_cpu_time) per time granularity?
Example for getting an average using post aggregators: http://druid.io/docs/latest/querying/post-aggregations.html#example-usage
Reply all
Reply to author
Forward
0 new messages