cloudstack icon indicating copy to clipboard operation
cloudstack copied to clipboard

Enhancement in the accuracy of the logs regarding the capacity, usage, and threshold of secondary storages

Open lucas-a-martins opened this issue 1 year ago • 4 comments

Description

The capacity and usage values from secondary storage shown in the logs lack accuracy due to the absence of decimal places, creating cases where the value is rounded down even if it is close to the higher number (e.g., 49.90 GB being shown as 49GB).

This pull request addresses this issue by adding two decimal places to capacity and usage values. Additionally, in order to standardize, the threshold value, which was more accurate than necessary, was reduced to only two decimal places.

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)
  • [x] Enhancement (improves an existing feature and functionality)
  • [ ] Cleanup (Code refactoring and cleanup, that may add test cases)
  • [ ] build/CI

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • [ ] Major
  • [x] Minor

How Has This Been Tested?

I tested by registering a template and verifying the logs.

Before changes:

2024-05-03T19:33:48,616 DEBUG [c.c.s.StatsCollector] (secstorage-1:[ctx-391b7254]) (logid:bcdb0d20) Verifying image storage [1]. Capacity: total=[58 GB], used=[4 GB], threshold=[89.99999761581421%].

After changes:

2024-05-03T18:12:37,198 DEBUG [c.c.s.StatsCollector] (secstorage-1:[ctx-e10bb7c0]) (logid:f8f066d7) Verifying image storage [1]. Capacity: total=[58.80 GB], used=[4.10 GB], threshold=[90.00%].

lucas-a-martins avatar May 06 '24 17:05 lucas-a-martins

Codecov Report

Attention: Patch coverage is 0% with 6 lines in your changes missing coverage. Please review.

Project coverage is 15.53%. Comparing base (cea4801) to head (64cf98f). Report is 4 commits behind head on main.

Files Patch % Lines
...src/main/java/com/cloud/server/StatsCollector.java 0.00% 6 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##               main    #9043    +/-   ##
==========================================
  Coverage     15.53%   15.53%            
- Complexity    11967    11970     +3     
==========================================
  Files          5492     5492            
  Lines        480934   480948    +14     
  Branches      60876    61806   +930     
==========================================
+ Hits          74711    74732    +21     
+ Misses       397962   397954     -8     
- Partials       8261     8262     +1     
Flag Coverage Δ
uitests 4.16% <ø> (-0.01%) :arrow_down:
unittests 16.30% <0.00%> (+<0.01%) :arrow_up:

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

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar May 07 '24 07:05 codecov-commenter

@blueorangutan package

DaanHoogland avatar May 07 '24 07:05 DaanHoogland

@DaanHoogland a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

blueorangutan avatar May 07 '24 07:05 blueorangutan

Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 9558

blueorangutan avatar May 07 '24 08:05 blueorangutan

@blueorangutan package

DaanHoogland avatar Jul 13 '24 19:07 DaanHoogland

@DaanHoogland a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

blueorangutan avatar Jul 13 '24 19:07 blueorangutan

Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 10348

blueorangutan avatar Jul 13 '24 20:07 blueorangutan

@blueorangutan test

DaanHoogland avatar Jul 16 '24 18:07 DaanHoogland

@DaanHoogland a [SL] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

blueorangutan avatar Jul 16 '24 18:07 blueorangutan

[SF] Trillian Build Failed (tid-10881)

blueorangutan avatar Jul 16 '24 19:07 blueorangutan

[SF] Trillian test result (tid-10903) Environment: kvm-alma9 (x2), Advanced Networking with Mgmt server a9 Total time taken: 50984 seconds Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr9043-t10903-kvm-alma9.zip Smoke tests completed. 136 look OK, 1 have errors, 0 did not run Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_06_purge_expunged_vm_background_task Failure 340.11 test_purge_expunged_vms.py

blueorangutan avatar Jul 18 '24 23:07 blueorangutan

[SF] Trillian test result (tid-10910) Environment: kvm-ol8 (x2), Advanced Networking with Mgmt server ol8 Total time taken: 51451 seconds Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr9043-t10910-kvm-ol8.zip Smoke tests completed. 136 look OK, 1 have errors, 0 did not run Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_06_purge_expunged_vm_background_task Failure 338.66 test_purge_expunged_vms.py

blueorangutan avatar Jul 19 '24 04:07 blueorangutan

@FelipeM525 @gpordeus , any testing done other than @lucas-a-martins ' own testing?

DaanHoogland avatar Jul 19 '24 08:07 DaanHoogland

@blueorangutan package

JoaoJandre avatar Jul 24 '24 12:07 JoaoJandre

@JoaoJandre a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

blueorangutan avatar Jul 24 '24 12:07 blueorangutan

Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 10456

blueorangutan avatar Jul 24 '24 13:07 blueorangutan