Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Always separate decimals by a dot in metrics response #10699

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

Draft
wants to merge 1 commit into
base: 4.19
Choose a base branch
from

Conversation

winterhazel
Copy link
Member

@winterhazel winterhazel commented Apr 11, 2025

Description

Depending on the Management Server's Locale, listVirtualMachinesUsageHistory may return decimal values separated by a comma in the cpuused field; however, the UI expects that this decimal is separated by a dot. In this situation, the metrics page will not show the CPU utilization graph properly (see #10672).

This PR fixes this issue by always formatting the decimal value separated by a dot.

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • build/CI
  • test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

  1. Initially, my Locale was set to English
  2. I left a VM running for some time, and left the MS collecting utilization metrics
  3. I accessed the VM's metrics page, and verified that the graphs were shown properly
  4. I changed my MS's Locale to Italian
  5. I accessed the VM's metrics page

Before the patch, the CPU utilization graph would not be shown properly in step 4 because the decimal value in cpuused was being separated with a comma. After the patch, the graphs are shown properly because the value always gets separated with a dot.

@winterhazel
Copy link
Member Author

@blueorangutan package

@Pearl1594 Pearl1594 added this to the 4.19.3 milestone Apr 11, 2025
@Pearl1594 Pearl1594 moved this to In Progress in ACS 4.20.1 Apr 11, 2025
Copy link

codecov bot commented Apr 11, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 15.16%. Comparing base (d32065f) to head (6bb1514).

Additional details and impacted files
@@            Coverage Diff            @@
##               4.19   #10699   +/-   ##
=========================================
  Coverage     15.16%   15.16%           
  Complexity    11327    11327           
=========================================
  Files          5415     5415           
  Lines        474849   474849           
  Branches      57914    57914           
=========================================
+ Hits          72011    72018    +7     
+ Misses       394788   394782    -6     
+ Partials       8050     8049    -1     
Flag Coverage Δ
uitests 4.28% <ø> (ø)
unittests 15.89% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@DaanHoogland
Copy link
Contributor

@winterhazel should we not deal with this in the UI in a more appropriate way? This introduces an incompatibility in the API that might break some integrations.

@winterhazel
Copy link
Member Author

@winterhazel should we not deal with this in the UI in a more appropriate way? This introduces an incompatibility in the API that might break some integrations.

@DaanHoogland compatibility-wise, yes; ideally, no.

This API has an unpredictable formatting, which is a bad behavior. A single environment can even see two responses with different formatting for the same request depending on the MS that processes it. Addressing the UI is possible and better in regards to compatibility, but it is just working around an issue that can even result in integrations that do not consider this behavior (which I think most do not) unexpectedly breaking depending on the environment.

I will modify this PR to address the UI instead and to document this behavior, so that the metrics view works for all users on the next release already, but I'll also map this issue hoping that someday we have a procedure to introduce breaking changes in order to be able to fix the underlying problem.

@DaanHoogland
Copy link
Contributor

@winterhazel , I’m not being strict in this incompatibility principle. I think this change is acceptable for v21 for instance. I prefer not to have it in 4.19.3 or 4.20.1. If it turns out a UI change would be extremely complicated, i will yield.

@winterhazel
Copy link
Member Author

@DaanHoogland well, in that case I'll make this PR target 4.21, and open another one for 4.19.3 or 4.20.1 working around this behavior in the UI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

3 participants