Fix timeseries pruning
This commit is contained in:
parent
77e987bccc
commit
4575628d99
1 changed files with 2 additions and 1 deletions
|
@ -27,11 +27,12 @@ void timeseries_prune(timeseries_t *ts, uint64_t duration)
|
|||
|
||||
uint64_t new_tstart = ts->tend - duration;
|
||||
|
||||
while(iter != ts->data.end() && iter->second < new_tstart) {
|
||||
while(iter != ts->data.end() && iter->first < new_tstart) {
|
||||
iter = ts->data.erase(iter);
|
||||
}
|
||||
|
||||
if(iter != ts->data.end()) {
|
||||
// iter now points to the first entry in the list
|
||||
ts->tstart = iter->first;
|
||||
} else {
|
||||
ts->tstart = ts->tend;
|
||||
|
|
Loading…
Add table
Reference in a new issue