Skip to content

Commit

Permalink
More debug
Browse files Browse the repository at this point in the history
  • Loading branch information
peterzxu-crm committed Aug 31, 2024
1 parent b7176e4 commit a168c94
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,6 @@ public void apply(MetricAggregate agg, DataPoint m, int now)
return;
}
AggregateFunction f = metrics.computeIfAbsent(key, k -> AggregateFunction.create(k, agg.getAggregationMethod()));
if (m.name != null && m.name.startsWith("pod222.ecom.bjmr.bjmr_prd") && m.name.endsWith("number-of-filters.max")) {
log.warn("============");
log.warn("Received metrics " + m.name);
log.warn(f.getType() + " " + agg.getAggregationMethod().name() + " " + key);
log.warn("============");
}
f.add(m, now);
}

Expand All @@ -107,6 +101,12 @@ private void flush(Consumer<DataPoints> out)
if (af.getType() == AggregateFunction.Type.SINGLE_VALUE) {
DataPoint agg = new DataPoint(m.getKey(), af.apply(), ts);
points.add(agg);
if (m.getKey() != null && m.getKey().startsWith("pod222.ecom_ag.bjmr.bjmr_prd") && m.getKey().endsWith("number-of-filters.max")) {
log.warn("============");
log.warn("Received aggregated metric " + m.getKey());
log.warn(agg.toString());
log.warn("============");
}
} else {
Map<String, Double> aggTypeToValue = af.getValues();
for (Map.Entry<String, Double> aggTypeValuePair: aggTypeToValue.entrySet()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,12 @@ public void put(DataPoints points) {
try {
DataPoint dp2 = new DataPoint(dp.name, dp.val, dp.ts, false);
dp.drop();
if (dp2.name != null && dp2.name.startsWith("pod222.ecom_ag.bjmr.bjmr_prd") && dp2.name.endsWith("number-of-filters.max")) {
log.warn("============");
log.warn("Put aggregated metric " + dp2.name);
log.warn(dp2.toString());
log.warn("============");
}
serialTaskQueue.submit(() -> {
if (null != nameIndex.createLeafMetric(dp2.name)) {
this.accept(new DataPoints(List.of(dp2)));
Expand Down

0 comments on commit a168c94

Please sign in to comment.