org.apache.gobblin.metrics.Tag.toString()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(2.9k)|赞(0)|评价(0)|浏览(100)

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

Tag.toString介绍

暂无

代码示例

代码示例来源:origin: apache/incubator-gobblin

/**
 * Add a {@link Tag} to a {@link org.apache.gobblin.configuration.State} with key {@link #METRICS_STATE_CUSTOM_TAGS}.
 *
 * <p>
 *   {@link org.apache.gobblin.metrics.Tag}s under this key can later be parsed using the method {@link #getCustomTagsFromState}.
 * </p>
 *
 * @param state {@link org.apache.gobblin.configuration.State} state to add the tag to.
 * @param tag {@link Tag} to add.
 */
public static void addCustomTagToState(State state, Tag<?> tag) {
 state.appendToListProp(METRICS_STATE_CUSTOM_TAGS, tag.toString());
}

代码示例来源:origin: apache/incubator-gobblin

/**
 * Add a {@link List} of {@link Tag}s to a {@link org.apache.gobblin.configuration.State} with key {@link #METRICS_STATE_CUSTOM_TAGS}.
 *
 * <p>
 *   {@link org.apache.gobblin.metrics.Tag}s under this key can later be parsed using the method {@link #getCustomTagsFromState}.
 * </p>
 *
 * @param state {@link org.apache.gobblin.configuration.State} state to add the tag to.
 * @param tags list of {@link Tag}s to add.
 */
public static void addCustomTagToState(State state, List<? extends Tag<?>> tags) {
 for (Tag<?> tag : tags) {
  state.appendToListProp(METRICS_STATE_CUSTOM_TAGS, tag.toString());
 }
}

代码示例来源:origin: apache/incubator-gobblin

@Test(dependsOnMethods = "testAddTags")
 public void testMetricNamePrefix() {
  Assert.assertEquals(
    this.tagged.metricNamePrefix(false), MetricRegistry.name(JOB_ID, Integer.toString(PROJECT_VERSION)));
  Assert.assertEquals(
    this.tagged.metricNamePrefix(true),
    MetricRegistry.name(this.tagged.getTags().get(0).toString(), this.tagged.getTags().get(1).toString()));
 }
}

代码示例来源:origin: org.apache.gobblin/gobblin-metrics

/**
 * Add a {@link Tag} to a {@link org.apache.gobblin.configuration.State} with key {@link #METRICS_STATE_CUSTOM_TAGS}.
 *
 * <p>
 *   {@link org.apache.gobblin.metrics.Tag}s under this key can later be parsed using the method {@link #getCustomTagsFromState}.
 * </p>
 *
 * @param state {@link org.apache.gobblin.configuration.State} state to add the tag to.
 * @param tag {@link Tag} to add.
 */
public static void addCustomTagToState(State state, Tag<?> tag) {
 state.appendToListProp(METRICS_STATE_CUSTOM_TAGS, tag.toString());
}

代码示例来源:origin: org.apache.gobblin/gobblin-metrics

/**
 * Add a {@link List} of {@link Tag}s to a {@link org.apache.gobblin.configuration.State} with key {@link #METRICS_STATE_CUSTOM_TAGS}.
 *
 * <p>
 *   {@link org.apache.gobblin.metrics.Tag}s under this key can later be parsed using the method {@link #getCustomTagsFromState}.
 * </p>
 *
 * @param state {@link org.apache.gobblin.configuration.State} state to add the tag to.
 * @param tags list of {@link Tag}s to add.
 */
public static void addCustomTagToState(State state, List<? extends Tag<?>> tags) {
 for (Tag<?> tag : tags) {
  state.appendToListProp(METRICS_STATE_CUSTOM_TAGS, tag.toString());
 }
}

相关文章