Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Signed-off-by: Krishna Kondaka <[email protected]>
Co-authored-by: Krishna Kondaka <[email protected]>
(cherry picked from commit 542b451)

Co-authored-by: kkondaka <[email protected]>
  • Loading branch information
opensearch-trigger-bot[bot] and kkondaka authored Sep 26, 2023
1 parent 18c8f72 commit 2ee1e7e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ public CountAggregateAction(final CountAggregateActionConfig countAggregateActio
this.countKey = countAggregateActionConfig.getCountKey();
this.startTimeKey = countAggregateActionConfig.getStartTimeKey();
this.outputFormat = countAggregateActionConfig.getOutputFormat();
this.exemplarList = new ArrayList<>();
}

private long getTimeNanos(Instant time) {
Expand Down Expand Up @@ -87,6 +86,7 @@ public AggregateActionResponse handleEvent(final Event event, final AggregateAct
groupState.put(startTimeKey, Instant.now());
groupState.putAll(aggregateActionInput.getIdentificationKeys());
groupState.put(countKey, 1);
exemplarList = new ArrayList<>();
exemplarList.add(createExemplar(event));
} else {
Integer v = (Integer)groupState.get(countKey) + 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ public class HistogramAggregateAction implements AggregateAction {
private final String key;
private final String units;
private final boolean recordMinMax;
private List<Exemplar> exemplarList;
private Event minEvent;
private Event maxEvent;
private double minValue;
Expand All @@ -71,7 +70,6 @@ public HistogramAggregateAction(final HistogramAggregateActionConfig histogramAg
this.key = histogramAggregateActionConfig.getKey();
List<Number> bucketList = histogramAggregateActionConfig.getBuckets();
this.buckets = new double[bucketList.size()+2];
this.exemplarList = new ArrayList<>();
int bucketIdx = 0;
this.buckets[bucketIdx++] = -Float.MAX_VALUE;
for (int i = 0; i < bucketList.size(); i++) {
Expand Down Expand Up @@ -197,6 +195,7 @@ public AggregateActionOutput concludeGroup(final AggregateActionInput aggregateA
long startTimeNanos = getTimeNanos(startTime);
long endTimeNanos = getTimeNanos(endTime);
String histogramKey = HISTOGRAM_METRIC_NAME + "_key";
List<Exemplar> exemplarList = new ArrayList<>();
exemplarList.add(createExemplar("min", minEvent, minValue));
exemplarList.add(createExemplar("max", maxEvent, maxValue));
if (outputFormat.equals(OutputFormat.RAW.toString())) {
Expand Down

0 comments on commit 2ee1e7e

Please sign in to comment.