作者:BBCong | 来源:互联网 | 2023-10-17 20:11
Hi .
I'm trying to get summarize from 00:00 ot first day of this month a metric, I'm working on spain and I've configured my timezone in /opt/graphite/webapp/graphite/local_settings.py
1 2
| # needs to be explicitly set to your local timezone.
TIME_ZONE = 'Europe/Madrid' |
I did this query.
1
| http://graphite/render?format=json&from=4/01/2015&until=-&target=summarize(my.system.cpu.percent-active,'1day','avg') |
And I got that
[{"target": "summarize(my.system.cpu.percent-active, \"1day\", \"avg\")", "datapoints": [[49.497208009728958, 1427846400], [37.077833077777775, 1427932800], [42.021989086805604, 1428019200], [49.25920844236115, 1428105600], [63.997593792361165, 1428192000], [81.546292237499998, 1428278400], [73.984663305555543, 1428364800], [73.646580338888811, 1428451200], [48.208400477083359, 1428537600], [38.049111687500016, 1428624000], [32.406861394444419, 1428710400], [32.73222370000007, 1428796800], [34.046655264583308, 1428883200], [34.440842520138879, 1428969600], [60.00367210694445, 1429056000], [87.657549924305584, 1429142400], [75.007352623225813, 1429228800]]}]
If I do tranlation for this timestamps to my current location summarize function seems to align to Standard Time +0000 UTC , and not my local Timezone as I would want
该提问来源于开源项目:graphite-project/graphite-web
According to documentation "The alignToFrom boolean parameter has been replaced by alignTo and no longer has any effect. Alignment can be to years, months, weeks, days, hours, and minutes."
So, smartSummarize(seriesList, intervalString, func='sum', alignTo='day') should work fine with timezones.