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(); }
@BeforeClass public void setUp() { this.context = MetricContext.builder(CONTEXT_NAME).build(); this.counter = ContextAwareMetricFactory.DEFAULT_CONTEXT_AWARE_COUNTER_FACTORY.newMetric( this.context, RECORDS_PROCESSED); this.meter = ContextAwareMetricFactory.DEFAULT_CONTEXT_AWARE_METER_FACTORY.newMetric( this.context, RECORD_PROCESS_RATE); this.histogram = ContextAwareMetricFactory.DEFAULT_CONTEXT_AWARE_HISTOGRAM_FACTORY.newMetric( this.context, RECORD_SIZE_DISTRIBUTION); this.timer = ContextAwareMetricFactory.DEFAULT_CONTEXT_AWARE_TIMER_FACTORY.newMetric( this.context, TOTAL_DURATION); }
/** * This is equivalent to {@link #contextAwareTimer(String)}. */ @Override public ContextAwareTimer timer(String name) { return contextAwareTimer(name); }
/** * Sets the value of the 'timestamp' field. * Time at which metrics were reported. * @param value The value of 'timestamp'. * @return This builder. */ public org.apache.gobblin.metrics.MetricReport.Builder setTimestamp(long value) { validate(fields()[1], value); this.timestamp = value; fieldSetFlags()[1] = true; return this; }
/** * Sets the value of the 'timestamp' field. * Time at which metrics were reported. * @param value The value of 'timestamp'. * @return This builder. */ public org.apache.gobblin.metrics.FlatGobblinMetric.Builder setTimestamp(long value) { validate(fields()[1], value); this.timestamp = value; fieldSetFlags()[1] = true; return this; }
/** * This is equivalent to {@link #contextAwareMeter(String)}. */ @Override public Meter meter(String name) { return contextAwareMeter(name); }
/** * See {@link com.codahale.metrics.MetricRegistry#getHistograms(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, Histogram> getHistograms(MetricFilter filter) { return this.innerMetricContext.getHistograms(filter); }
/** * See {@link com.codahale.metrics.MetricRegistry#getMeters()}. * * <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, Meter> getMeters() { return this.innerMetricContext.getMeters(MetricFilter.ALL); }
/** * Clears the value of the 'name' field. * Event name. * @return This builder. */ public org.apache.gobblin.metrics.GobblinTrackingEvent.Builder clearName() { name = null; fieldSetFlags()[2] = false; return this; }
/** * Creates a new Metric RecordBuilder. * @return A new Metric RecordBuilder */ public static org.apache.gobblin.metrics.Metric.Builder newBuilder() { return new org.apache.gobblin.metrics.Metric.Builder(); }
/** * Checks whether the 'value' field has been set. * Metric value. * @return True if the 'value' field has been set, false otherwise. */ public boolean hasValue() { return fieldSetFlags()[1]; }
/** * See {@link com.codahale.metrics.MetricRegistry#getGauges(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, Gauge> getGauges(MetricFilter filter) { return this.innerMetricContext.getGauges(filter); }
/** * Creates a new MetricReport RecordBuilder by copying an existing Builder. * @param other The existing builder to copy. * @return A new MetricReport RecordBuilder */ public static org.apache.gobblin.metrics.MetricReport.Builder newBuilder(org.apache.gobblin.metrics.MetricReport.Builder other) { return new org.apache.gobblin.metrics.MetricReport.Builder(other); }
/** * Creates a new FlatGobblinMetric RecordBuilder by copying an existing Builder. * @param other The existing builder to copy. * @return A new FlatGobblinMetric RecordBuilder */ public static org.apache.gobblin.metrics.FlatGobblinMetric.Builder newBuilder(org.apache.gobblin.metrics.FlatGobblinMetric.Builder other) { return new org.apache.gobblin.metrics.FlatGobblinMetric.Builder(other); }
/** * Clears the value of the 'timestamp' field. * Time at which metrics were reported. * @return This builder. */ public org.apache.gobblin.metrics.FlatGobblinMetric.Builder clearTimestamp() { fieldSetFlags()[1] = false; return this; }
/** * Sets the value of the 'metrics' field. * Array of metrics in this report. * @param value The value of 'metrics'. * @return This builder. */ public org.apache.gobblin.metrics.MetricReport.Builder setMetrics(java.util.List<org.apache.gobblin.metrics.Metric> value) { validate(fields()[2], value); this.metrics = value; fieldSetFlags()[2] = true; return this; }
/** * Sets the value of the 'metricValue' field. * The value of this metric. * @param value The value of 'metricValue'. * @return This builder. */ public org.apache.gobblin.metrics.FlatGobblinMetric.Builder setMetricValue(double value) { validate(fields()[3], value); this.metricValue = value; fieldSetFlags()[3] = true; return this; }
/** * Checks whether the 'metadata' field has been set. * Event metadata. * @return True if the 'metadata' field has been set, false otherwise. */ public boolean hasMetadata() { return fieldSetFlags()[3]; }