summaryrefslogtreecommitdiffstats
path: root/ml/Query.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2022-08-12 07:26:17 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2022-08-12 07:26:17 +0000
commit7877a98bd9c00db5e81dd2f8c734cba2bab20be7 (patch)
treed18b767250f7c7ced9b8abe2ece784ac1fe24d3e /ml/Query.h
parentReleasing debian version 1.35.1-2. (diff)
downloadnetdata-7877a98bd9c00db5e81dd2f8c734cba2bab20be7.tar.xz
netdata-7877a98bd9c00db5e81dd2f8c734cba2bab20be7.zip
Merging upstream version 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() {