You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by "winterhazel (via GitHub)" <gi...@apache.org> on 2025/05/06 23:40:11 UTC

[PR] UI workaround for the inconsistent formatting of listVirtualMachinesUsageHistory [cloudstack]

winterhazel opened a new pull request, #10824:
URL: https://github.com/apache/cloudstack/pull/10824

   ### Description
   
   Depending on the Management Server's Locale, `listVirtualMachinesUsageHistory` may return decimal values separated by a comma in the `cpuused` field; however, the UI currently 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 makes the UI work around the issue by replacing commas with a dot in order to properly display the metrics page. The response formatting issue will be addressed by #10699 for the next major.
   
   ### Types of changes
   
   - [ ] Breaking change (fix or feature that would cause existing functionality to change)
   - [ ] New feature (non-breaking change which adds functionality)
   - [X] 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
   - [X] Minor
   - [ ] Trivial
   
   ### Screenshots (if appropriate):
   
   Without the patch:
   
   ![Screenshot from 2025-05-06 20-23-26](https://github.com/user-attachments/assets/cf49fc24-e574-4ef8-b724-af0fd3f12fd8)
   
   With the patch:
   
   ![Screenshot from 2025-05-06 20-26-58](https://github.com/user-attachments/assets/18a70c5a-5025-4aa0-82c7-9770794f03d9)
   
   
   ### How Has This Been Tested?
   
   0. Initially, my Locale was set to English
   1. I left a VM running for some time, and left the MS collecting utilization metrics 
   2. I accessed the VM's metrics page, and verified that the graphs were shown properly
   3. I changed my MS's Locale to Italian
   4. I accessed the VM's metrics page
   
   Before the patch, the CPU utilization graph would not be displayed properly in step 4. After the patch, the graph is displayed properly.
   


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] UI workaround for the inconsistent formatting of listVirtualMachinesUsageHistory [cloudstack]

Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on PR #10824:
URL: https://github.com/apache/cloudstack/pull/10824#issuecomment-2865560145

   I’m going to (half) trust the author as I could verify the end result but not reproduce the original issue and three reviews say the code is good.


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] UI workaround for the inconsistent formatting of listVirtualMachinesUsageHistory [cloudstack]

Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on PR #10824:
URL: https://github.com/apache/cloudstack/pull/10824#issuecomment-2857270151

   @blueorangutan ui


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] UI workaround for the inconsistent formatting of listVirtualMachinesUsageHistory [cloudstack]

Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #10824:
URL: https://github.com/apache/cloudstack/pull/10824#discussion_r2076888472


##########
ui/src/components/view/StatsTab.vue:
##########
@@ -521,7 +521,7 @@ export default {
         this.chartLabels.push(currentLabel)
 
         if (this.resourceIsVirtualMachine) {
-          cpuLine.data.push({ timestamp: currentLabel, stat: element.cpuused.split('%')[0] })
+          cpuLine.data.push({ timestamp: currentLabel, stat: element.cpuused.replace(',', '.').split('%')[0] })

Review Comment:
   [nitpick] While replacing ',' with '.' is a valid quick fix for this bug, note that String.replace only replaces the first occurrence. If there's any chance of multiple commas in the cpuused string, consider using a global replacement like replaceAll for clarity.
   ```suggestion
             cpuLine.data.push({ timestamp: currentLabel, stat: element.cpuused.replaceAll(',', '.').split('%')[0] })
   ```



-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] UI workaround for the inconsistent formatting of listVirtualMachinesUsageHistory [cloudstack]

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #10824:
URL: https://github.com/apache/cloudstack/pull/10824#issuecomment-2856584538

   ## [Codecov](https://app.codecov.io/gh/apache/cloudstack/pull/10824?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   All modified and coverable lines are covered by tests :white_check_mark:
   > Project coverage is 4.00%. Comparing base [(`f13cf59`)](https://app.codecov.io/gh/apache/cloudstack/commit/f13cf597a2e00054033ab5851db628680a64f8dc?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to head [(`f78daee`)](https://app.codecov.io/gh/apache/cloudstack/commit/f78daee573ad08cf0214caf205df824c9f78cb7d?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   > Report is 23 commits behind head on 4.19.
   
   > :exclamation:  There is a different number of reports uploaded between BASE (f13cf59) and HEAD (f78daee). Click for more details.
   > 
   > <details><summary>HEAD has 1 upload less than BASE</summary>
   >
   >| Flag | BASE (f13cf59) | HEAD (f78daee) |
   >|------|------|------|
   >|unittests|1|0|
   ></details>
   
   <details><summary>Additional details and impacted files</summary>
   
   
   ```diff
   @@              Coverage Diff              @@
   ##               4.19   #10824       +/-   ##
   =============================================
   - Coverage     15.17%    4.00%   -11.17%     
   =============================================
     Files          5415      399     -5016     
     Lines        474893    32607   -442286     
     Branches      57920     5786    -52134     
   =============================================
   - Hits          72046     1305    -70741     
   + Misses       394792    31152   -363640     
   + Partials       8055      150     -7905     
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/cloudstack/pull/10824/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [uitests](https://app.codecov.io/gh/apache/cloudstack/pull/10824/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `4.00% <ø> (-0.29%)` | :arrow_down: |
   | [unittests](https://app.codecov.io/gh/apache/cloudstack/pull/10824/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   </details>
   
   [:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/cloudstack/pull/10824?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] UI workaround for the inconsistent formatting of listVirtualMachinesUsageHistory [cloudstack]

Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland merged PR #10824:
URL: https://github.com/apache/cloudstack/pull/10824


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] UI workaround for the inconsistent formatting of listVirtualMachinesUsageHistory [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10824:
URL: https://github.com/apache/cloudstack/pull/10824#issuecomment-2857322917

   UI build: :heavy_check_mark:
   Live QA URL: https://qa.cloudstack.cloud/simulator/pr/10824 (QA-JID-613)


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] UI workaround for the inconsistent formatting of listVirtualMachinesUsageHistory [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10824:
URL: https://github.com/apache/cloudstack/pull/10824#issuecomment-2857272335

   @DaanHoogland a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org