/** * Gauge for source split backlog in bytes. * * <p>Should only be used when there is a small, fixed set of split IDs so as not to overload * metrics backends. */ public static Gauge backlogBytesOfSplit(String splitId) { return Metrics.gauge(SOURCE_SPLITS_NAMESPACE, renderName(splitId, BACKLOG_BYTES)); }
/** * Gauge for source split backlog in elements. * * <p>Should only be used when there is a small, fixed set of split IDs so as not to overload * metrics backends. */ public static Gauge backlogElementsOfSplit(String splitId) { return Metrics.gauge(SOURCE_SPLITS_NAMESPACE, renderName(splitId, BACKLOG_ELEMENTS)); }
@SuppressWarnings("unused") @ProcessElement public void processElement(ProcessContext c) { Distribution values = Metrics.distribution(MetricsTest.class, "input"); Gauge gauge = Metrics.gauge(MetricsTest.class, "my-gauge"); Integer element = c.element(); count.inc(); values.update(element); gauge.set(12L); c.output(element); c.output(output2, element); } })
: globalHighWatermarkForBatch; final Gauge gauge = Metrics.gauge(NAMESPACE, READ_DURATION_MILLIS); final MetricsContainer container = metadata.getMetricsContainers().getContainer(stepName); try (Closeable ignored = MetricsEnvironment.scopedMetricsContainer(container)) {