NIFI-16321 Add Attribute Handling for Counters and Gauges - #11648
Conversation
ce4d7a4 to
9d492b2
Compare
- Upgraded NiFi API from 2.11.0 to 2.12.0 - Added new adjustCounter and recordGauge methods to ProcessSession classes
9d492b2 to
a9f922a
Compare
|
The PR body is NIFI-16321. Text is 16321, link is 16231 (Pierre’s dependency bump, already resolved). The feature branch is also named NIFI-16231. Easy copy-paste; worth fixing the markdown so Jira/GitHub linking is not a mess. Branch rename is optional. |
|
Mock runner never exercises session-committed counters. testAdjustCounter always uses true / CommitTiming.NOW. Gauges have both NOW and SESSION_COMMITTED. StandardProcessSessionTest covers commit-time counters; MockProcessSession does not. A one-liner processor that calls adjustCounter(..., CommitTiming.SESSION_COMMITTED) would catch a commit/rollback bug in the mock. SharedSessionState.getGaugeValues(name) returns a live ArrayList; the attributed overload returns List.copyOf. Callers of the old method can mutate the store. Pre-existing flavor of leak, now more visible. Cheap to return List.copyOf(gaugeValues) on both. |
Thanks, yes, I noticed this after I opened the pull request, then fixed the commit and description, although the branch name is the same, but that is transitory. |
pvillard31
left a comment
There was a problem hiding this comment.
Changes are looking good, thanks @exceptionfactory
Summary
NIFI-16321 Adds handling for the Map of attributes to the
adjustCounterandrecordGaugemethods in implementations ofProcessSessionacross the application.Changes incorporate upgrading the NiFi API from 2.11.0 to 2.12.0, introducing the new signatures for the metrics tracking methods. Adjustments include modifications to several tests to verify handling of attributes passed to these
ProcessSessionmethods.Tracking
Please complete the following tracking steps prior to pull request creation.
Issue Tracking
Pull Request Tracking
NIFI-00000NIFI-00000VerifiedstatusPull Request Formatting
mainbranchVerification
Please indicate the verification steps performed prior to pull request creation.
Build
./mvnw clean install -P contrib-checkLicensing
LICENSEandNOTICEfilesDocumentation