RpcDetailedMetrics(int port) { name = "RpcDetailedActivityForPort"+ port; registry = new MetricsRegistry("rpcdetailed") .tag("port", "RPC port", String.valueOf(port)); LOG.debug(registry.info().toString()); }
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; this.threadMXBean = ManagementFactory.getThreadMXBean(); for (int i=0; i<len; i++) { int interval = intervals[i]; percentileTimeToKill[i] = registry.newQuantiles( LlapDaemonExecutorInfo.ExecutorMaxPreemptionTimeToKill.name() + "_" + interval + "s", LlapDaemonExecutorInfo.ExecutorMaxPreemptionTimeToKill.description(), "ops", "latency", interval); percentileTimeLost[i] = registry.newQuantiles( LlapDaemonExecutorInfo.ExecutorMaxPreemptionTimeLost.name() + "_" + interval + "s", LlapDaemonExecutorInfo.ExecutorMaxPreemptionTimeLost.description(), this.cpuMetricsInfoMap.put(i, mic); this.userMetricsInfoMap.put(i, miu); this.executorThreadCpuTime[i] = registry.newGauge(mic, 0L); this.executorThreadUserTime[i] = registry.newGauge(miu, 0L); this.executorNames.put(ContainerRunnerImpl.THREAD_NAME_FORMAT_PREFIX + i, i);
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); }
public QueryMetrics(int[] intervals) { queryLatencyTimeMillisQuantiles = new MutableQuantiles[intervals.length]; scanRowCountQuantiles = new MutableQuantiles[intervals.length]; resultRowCountQuantiles = new MutableQuantiles[intervals.length]; cacheHitCountQuantiles = new MutableQuantiles[intervals.length]; for (int i = 0; i < intervals.length; i++) { int interval = intervals[i]; queryLatencyTimeMillisQuantiles[i] = registry.newQuantiles("QueryLatency" + interval + "s", "Query queue time in milli second", "ops", "", interval); scanRowCountQuantiles[i] = registry.newQuantiles("ScanRowCount" + interval + "s", "Scan row count in milli second", "ops", "", interval); resultRowCountQuantiles[i] = registry.newQuantiles("ResultRowCount" + interval + "s", "Result row count in milli second", "ops", "", interval); cacheHitCountQuantiles[i] = registry.newQuantiles("CacheHitCount" + interval + "s", "Cache Hit Count in milli second", "ops", "", interval); } queryLatency = registry.newRate("QueryLatency", "", true); scanRowCount = registry.newRate("ScanRowCount", "", true); resultRowCount = registry.newRate("ResultRowCount", "", true); }
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); } }
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); }
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); }
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); } }
MutableMetric metric = newForField(field, annotation); if (metric != null) { registry.add(info.name(), metric); return metric; return registry.newCounter(info, 0); return registry.newCounter(info, 0L); return registry.newGauge(info, 0); return registry.newGauge(info, 0L); return registry.newGauge(info, 0f); return registry.newRate(info.name(), info.description(), annotation.always()); return registry.newRatesWithAggregation(info.name()); return registry.newStat(info.name(), info.description(), annotation.sampleName(), annotation.valueName(), annotation.always()); return registry.newMutableRollingAverages(info.name(), annotation.valueName()); return registry.newQuantiles(info.name(), annotation.about(), annotation.sampleName(), annotation.valueName(), annotation.interval());
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); }
@Override public void snapshot(MetricsRecordBuilder rb, boolean all) { registry.snapshot(rb, all); } }
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); }
/** * Create a mutable long integer gauge * @param name of the metric * @param desc metric description * @param iVal initial value * @return a new gauge object */ public MutableGaugeLong newGauge(String name, String desc, long iVal) { return newGauge(Interns.info(name, desc), iVal); }
/** * Tests that when using {@link MutableStat#add(long, long)}, even with a high * sample count, the mean does not lose accuracy. */ @Test public void testMutableStatWithBulkAdd() { MetricsRecordBuilder rb = mockMetricsRecordBuilder(); MetricsRegistry registry = new MetricsRegistry("test"); MutableStat stat = registry.newStat("Test", "Test", "Ops", "Val", false); stat.add(1000, 1000); stat.add(1000, 2000); registry.snapshot(rb, false); assertCounter("TestNumOps", 2000L, rb); assertGauge("TestAvgVal", 1.5, rb); }
NameNodeMetrics(String processName, String sessionId, int[] intervals, final JvmMetrics jvmMetrics) { this.jvmMetrics = jvmMetrics; registry.tag(ProcessName, processName).tag(SessionId, sessionId); syncsQuantiles[i] = registry.newQuantiles( "syncs" + interval + "s", "Journal syncs", "ops", "latency", interval); numTransactionsBatchedInSync[i] = registry.newQuantiles( "numTransactionsBatchedInSync" + interval + "s", "Number of Transactions batched in sync", "ops", "count", interval); storageBlockReportQuantiles[i] = registry.newQuantiles( "storageBlockReport" + interval + "s", "Storage block report", "ops", "latency", interval); cacheReportQuantiles[i] = registry.newQuantiles( "cacheReport" + interval + "s", "Cache report", "ops", "latency", interval); generateEDEKTimeQuantiles[i] = registry.newQuantiles( "generateEDEKTime" + interval + "s", "Generate EDEK time", "ops", "latency", interval); warmUpEDEKTimeQuantiles[i] = registry.newQuantiles( "warmupEDEKTime" + interval + "s", "Warm up EDEK time", "ops", "latency", interval); resourceCheckTimeQuantiles[i] = registry.newQuantiles( "resourceCheckTime" + interval + "s", "resource check time", "ops", "latency", interval); editLogTailTimeQuantiles[i] = registry.newQuantiles( "editLogTailTime" + interval + "s", "Edit log tailing time", "ops", "latency", interval);
/** * 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); }
@Test public void testMutableRates() { MetricsRecordBuilder rb = mockMetricsRecordBuilder(); MetricsRegistry registry = new MetricsRegistry("test"); MutableRates rates = new MutableRates(registry); rates.init(TestProtocol.class); registry.snapshot(rb, false); assertCounter("FooNumOps", 0L, rb); assertGauge("FooAvgTime", 0.0, rb); assertCounter("BarNumOps", 0L, rb); assertGauge("BarAvgTime", 0.0, rb); }
public WmPoolMetrics(String poolName, MetricsSystem ms) { this.poolName = poolName; this.sourceName = "WmPoolMetrics." + poolName; this.ms = ms; this.registry = new MetricsRegistry(sourceName); }
this.queue = new SinkQueue<MetricsBuffer>(checkArg(queueCapacity, queueCapacity > 0, "queue capacity")); latency = registry.newRate("Sink_"+ name, "Sink end to end latency", false); dropped = registry.newCounter("Sink_"+ name +"Dropped", "Dropped updates per sink", 0); qsize = registry.newGauge("Sink_"+ name + "Qsize", "Queue size", 0);