How to produce the same bar chart using the lowest common denominator retention granularity?

Hello!

I’ve got some data in graphite going back a year. The retentions are set as follows:

retentions: '1m:3d,10m:60d,30m:180d,1h:3y'

And the aggregation method maybe sub-optimal and set as:

aggregationMethod: 'average'

I’m creating a stacked bar chart of CPU usage per day using the following formula:

sortByTotal(summarize(#B, '1d', 'sum', true))

This works great and I get the bar chart I’m expecting, except for one thing:

Let’s say I’m looking at 26th-Oct. If I create a stacked bar chart for the entire year then it gives me one set of CPU totals for 26th-Oct. But if I create a stacked bar chart for only 7 days around 26-Oct then I get a completely different set of CPU totals for the same day.

AFAIK this maybe because of the aggregation method used above. Presumably if it was different then it would be possible to arrive at the same totals?

Anyway, let’s assume I just want to work with the existing data and how it has been aggregated:

I’m assuming that the yearly graph comes to a different result because it uses the lowest common denominator retention granularity for the entire, much longer period. And therefore, even though 26th-Oct is very recent, it gets sampled as if it was a year old, to match all the other data?

Likewise, if creating a 7 day stacked bar chart graph around 26th-Oct then the lowest common denominator retention granularity – for that period – is much different, and so the totals get much bigger for the day.

Now to the question: How can I much the 7 day stacked bar chart use the same retention granularity as the yearly stack bar chart, so that the totals for 26-Oct match for both graphs?

Thanks in advance!