/** * Set the metrics context tag * @param name of the context * @return the registry itself as a convenience */ public MetricsRegistry setContext(String name) { return tag(MsInfo.Context, name, true); }
/** * Add a tag to the metrics * @param name of the tag * @param description of the tag * @param value of the tag * @return the registry (for keep adding tags) */ public MetricsRegistry tag(String name, String description, String value) { return tag(name, description, value, false); }
public MetricsRegistry tag(MetricsInfo info, String value) { return tag(info, value, false); }
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); }
/** * Add a tag to the metrics * @param name of the tag * @param description of the tag * @param value of the tag * @param override existing tag if true * @return the registry (for keep adding tags) */ public MetricsRegistry tag(String name, String description, String value, boolean override) { return tag(Interns.info(name, description), value, override); }
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); }
RpcDetailedMetrics(int port) { name = "RpcDetailedActivityForPort"+ port; registry = new MetricsRegistry("rpcdetailed") .tag("port", "RPC port", String.valueOf(port)); LOG.debug(registry.info().toString()); }
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); } }
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); }
this.name = name; this.jvmMetrics = jvmMetrics; registry.tag(SessionId, sessionId);
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); }
RpcDetailedMetrics(int port) { name = "RpcDetailedActivityForPort"+ port; registry = new MetricsRegistry("rpcdetailed") .tag("port", "RPC port", String.valueOf(port)); LOG.debug(registry.info()); }
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); }