[ISSUE-6491]: Fix Error assertion details for InfluxDB Backend Listener #6492
+38
−9
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR addresses the issue where the InfluxDB Backend Listener fails to capture detailed error information, particularly assertion failures. The current implementation only creates
ErrorMetric
objects based on HTTP response codes, completely ignoring assertion failures which results in loss of valuable debugging information.Key Changes:
SamplerMetric.add()
method to handle both HTTP response failures and assertion failuresErrorMetric
objects fromAssertionResult
with assertion name and failure messageErrorMetric
class to handle assertion failuresMotivation and Context
The InfluxDB Backend Listener currently provides limited error information, making it difficult for users to debug test failures. When assertion failures occur, they are completely ignored in error metrics, resulting in:
This fix ensures that all types of errors (HTTP response failures and assertion failures) are properly captured and reported in the InfluxDB metrics, providing complete error visibility for better debugging and monitoring.
Related Issue: ISSUE-6491
How Has This Been Tested?
Testing Environment:
Test Scenarios:
Test Results:
Screenshots :
Before Fix:

After Fix:

Types of changes
Checklist:
Files Modified:
src/components/src/main/java/org/apache/jmeter/visualizers/backend/SamplerMetric.java
add()
methodsrc/components/src/main/java/org/apache/jmeter/visualizers/backend/ErrorMetric.java
AssertionResult