Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

avoid id mapping for aggregate functions #1118

Merged
merged 1 commit into from
Mar 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.slf4j.LoggerFactory;

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
Expand Down Expand Up @@ -172,8 +173,13 @@ public EvalPayload eval(long timestamp) {
consolidator.update(timestamp, Double.NaN);
final double v = consolidator.value(timestamp);
if (!Double.isNaN(v)) {
Map<String, String> tags = idMapper.apply(entry.getKey());
tags.putAll(commonTags);
Map<String, String> tags = Collections.emptyMap();
if (!(expr instanceof DataExpr.AggregateFunction)) {
// Aggregation functions only use tags based on the expression. Avoid overhead of
// considering the tags for the data.
tags = idMapper.apply(entry.getKey());
tags.putAll(commonTags);
}
if (delayGaugeAggr && consolidator.isGauge()) {
// When performing a group by, datapoints missing tag used for the grouping
// should be ignored
Expand Down
Loading