keepLastValue behaviour
Hi,
Let consider this series stored in DB: 10, 20, None, 40, 50, None, None, None, None, None, 110
When Calling keepLastValue(3), then I would expect the following series as a result:
10, 20, 20, 40, 50, 50, 50, None, None, None, 110
or:
10, 20, 20, 40, 50, 50, 50, 50, None, None, 110
(depending on if the "last value" is included in the count).
But current behaviour is to return:
10, 20, 20, 40, 50, None, None, None, None, None, 110
i.e. no value is repeated after 50 since the number of consecutiveNones between value 50 and value 110 is greater than the provided limit (5>3).
So, from the documentation, I would expect the keepLastValue function to behave like this:
----
def keepLastValue(
for series in seriesList:
series.name = "keepLastValue(%s)" % (series.name)
series.
consecutive
last = None
for i,value in enumerate(series):
#series[i] = value
if value is None:
if last is None:
continue
if 0 < consecutiveNones < limit:
series[i] = last
else:
last = value
return seriesList
----
If it is not the expected behaviour, then this is a behaviour I am looking for from Graphite so it would be nice to add a function for this (something like "repeatLastValu
Cheers,
Fabien
Question information
- Language:
- English Edit question
- Status:
- Expired
- For:
- Graphite Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply: