protected GobblinMetrics(String id, MetricContext parentContext, List<Tag<?>> tags) { this.id = id; this.metricContext = parentContext == null ? new MetricContext.Builder(id).addTags(tags).build() : parentContext.childBuilder(id).addTags(tags).build(); }
/** * Removes {@link ContextAwareReporter} records from the {@link RootMetricContext}. * This method should be considered irreversible and destructive to the {@link ContextAwareReporter}. * @throws IOException */ @Override public void close() throws IOException { RootMetricContext.get().removeNotificationTarget(this.notificationTargetUUID); RootMetricContext.get().removeReporter(this); }
/** * Sets the value of the 'metricName' field. * The name of this metric. * @param value The value of 'metricName'. * @return This builder. */ public gobblin.metrics.FlatGobblinMetric.Builder setMetricName(java.lang.String value) { validate(fields()[2], value); this.metricName = value; fieldSetFlags()[2] = true; return this; }
/** * Get a {@link GobblinMetrics} instance with the given ID. * * @param id the given {@link GobblinMetrics} ID * @return a {@link GobblinMetrics} instance */ public static GobblinMetrics get(String id) { return get(id, null); }
/** * See {@link com.codahale.metrics.MetricRegistry#getTimers()}. * * <p> * This method will return fully-qualified metric names if the {@link MetricContext} is configured * to report fully-qualified metric names. * </p> */ @Override public SortedMap<String, Timer> getTimers() { return this.innerMetricContext.getTimers(MetricFilter.ALL); }
/** * Creates a new FlatGobblinMetric RecordBuilder. * @return A new FlatGobblinMetric RecordBuilder */ public static gobblin.metrics.FlatGobblinMetric.Builder newBuilder() { return new gobblin.metrics.FlatGobblinMetric.Builder(); }
/** * Clears the value of the 'tags' field. * Tags associated with the metrics in the form key:value. * @return This builder. */ public gobblin.metrics.FlatGobblinMetric.Builder clearTags() { tags = null; fieldSetFlags()[0] = false; return this; }
/** * Creates a new GobblinTrackingEvent RecordBuilder. * @return A new GobblinTrackingEvent RecordBuilder */ public static gobblin.metrics.GobblinTrackingEvent.Builder newBuilder() { return new gobblin.metrics.GobblinTrackingEvent.Builder(); }
/** * Checks whether the 'name' field has been set. * Event name. * @return True if the 'name' field has been set, false otherwise. */ public boolean hasName() { return fieldSetFlags()[2]; }
/** * Get a view of the child {@link gobblin.metrics.MetricContext}s as a {@link com.google.common.collect.ImmutableMap}. * @return {@link com.google.common.collect.ImmutableMap} of * child {@link gobblin.metrics.MetricContext}s keyed by their names. */ public Map<String, MetricContext> getChildContextsAsMap() { return this.innerMetricContext.getChildContextsAsMap(); }
/** * See {@link com.codahale.metrics.MetricRegistry#getNames()}. * * <p> * This method will return fully-qualified metric names if the {@link MetricContext} is configured * to report fully-qualified metric names. * </p> */ @Override public SortedSet<String> getNames() { return this.innerMetricContext.getNames(); }
/** * Clears the value of the 'name' field. * Metric name. * @return This builder. */ public gobblin.metrics.Metric.Builder clearName() { name = null; fieldSetFlags()[0] = false; return this; }
/** * Clears the value of the 'tags' field. * Tags associated with the metrics. * @return This builder. */ public gobblin.metrics.MetricReport.Builder clearTags() { tags = null; fieldSetFlags()[0] = false; return this; }
/** * See {@link com.codahale.metrics.MetricRegistry#getMetrics()}. * * <p> * This method will return fully-qualified metric names if the {@link MetricContext} is configured * to report fully-qualified metric names. * </p> */ @Override public Map<String, com.codahale.metrics.Metric> getMetrics() { return getSimplyNamedMetrics(); }
@Override public GobblinMetrics call() throws Exception { return new GobblinMetrics(id, parentContext, tags); } });
/** * See {@link com.codahale.metrics.MetricRegistry#getTimers(com.codahale.metrics.MetricFilter)}. * * <p> * This method will return fully-qualified metric names if the {@link MetricContext} is configured * to report fully-qualified metric names. * </p> */ @Override public SortedMap<String, Timer> getTimers(MetricFilter filter) { return this.innerMetricContext.getTimers(filter); }
/** * Creates a new FlatGobblinMetric RecordBuilder by copying an existing FlatGobblinMetric instance. * @param other The existing instance to copy. * @return A new FlatGobblinMetric RecordBuilder */ public static gobblin.metrics.FlatGobblinMetric.Builder newBuilder(gobblin.metrics.FlatGobblinMetric other) { return new gobblin.metrics.FlatGobblinMetric.Builder(other); }
/** * Checks whether the 'metricName' field has been set. * The name of this metric. * @return True if the 'metricName' field has been set, false otherwise. */ public boolean hasMetricName() { return fieldSetFlags()[2]; }