List of usage examples for org.apache.hadoop.metrics2.lib MetricsRegistry MetricsRegistry
public MetricsRegistry(MetricsInfo info)
From source file:com.github.joshelser.dropwizard.metrics.hadoop.HadoopMetrics2Reporter.java
License:Apache License
private HadoopMetrics2Reporter(MetricRegistry registry, TimeUnit rateUnit, TimeUnit durationUnit, MetricFilter filter, MetricsSystem metrics2System, String jmxContext, String description, String recordName, String context) { super(registry, "hadoop-metrics2-reporter", filter, rateUnit, durationUnit); this.metrics2Registry = new MetricsRegistry(Interns.info(jmxContext, description)); this.metrics2System = metrics2System; this.recordName = recordName; this.context = context; // These could really be Collection.emptyMap(), but this makes testing a bit easier. this.dropwizardGauges = EMPTY_GAUGE_MAP; this.dropwizardCounters = EMPTY_COUNTER_MAP; this.dropwizardHistograms = EMPTY_HISTOGRAM_MAP; this.dropwizardMeters = EMPTY_METER_MAP; this.dropwizardTimers = EMPTY_TIMER_MAP; // Register this source with the Metrics2 system. // Make sure this is the last thing done as getMetrics() can be called at any time after. this.metrics2System.register(Objects.requireNonNull(jmxContext), Objects.requireNonNull(description), this); }
From source file:org.apache.accumulo.master.metrics.fate.Metrics2FateMetrics.java
License:Apache License
public Metrics2FateMetrics(final ServerContext context, MetricsSystem metricsSystem, final long minimumRefreshDelay) { this.context = context; this.minimumRefreshDelay = Math.max(DEFAULT_MIN_REFRESH_DELAY, minimumRefreshDelay); metricValues = new AtomicReference<>(FateMetricValues.updateFromZookeeper(context, null)); this.metricsSystem = metricsSystem; this.registry = new MetricsRegistry(Interns.info(NAME, DESCRIPTION)); this.registry.tag(MsInfo.ProcessName, MetricsSystemHelper.getProcessName()); currentFateOps = registry.newGauge(CUR_FATE_OPS, "Current number of FATE Ops", 0L); zkChildFateOpsTotal = registry.newGauge(TOTAL_FATE_OPS, "Total FATE Ops", 0L); zkConnectionErrorsTotal = registry.newGauge(TOTAL_ZK_CONN_ERRORS, "Total ZK Connection Errors", 0L); }
From source file:org.apache.accumulo.master.metrics.Metrics2ReplicationMetrics.java
License:Apache License
Metrics2ReplicationMetrics(Master master, MetricsSystem system) {
this.master = master;
this.system = system;
registry = new MetricsRegistry(Interns.info(NAME, DESCRIPTION));
replicationUtil = new ReplicationUtil(master);
}
From source file:org.apache.accumulo.server.metrics.Metrics2ThriftMetrics.java
License:Apache License
Metrics2ThriftMetrics(MetricsSystem system, String serverName, String threadName) {
this.system = system;
this.record = serverName;
this.name = THRIFT_NAME + ",sub=" + serverName;
this.desc = "Thrift Server Metrics - " + serverName + " " + threadName;
this.registry = new MetricsRegistry(Interns.info(name, desc));
}
From source file:org.apache.accumulo.tserver.metrics.Metrics2TabletServerMetrics.java
License:Apache License
Metrics2TabletServerMetrics(TabletServer tserver, MetricsSystem system) {
util = new TabletServerMetricsUtil(tserver);
this.system = system;
this.registry = new MetricsRegistry(Interns.info(NAME, DESCRIPTION));
entries = registry.newGauge(Interns.info(ENTRIES, "Number of entries"), 0l);
entriesInMemory = registry.newGauge(Interns.info(ENTRIES_IN_MEM, "Number of entries in memory"), 0l);
activeMajcs = registry.newGauge(Interns.info(ACTIVE_MAJCS, "Number of active major compactions"), 0l);
queuedMajcs = registry.newGauge(Interns.info(QUEUED_MAJCS, "Number of queued major compactions"), 0l);
activeMincs = registry.newGauge(Interns.info(ACTIVE_MINCS, "Number of active minor compactions"), 0l);
queuedMincs = registry.newGauge(Interns.info(QUEUED_MINCS, "Number of queued minor compactions"), 0l);
onlineTablets = registry.newGauge(Interns.info(ONLINE_TABLETS, "Number of online tablets"), 0l);
openingTablets = registry.newGauge(Interns.info(OPENING_TABLETS, "Number of opening tablets"), 0l);
unopenedTablets = registry.newGauge(Interns.info(UNOPENED_TABLETS, "Number of unopened tablets"), 0l);
queries = registry.newGauge(Interns.info(QUERIES, "Number of queries"), 0l);
totalMincs = registry.newGauge(Interns.info(TOTAL_MINCS, "Total number of minor compactions performed"),
0l);/*w ww . ja v a2 s . c om*/
}
From source file:org.apache.accumulo.tserver.metrics.Metrics2TabletServerMinCMetrics.java
License:Apache License
Metrics2TabletServerMinCMetrics(MetricsSystem system) {
this.system = system;
this.registry = new MetricsRegistry(Interns.info(NAME, DESCRIPTION));
activeMinc = registry.newStat(MINC, "Minor compactions", "Ops", "Count", true);
queuedMinc = registry.newStat(QUEUE, "Queued minor compactions", "Ops", "Count", true);
}
From source file:org.apache.accumulo.tserver.metrics.Metrics2TabletServerScanMetrics.java
License:Apache License
Metrics2TabletServerScanMetrics(MetricsSystem system) {
this.system = system;
this.registry = new MetricsRegistry(Interns.info(NAME, DESCRIPTION));
scans = registry.newStat(SCAN, "Scans", "Ops", "Count", true);
resultsPerScan = registry.newStat(RESULT_SIZE, "Results per scan", "Ops", "Count", true);
}
From source file:org.apache.accumulo.tserver.metrics.Metrics2TabletServerUpdateMetrics.java
License:Apache License
Metrics2TabletServerUpdateMetrics(MetricsSystem system) {
this.system = system;
this.registry = new MetricsRegistry(Interns.info(NAME, DESCRIPTION));
permissionErrorsCounter = registry.newCounter(Interns.info(PERMISSION_ERRORS, "Permission Errors"), 0l);
unknownTabletErrorsCounter = registry
.newCounter(Interns.info(UNKNOWN_TABLET_ERRORS, "Unknown Tablet Errors"), 0l);
constraintViolationsCounter = registry
.newCounter(Interns.info(CONSTRAINT_VIOLATIONS, "Table Constraint Violations"), 0l);
commitPrepStat = registry.newStat(COMMIT_PREP, "preparing to commit mutations", "Ops", "Time", true);
walogWriteTimeStat = registry.newStat(WALOG_WRITE_TIME, "writing mutations to WAL", "Ops", "Time", true);
commitTimeStat = registry.newStat(COMMIT_TIME, "committing mutations", "Ops", "Time", true);
mutationArraySizeStat = registry.newStat(MUTATION_ARRAY_SIZE, "mutation array", "ops", "Size", true);
}
From source file:org.apache.calcite.dropwizard.metrics.hadoop.HadoopMetrics2Reporter.java
License:Apache License
private HadoopMetrics2Reporter(MetricRegistry registry, TimeUnit rateUnit, TimeUnit durationUnit, MetricFilter filter, MetricsSystem metrics2System, String jmxContext, String description, String recordName, String context) { super(registry, "hadoop-metrics2-reporter", filter, rateUnit, durationUnit); this.metrics2Registry = new MetricsRegistry(Interns.info(jmxContext, description)); this.metrics2System = metrics2System; this.recordName = recordName; this.context = context; this.dropwizardGauges = new ConcurrentLinkedQueue<>(); this.dropwizardCounters = new ConcurrentLinkedQueue<>(); this.dropwizardHistograms = new ConcurrentLinkedQueue<>(); this.dropwizardMeters = new ConcurrentLinkedQueue<>(); this.dropwizardTimers = new ConcurrentLinkedQueue<>(); // Register this source with the Metrics2 system. // Make sure this is the last thing done as getMetrics() can be called at any time after. this.metrics2System.register(Objects.requireNonNull(jmxContext), Objects.requireNonNull(description), this); }