-
Notifications
You must be signed in to change notification settings - Fork 29
Customize HTTPJSON record for Elastic #402
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR customizes the HTTPJSON record formatting in ReFrame to ensure integer performance values are cast to float type for Elastic compatibility. The change addresses an issue where performance values were being serialized as integers in JSON output despite being converted to floats in the data processing.
- Implements a custom JSON formatter function to explicitly cast
check_perf_value
andcheck_perf_ref
to float - Adds debug output and configuration to use the custom formatter in the HTTPJSON logging handler
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
What's the status of this PR? (Asking because I'd love to see it merged) @ekouts do you have any comments on the changes here? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jgphpc , as far as I can tell, the custom httpjson formater works as expected. It will not change what is in the json report, only what reframe sends to elastic. And you can see that happens in the httpjson_record_<ts>.json
files, when debug is enabled. At least it looks like it's working for my test. 🤔 Could you send me a specific test that produces an int in httpjson_record_<ts>.json
?
config/common.py
Outdated
# print(data["check_perf_value"]) | ||
# print(data["check_perf_ref"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# print(data["check_perf_value"]) | |
# print(data["check_perf_ref"]) |
config/common.py
Outdated
'rfm_ci_pipeline': os.getenv("CI_PIPELINE_URL", "#"), | ||
'rfm_ci_project': os.getenv("CI_PROJECT_PATH", "Unknown CI Project") | ||
}, | ||
'debug': True, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the debug mode before merging.
any test that use int as perf. value
common.py prints
data["check_perf_value"]
:which is what I want (int -> float) BUT
will return
7
and
will return
"check_perf_value": 7,
instead of
7.0
Same issue with check_perf_ref
💣 jq-1.6 .* httpjson_record_1759920609851.json |grep check_perf_value
✅ ./jq-1.8.1 .* httpjson_record_1759920609851.json |grep check_perf_value