thesaurabhmhaske opened a new pull request, #6492: URL: https://github.com/apache/jmeter/pull/6492
## **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:** - Enhanced error processing logic in `SamplerMetric.add()` method to handle both HTTP response failures and assertion failures - Added support for creating `ErrorMetric` objects from `AssertionResult` with assertion name and failure message - Improved error categorization to distinguish between HTTP response errors and assertion errors - Added new constructor in `ErrorMetric` class to handle assertion failures ## **Motivation 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: - No visibility into specific assertion failure reasons - Loss of valuable debugging information - Inability to distinguish between different types of assertion failures - Poor error analysis capabilities 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](https://github.com/apache/jmeter/issues/6491) ## **How Has This Been Tested?** **Testing Environment:** - JMeter version: 5.6+ - InfluxDB Backend Listener - Test plans with various assertion types **Test Scenarios:** 1. **HTTP Response Failures Only**: Verified that HTTP response codes and messages are still properly captured 2. **Assertion Failures Only**: Tested with Response Assertion, Duration Assertion, and Size Assertion failures 3. **Mixed Failures**: Verified behavior when both HTTP response failures and assertion failures occur 4. **Multiple Assertion Failures**: Tested scenarios with multiple failed assertions in a single sample 5. **Transaction Controllers**: Verified proper error handling with Transaction Controllers and sub-samples 6. **Backward Compatibility**: Ensured existing functionality remains intact **Test Results:** - ✅ Assertion failures now appear in InfluxDB metrics with assertion names and failure messages - ✅ HTTP response failures continue to work as before - ✅ Error categorization properly distinguishes between assertion and HTTP errors - ✅ No regression in existing functionality - ✅ Backward compatibility maintained ## **Screenshots (if appropriate):** Before Fix: <img width="855" height="206" alt="image" src="https://github.com/user-attachments/assets/4958686c-3499-47d8-a150-81ad6821996f" /> After Fix: <img width="1005" height="179" alt="image" src="https://github.com/user-attachments/assets/5017763b-a3f9-4e51-8ba2-5f9c1eeb1022" /> ## **Types of changes** - [x] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) ## **Checklist:** - [x] My code follows the [code style][style-guide] of this project. - [x] I have updated the documentation accordingly. - [x] My changes generate no new warnings. - [x] I have tested my changes thoroughly. - [x] My code is self-documenting where appropriate. - [x] I have added comments to my code, particularly in hard-to-understand areas. ## **Files Modified:** 1. `src/components/src/main/java/org/apache/jmeter/visualizers/backend/SamplerMetric.java` - Enhanced error processing logic in `add()` method - Added assertion failure handling - Improved error categorization 2. `src/components/src/main/java/org/apache/jmeter/visualizers/backend/ErrorMetric.java` - Added new constructor for `AssertionResult` - Enhanced error metric creation from assertion failures -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@jmeter.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org