graphite summarize datapoints

Deadly 提交于 2019-12-03 10:52:38

The problem here is that summarize doesn't align to the from field by default.

summarize(seriesList, intervalString, func='sum', alignToFrom=False)

If you do

from=-1w&target=summarize(stats.events.login.success,"1w","sum",true)&format=json

you should get just one datapoint. What it's doing right now is aligning your buckets to dates that don't fit within the week range starting from your from parameter, so you end up with 2 buckets. From the graphite docs on summarize:

By default, buckets are caculated by rounding to the nearest interval. This works well for intervals smaller than a day. For example, 22:32 will end up in the bucket 22:00-23:00 when the interval=1hour.

Passing alignToFrom=true will instead create buckets starting at the from time. In this case, the bucket for 22:32 depends on the from time. If from=6:30 then the 1hour bucket for 22:32 is 22:30-23:30.

So for me it divides the week on Wednesday and the month on the 15th, 16th or 17th. Additionally mine seems to be ignoring the alignToFrom value. Co-worker had the idea that maybe it's based on the install date or when the whispher db is first instantiated. Where I can believe that may be the case for day of the week, I doubt we both installed things mid month.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!