File tree Expand file tree Collapse file tree 2 files changed +41
-0
lines changed
src/main/java/org/apache/nifi/processor Expand file tree Collapse file tree 2 files changed +41
-0
lines changed Original file line number Diff line number Diff line change 3737import org .apache .nifi .processor .io .InputStreamCallback ;
3838import org .apache .nifi .processor .io .OutputStreamCallback ;
3939import org .apache .nifi .processor .io .StreamCallback ;
40+ import org .apache .nifi .processor .metrics .CommitTiming ;
4041import org .apache .nifi .provenance .ProvenanceReporter ;
4142import org .apache .nifi .provenance .ProvenanceEventType ;
4243
@@ -253,6 +254,18 @@ default void commitAsync(Runnable onSuccess) {
253254 */
254255 void adjustCounter (String name , long delta , boolean immediate );
255256
257+ /**
258+ * Record measurement value for the named Gauge, registering the named Gauge when not present in the system.
259+ * Gauges represent a measurement at a point in time, unlike counters that track cumulative values.
260+ *
261+ * @param name Gauge name to update or register
262+ * @param value Measurement value to record
263+ * @param commitTiming Timing for when the measurement value should be committed
264+ */
265+ default void recordGauge (String name , double value , CommitTiming commitTiming ) {
266+
267+ }
268+
256269 /**
257270 * Returns the {@link FlowFile} from the work queue that is next highest priority to process.
258271 * If no FlowFiles are available, returns {@code null}.
Original file line number Diff line number Diff line change 1+ /*
2+ * Licensed to the Apache Software Foundation (ASF) under one or more
3+ * contributor license agreements. See the NOTICE file distributed with
4+ * this work for additional information regarding copyright ownership.
5+ * The ASF licenses this file to You under the Apache License, Version 2.0
6+ * (the "License"); you may not use this file except in compliance with
7+ * the License. You may obtain a copy of the License at
8+ *
9+ * http://www.apache.org/licenses/LICENSE-2.0
10+ *
11+ * Unless required by applicable law or agreed to in writing, software
12+ * distributed under the License is distributed on an "AS IS" BASIS,
13+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+ * See the License for the specific language governing permissions and
15+ * limitations under the License.
16+ */
17+ package org .apache .nifi .processor .metrics ;
18+
19+ /**
20+ * Enumeration of timing options for committing metrics
21+ */
22+ public enum CommitTiming {
23+ /** Commit metrics immediately regardless of session transaction status */
24+ NOW ,
25+
26+ /** Commit metrics on successful commit of session transaction */
27+ SESSION_COMMITTED
28+ }
You can’t perform that action at this time.
0 commit comments