org.apache.hadoop.metrics2.lib.MetricsRegistry.tag()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(9.5k)|赞(0)|评价(0)|浏览(111)

本文整理了Java中org.apache.hadoop.metrics2.lib.MetricsRegistry.tag()方法的一些代码示例,展示了MetricsRegistry.tag()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。MetricsRegistry.tag()方法的具体详情如下:
包路径:org.apache.hadoop.metrics2.lib.MetricsRegistry
类名称:MetricsRegistry
方法名:tag

MetricsRegistry.tag介绍

[英]Add a tag to the metrics
[中]为指标添加一个标记

代码示例

代码示例来源:origin: org.apache.hadoop/hadoop-common

/**
 * 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);
}

代码示例来源:origin: org.apache.hadoop/hadoop-common

/**
 * 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);
}

代码示例来源:origin: org.apache.hadoop/hadoop-common

public MetricsRegistry tag(MetricsInfo info, String value) {
 return tag(info, value, false);
}

代码示例来源:origin: apache/hive

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);
}

代码示例来源:origin: apache/hive

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);
}

代码示例来源:origin: org.apache.hadoop/hadoop-common

/**
 * 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);
}

代码示例来源:origin: apache/hive

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);
}

代码示例来源:origin: org.apache.hadoop/hadoop-common

RpcDetailedMetrics(int port) {
 name = "RpcDetailedActivityForPort"+ port;
 registry = new MetricsRegistry("rpcdetailed")
   .tag("port", "RPC port", String.valueOf(port));
 LOG.debug(registry.info().toString());
}

代码示例来源:origin: apache/hive

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);
 }
}

代码示例来源:origin: org.apache.hadoop/hadoop-common

this.server = server;
registry = new MetricsRegistry("rpc")
  .tag("port", "RPC port", port)
  .tag("serverName", "Name of the RPC server", server.getServerName());
int[] intervals = conf.getInts(
  CommonConfigurationKeys.RPC_METRICS_PERCENTILES_INTERVALS_KEY);

代码示例来源:origin: apache/hive

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();

代码示例来源:origin: apache/accumulo

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());
}

代码示例来源:origin: apache/accumulo

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);
}

代码示例来源:origin: apache/accumulo

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);
}

代码示例来源:origin: apache/accumulo

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);
}

代码示例来源:origin: org.apache.hadoop/hadoop-hdfs

NameNodeMetrics(String processName, String sessionId, int[] intervals,
  final JvmMetrics jvmMetrics) {
 this.jvmMetrics = jvmMetrics;
 registry.tag(ProcessName, processName).tag(SessionId, sessionId);

代码示例来源:origin: org.apache.hadoop/hadoop-hdfs

this.name = name;
this.jvmMetrics = jvmMetrics;    
registry.tag(SessionId, sessionId);

代码示例来源:origin: apache/accumulo

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);
}

代码示例来源:origin: io.hops/hadoop-common

RpcDetailedMetrics(int port) {
 name = "RpcDetailedActivityForPort"+ port;
 registry = new MetricsRegistry("rpcdetailed")
   .tag("port", "RPC port", String.valueOf(port));
 LOG.debug(registry.info());
}

代码示例来源:origin: apache/accumulo

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);
}

相关文章