public WmPoolMetrics(String poolName, MetricsSystem ms) { this.poolName = poolName; this.sourceName = "WmPoolMetrics." + poolName; this.ms = ms; this.registry = new MetricsRegistry(sourceName); }
RetryCacheMetrics(RetryCache retryCache) { name = "RetryCache."+ retryCache.getCacheName(); registry = new MetricsRegistry(name); if (LOG.isDebugEnabled()) { LOG.debug("Initialized "+ registry); } }
RpcDetailedMetrics(int port) { name = "RpcDetailedActivityForPort"+ port; registry = new MetricsRegistry("rpcdetailed") .tag("port", "RPC port", String.valueOf(port)); LOG.debug(registry.info().toString()); }
private LlapTaskSchedulerMetrics(String displayName, JvmMetrics jm, String sessionId) { this.name = displayName; this.jvmMetrics = jm; this.sessionId = sessionId; this.registry = new MetricsRegistry("LlapTaskSchedulerMetricsRegistry"); this.registry.tag(ProcessName, MetricsUtils.METRICS_PROCESS_NAME).tag(SessionId, sessionId); }
private LlapDaemonCacheMetrics(String name, String sessionId) { this.name = name; this.sessionId = sessionId; this.registry = new MetricsRegistry("LlapDaemonCacheRegistry"); this.registry.tag(ProcessName, MetricsUtils.METRICS_PROCESS_NAME).tag(SessionId, sessionId); }
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); }
private MetricsRegistry initRegistry(Object source) { Class<?> cls = source.getClass(); MetricsRegistry r = null; // Get the registry if it already exists. for (Field field : ReflectionUtils.getDeclaredFieldsIncludingInherited(cls)) { if (field.getType() != MetricsRegistry.class) continue; try { field.setAccessible(true); r = (MetricsRegistry) field.get(source); hasRegistry = r != null; break; } catch (Exception e) { LOG.warn("Error accessing field "+ field, e); continue; } } // Create a new registry according to annotation for (Annotation annotation : cls.getAnnotations()) { if (annotation instanceof Metrics) { Metrics ma = (Metrics) annotation; info = factory.getInfo(cls, ma); if (r == null) { r = new MetricsRegistry(info); } r.setContext(ma.context()); } } if (r == null) return new MetricsRegistry(cls.getSimpleName()); return r; }
public ReadWriteDiskValidatorMetrics() { registry = new MetricsRegistry(RECORD_INFO); fileReadQuantiles = new MutableQuantiles[quantileIntervals.length]; for (int i = 0; i < fileReadQuantiles.length; i++) { int interval = quantileIntervals[i]; fileReadQuantiles[i] = registry.newQuantiles( "readLatency" + interval + "s", "File read latency", "Ops", "latencyMicros", interval); } fileWriteQuantiles = new MutableQuantiles[quantileIntervals.length]; for (int i = 0; i < fileWriteQuantiles.length; i++) { int interval = quantileIntervals[i]; fileWriteQuantiles[i] = registry.newQuantiles( "writeLatency" + interval + "s", "File write latency", "Ops", "latencyMicros", interval); } }
private LlapDaemonJvmMetrics(String displayName, String sessionId, final Configuration conf) { this.name = displayName; this.sessionId = sessionId; Class<? extends ResourceCalculatorProcessTree> clazz = conf.getClass(YarnConfiguration.NM_CONTAINER_MON_PROCESS_TREE, null, ResourceCalculatorProcessTree.class); this.processTree = ResourceCalculatorProcessTree.getResourceCalculatorProcessTree("" + daemonPid, clazz, conf); if (processTree != null) { this.processTree.setConf(conf); } this.registry = new MetricsRegistry("LlapDaemonJvmRegistry"); this.registry.tag(ProcessName, MetricsUtils.METRICS_PROCESS_NAME).tag(SessionId, sessionId); }
private LlapDaemonIOMetrics(String displayName, String sessionId, int[] intervals) { this.name = displayName; this.sessionId = sessionId; this.registry = new MetricsRegistry("LlapDaemonIORegistry"); this.registry.tag(ProcessName, MetricsUtils.METRICS_PROCESS_NAME).tag(SessionId, sessionId); final int len = intervals == null ? 0 : intervals.length; this.decodingTimes = new MutableQuantiles[len]; for (int i=0; i<len; i++) { int interval = intervals[i]; LOG.info("Created interval " + LlapDaemonIOInfo.PercentileDecodingTime.name() + "_" + interval + "s"); decodingTimes[i] = registry.newQuantiles( LlapDaemonIOInfo.PercentileDecodingTime.name() + "_" + interval + "s", LlapDaemonIOInfo.PercentileDecodingTime.description(), "ops", "latency", interval); } }
name = "RpcActivityForPort" + port; this.server = server; registry = new MetricsRegistry("rpc") .tag("port", "RPC port", port) .tag("serverName", "Name of the RPC server", server.getServerName());
this.jvmMetrics = jm; this.sessionId = sessionId; this.registry = new MetricsRegistry("LlapDaemonExecutorRegistry"); this.registry.tag(ProcessName, MetricsUtils.METRICS_PROCESS_NAME).tag(SessionId, sessionId); this.numExecutors = numExecutors;
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)); this.registry.tag(MsInfo.ProcessName, MetricsSystemHelper.getProcessName()); }
Metrics2ReplicationMetrics(Master master, MetricsSystem system) { this.master = master; this.system = system; pathModTimes = new HashMap<>(); this.registry = new MetricsRegistry(Interns.info(NAME, DESCRIPTION)); this.registry.tag(MsInfo.ProcessName, MetricsSystemHelper.getProcessName()); replicationUtil = new ReplicationUtil(master.getContext()); replicationQueueTimeQuantiles = registry.newQuantiles(REPLICATION_QUEUE_TIME_QUANTILES, "Replication queue time quantiles in milliseconds", "ops", "latency", 600); replicationQueueTimeStat = registry.newStat(REPLICATION_QUEUE_TIME, "Replication queue time statistics in milliseconds", "ops", "latency", true); }
Metrics2TabletServerMinCMetrics(MetricsSystem system) { this.system = system; this.registry = new MetricsRegistry(Interns.info(NAME, DESCRIPTION)); this.registry.tag(MsInfo.ProcessName, MetricsSystemHelper.getProcessName()); activeMinc = registry.newStat(MINC, "Minor compactions", "Ops", "Count", true); queuedMinc = registry.newStat(QUEUE, "Queued minor compactions", "Ops", "Count", true); }
Metrics2TabletServerScanMetrics(MetricsSystem system) { this.system = system; this.registry = new MetricsRegistry(Interns.info(NAME, DESCRIPTION)); this.registry.tag(MsInfo.ProcessName, MetricsSystemHelper.getProcessName()); scans = registry.newStat(SCAN, "Scans", "Ops", "Count", true); resultsPerScan = registry.newStat(RESULT_SIZE, "Results per scan", "Ops", "Count", true); yields = registry.newStat(YIELD, "Yields", "Ops", "Count", true); }
Metrics2TabletServerUpdateMetrics(MetricsSystem system) { this.system = system; this.registry = new MetricsRegistry(Interns.info(NAME, DESCRIPTION)); this.registry.tag(MsInfo.ProcessName, MetricsSystemHelper.getProcessName()); 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); }
RetryCacheMetrics(RetryCache retryCache) { name = "RetryCache."+ retryCache.getCacheName(); registry = new MetricsRegistry(name); if (LOG.isDebugEnabled()) { LOG.debug("Initialized "+ registry); } }
Metrics2TabletServerMetrics(TabletServer tserver, MetricsSystem system) { util = new TabletServerMetricsUtil(tserver); this.system = system; this.registry = new MetricsRegistry(Interns.info(NAME, DESCRIPTION)); this.registry.tag(MsInfo.ProcessName, MetricsSystemHelper.getProcessName()); 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); }
private static void registerMetrics() { registry = new MetricsRegistry(RECORD_INFO); registry.tag(RECORD_INFO, "ResourceManager"); MetricsSystem ms = DefaultMetricsSystem.instance(); if (ms != null) { ms.register("CapacitySchedulerMetrics", "Metrics for the Yarn Capacity Scheduler", INSTANCE); } }