mirror of
https://github.com/apache/druid.git
synced 2025-02-09 03:24:55 +00:00
fix per tier metrics emission for new balancer
This commit is contained in:
parent
dcd10e69c7
commit
a28de5fa88
@ -65,35 +65,75 @@ public class DruidMasterLogger implements DruidMasterHelper
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Map<String, AtomicLong> initialCosts = stats.getPerTierStats().get("initialCost");
|
||||||
|
if (initialCosts != null) {
|
||||||
|
for (Map.Entry<String, AtomicLong> entry : initialCosts.entrySet()) {
|
||||||
|
String tier = entry.getKey();
|
||||||
|
AtomicLong value = entry.getValue();
|
||||||
emitter.emit(
|
emitter.emit(
|
||||||
new ServiceMetricEvent.Builder().build(
|
new ServiceMetricEvent.Builder()
|
||||||
"master/cost/raw", stats.getGlobalStats().get("initialCost")
|
.build(
|
||||||
|
String.format("master/%s/cost/raw", tier), value.get()
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, AtomicLong> normalization = stats.getPerTierStats().get("normalization");
|
||||||
|
if (initialCosts != null) {
|
||||||
|
for (Map.Entry<String, AtomicLong> entry : normalization.entrySet()) {
|
||||||
|
String tier = entry.getKey();
|
||||||
|
AtomicLong value = entry.getValue();
|
||||||
emitter.emit(
|
emitter.emit(
|
||||||
new ServiceMetricEvent.Builder().build(
|
new ServiceMetricEvent.Builder()
|
||||||
"master/cost/normalization", stats.getGlobalStats().get("normalization")
|
.build(
|
||||||
|
String.format("master/%s/cost/normalization", tier), value.get()
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, AtomicLong> normalized = stats.getPerTierStats().get("normalizedInitialCostTimesOneThousand");
|
||||||
|
if (initialCosts != null) {
|
||||||
|
for (Map.Entry<String, AtomicLong> entry : normalized.entrySet()) {
|
||||||
|
String tier = entry.getKey();
|
||||||
|
AtomicLong value = entry.getValue();
|
||||||
emitter.emit(
|
emitter.emit(
|
||||||
new ServiceMetricEvent.Builder().build(
|
new ServiceMetricEvent.Builder()
|
||||||
"master/cost/normalized", stats.getGlobalStats().get("normalizedInitialCostTimesOneThousand").doubleValue() / 1000d
|
.build(
|
||||||
|
String.format("master/%s/cost/normalized", tier), (double) value.get() / 1000d
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, AtomicLong> movedCount = stats.getPerTierStats().get("movedCount");
|
||||||
|
if (initialCosts != null) {
|
||||||
|
for (Map.Entry<String, AtomicLong> entry : movedCount.entrySet()) {
|
||||||
|
String tier = entry.getKey();
|
||||||
|
AtomicLong value = entry.getValue();
|
||||||
emitter.emit(
|
emitter.emit(
|
||||||
new ServiceMetricEvent.Builder().build(
|
new ServiceMetricEvent.Builder()
|
||||||
"master/moved/count", stats.getGlobalStats().get("movedCount")
|
.build(
|
||||||
|
String.format("master/%s/moved/count", tier), value.get()
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, AtomicLong> deletedCount = stats.getPerTierStats().get("deletedCount");
|
||||||
|
if (initialCosts != null) {
|
||||||
|
for (Map.Entry<String, AtomicLong> entry : deletedCount.entrySet()) {
|
||||||
|
String tier = entry.getKey();
|
||||||
|
AtomicLong value = entry.getValue();
|
||||||
emitter.emit(
|
emitter.emit(
|
||||||
new ServiceMetricEvent.Builder().build(
|
new ServiceMetricEvent.Builder()
|
||||||
"master/deleted/count", stats.getGlobalStats().get("deletedCount")
|
.build(
|
||||||
|
String.format("master/%s/deleted/count", tier), value.get()
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Map<String, AtomicLong> unneeded = stats.getPerTierStats().get("unneededCount");
|
Map<String, AtomicLong> unneeded = stats.getPerTierStats().get("unneededCount");
|
||||||
if (unneeded != null) {
|
if (unneeded != null) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user