Adela Jaworowska-Nowak created NIFI-16453:
---------------------------------------------
Summary: Add component metric assertions to ConnectorTestRunner
Key: NIFI-16453
URL: https://issues.apache.org/jira/browse/NIFI-16453
Project: Apache NiFi
Issue Type: Improvement
Reporter: Adela Jaworowska-Nowak
Assignee: Adela Jaworowska-Nowak
{{ConnectorTestRunner}} currently cannot inspect counters and gauges emitted by
processors in a Connector’s managed flow. {{StandardConnectorMockServer}}
configures {{{}DefaultComponentMetricReporter{}}}, which discards all reported
component metrics.
Add an in-memory {{ComponentMetricReporter}} to the connector mock server and
expose metric lookup methods through {{{}ConnectorTestRunner{}}}.
The API should:
* Retrieve cumulative counter values by component ID and metric name.
* Optionally filter counters by metric attributes.
* Retrieve recorded gauge values by component ID and metric name.
* Optionally filter gauges by metric attributes.
* Return only JDK types to avoid crossing the NAR classloader boundary with
framework metric types.
* Preserve compatibility for other {{ConnectorTestRunner}} implementations
through default interface methods.
This will allow connector integration tests to assert exact metric values
instead of inferring metric emission from provenance events or other side
effects.
Acceptance Criteria
* {{StandardConnectorMockServer}} records counters and gauges in memory.
* Metrics are isolated by component instance ID.
* Counter values are accumulated correctly.
* Gauge values retain their recording order.
* Attribute-based lookups are supported.
* {{StandardConnectorTestRunner}} exposes and delegates metric lookup methods.
* Unit and connector-mock integration tests verify the behavior.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)