summaryrefslogtreecommitdiffstats
path: root/ml/Query.h
diff options
context:
space:
mode:
Diffstat (limited to 'ml/Query.h')
-rw-r--r--ml/Query.h15
1 files changed, 7 insertions, 8 deletions
diff --git a/ml/Query.h b/ml/Query.h
index 8b84bb73e..24c5fa384 100644
--- a/ml/Query.h
+++ b/ml/Query.h
@@ -8,29 +8,28 @@ namespace ml {
class Query {
public:
Query(RRDDIM *RD) : RD(RD) {
- Ops = &RD->state->query_ops;
+ Ops = &RD->tiers[0]->query_ops;
}
time_t latestTime() {
- return Ops->latest_time(RD);
+ return Ops->latest_time(RD->tiers[0]->db_metric_handle);
}
time_t oldestTime() {
- return Ops->oldest_time(RD);
+ return Ops->oldest_time(RD->tiers[0]->db_metric_handle);
}
void init(time_t AfterT, time_t BeforeT) {
- Ops->init(RD, &Handle, AfterT, BeforeT);
+ Ops->init(RD->tiers[0]->db_metric_handle, &Handle, AfterT, BeforeT, TIER_QUERY_FETCH_SUM);
}
bool isFinished() {
return Ops->is_finished(&Handle);
}
- std::pair<time_t, storage_number> nextMetric() {
- time_t CurrT;
- storage_number SN = Ops->next_metric(&Handle, &CurrT);
- return { CurrT, SN };
+ std::pair<time_t, CalculatedNumber> nextMetric() {
+ STORAGE_POINT sp = Ops->next_metric(&Handle);
+ return { sp.start_time, sp.sum / sp.count };
}
~Query() {