use of org.apache.zookeeper.metrics.MetricsContext in project zookeeper by apache.
the class QuorumZooKeeperServer method unregisterMetrics.
@Override
protected void unregisterMetrics() {
super.unregisterMetrics();
MetricsContext rootContext = ServerMetrics.getMetrics().getMetricsProvider().getRootContext();
rootContext.unregisterGauge("quorum_size");
}
use of org.apache.zookeeper.metrics.MetricsContext in project zookeeper by apache.
the class QuotaMetricsUtilsTest method registerQuotaMetrics.
private void registerQuotaMetrics(final String nameSuffix, final DataTree dt) {
final MetricsProvider metricProvider = ServerMetrics.getMetrics().getMetricsProvider();
final MetricsContext rootContext = metricProvider.getRootContext();
// added random UUID as NAME_SUFFIX to avoid GaugeSet being overwritten when registering with same name
rootContext.registerGaugeSet(QuotaMetricsUtils.QUOTA_COUNT_LIMIT_PER_NAMESPACE + nameSuffix, () -> QuotaMetricsUtils.getQuotaCountLimit(dt));
rootContext.registerGaugeSet(QuotaMetricsUtils.QUOTA_BYTES_LIMIT_PER_NAMESPACE + nameSuffix, () -> QuotaMetricsUtils.getQuotaBytesLimit(dt));
rootContext.registerGaugeSet(QuotaMetricsUtils.QUOTA_COUNT_USAGE_PER_NAMESPACE + nameSuffix, () -> QuotaMetricsUtils.getQuotaCountUsage(dt));
rootContext.registerGaugeSet(QuotaMetricsUtils.QUOTA_BYTES_USAGE_PER_NAMESPACE + nameSuffix, () -> QuotaMetricsUtils.getQuotaBytesUsage(dt));
}
use of org.apache.zookeeper.metrics.MetricsContext in project zookeeper by apache.
the class FollowerZooKeeperServer method registerMetrics.
@Override
protected void registerMetrics() {
super.registerMetrics();
MetricsContext rootContext = ServerMetrics.getMetrics().getMetricsProvider().getRootContext();
rootContext.registerGauge("synced_observers", self::getSynced_observers_metric);
}
use of org.apache.zookeeper.metrics.MetricsContext in project zookeeper by apache.
the class LeaderZooKeeperServer method unregisterMetrics.
@Override
protected void unregisterMetrics() {
super.unregisterMetrics();
MetricsContext rootContext = ServerMetrics.getMetrics().getMetricsProvider().getRootContext();
rootContext.unregisterGauge("learners");
rootContext.unregisterGauge("synced_followers");
rootContext.unregisterGauge("synced_non_voting_followers");
rootContext.unregisterGauge("synced_observers");
rootContext.unregisterGauge("pending_syncs");
rootContext.unregisterGauge("leader_uptime");
rootContext.unregisterGauge("last_proposal_size");
rootContext.unregisterGauge("max_proposal_size");
rootContext.unregisterGauge("min_proposal_size");
}
Aggregations