summaryrefslogtreecommitdiffstats
path: root/ml/Query.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2022-08-12 07:26:11 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2022-08-12 07:26:11 +0000
commit3c315f0fff93aa072472abc10815963ac0035268 (patch)
treea95f6a96e0e7bd139c010f8dc60b40e5b3062a99 /ml/Query.h
parentAdding upstream version 1.35.1. (diff)
downloadnetdata-3c315f0fff93aa072472abc10815963ac0035268.tar.xz
netdata-3c315f0fff93aa072472abc10815963ac0035268.zip
Adding upstream version 1.36.0.upstream/1.36.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
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() {