this.serviceWorker = serviceWorker;
this.serverData = serviceWorker.getServerData();
// Per-Superstep Metrics.
// Since this object is not long lived we just initialize the metrics here.
SuperstepMetricsRegistry smr = GiraphMetrics.get().perSuperstep();
localRequests = smr.getCounter(MetricNames.LOCAL_REQUESTS);
remoteRequests = smr.getCounter(MetricNames.REMOTE_REQUESTS);
final Gauge<Long> totalRequests = smr.getGauge(MetricNames.TOTAL_REQUESTS,
new Gauge<Long>() {
@Override
public Long value() {
return localRequests.count() + remoteRequests.count();
}
}
);
smr.getGauge(MetricNames.PERCENT_LOCAL_REQUESTS, new PercentGauge() {
@Override protected double getNumerator() {
return localRequests.count();
}
@Override protected double getDenominator() {