emit metrics corresponding to cost-based balancing

This commit is contained in:
Nelson Ray 2013-03-07 16:31:00 -08:00
parent 9f405c0b1e
commit 7a57609c5b
1 changed files with 24 additions and 24 deletions

View File

@ -55,30 +55,6 @@ public class DruidMasterLogger implements DruidMasterHelper
} }
} }
Map<String, AtomicLong> unassigned = stats.getPerTierStats().get("unassignedCount");
if (unassigned != null) {
for (Map.Entry<String, AtomicLong> entry : unassigned.entrySet()) {
emitter.emit(
new ServiceMetricEvent.Builder().build(
String.format("master/%s/unassigned/count", entry.getKey()),
entry.getValue().get()
)
);
}
}
Map<String, AtomicLong> sizes = stats.getPerTierStats().get("unassignedSize");
if (sizes != null) {
for (Map.Entry<String, AtomicLong> entry : sizes.entrySet()) {
emitter.emit(
new ServiceMetricEvent.Builder().build(
String.format("master/%s/unassigned/size", entry.getKey()),
entry.getValue().get()
)
);
}
}
Map<String, AtomicLong> dropped = stats.getPerTierStats().get("droppedCount"); Map<String, AtomicLong> dropped = stats.getPerTierStats().get("droppedCount");
if (dropped != null) { if (dropped != null) {
for (Map.Entry<String, AtomicLong> entry : dropped.entrySet()) { for (Map.Entry<String, AtomicLong> entry : dropped.entrySet()) {
@ -89,6 +65,30 @@ public class DruidMasterLogger implements DruidMasterHelper
} }
} }
emitter.emit(
new ServiceMetricEvent.Builder().build(
"master/cost/raw", stats.getGlobalStats().get("initialCost")
)
);
emitter.emit(
new ServiceMetricEvent.Builder().build(
"master/cost/normalization", stats.getGlobalStats().get("normalization")
)
);
emitter.emit(
new ServiceMetricEvent.Builder().build(
"master/cost/normalized", stats.getGlobalStats().get("normalizedInitialCostTimesOneThousand").doubleValue() / 1000d
)
);
emitter.emit(
new ServiceMetricEvent.Builder().build(
"master/moved/count", stats.getGlobalStats().get("movedCount")
)
);
emitter.emit( emitter.emit(
new ServiceMetricEvent.Builder().build( new ServiceMetricEvent.Builder().build(
"master/deleted/count", stats.getGlobalStats().get("deletedCount") "master/deleted/count", stats.getGlobalStats().get("deletedCount")