Skip to content

Conversation

jgphpc
Copy link
Collaborator

@jgphpc jgphpc commented Sep 19, 2025

any test that use int as perf. value

common.py prints data["check_perf_value"]:

P: elapsed_min: 7 s (r:0, l:None, u:None)
7.0 <-------- check_perf_value

which is what I want (int -> float) BUT

jq .runs[0].testcases[0].perfvalues latest.json

will return 7

and

jq . httpjson_record_*.json

will return "check_perf_value": 7,

instead of 7.0

Same issue with check_perf_ref

⚠️ ⚠️ ⚠️ jq version matters:
💣 jq-1.6 .* httpjson_record_1759920609851.json |grep check_perf_value

 "check_perf_value": 107,    # WRONG

✅ ./jq-1.8.1 .* httpjson_record_1759920609851.json |grep check_perf_value

  "check_perf_value": 107.0, # OK

@jgphpc jgphpc requested review from ekouts and Copilot September 19, 2025 15:44
Copy link

@Copilot Copilot AI left a 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 and check_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.

Jg_Piccinali added 2 commits September 19, 2025 17:46
@msimberg
Copy link
Contributor

msimberg commented Oct 8, 2025

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?

Copy link
Collaborator

@ekouts ekouts left a 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
Comment on lines 29 to 30
# print(data["check_perf_value"])
# print(data["check_perf_ref"])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# 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,
Copy link
Collaborator

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.

@jgphpc jgphpc self-assigned this Oct 8, 2025
@ekouts ekouts merged commit 0a1fa41 into eth-cscs:main Oct 8, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants