Skip to content
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

Add IOPS and bytes preset variables to VOLUME usage type #10326

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

lucas-a-martins
Copy link
Collaborator

Description

This PR adds the following preset variables to the activation rules of VOLUME Quota tariffs:

Disk Offering:
  • value.diskOffering.bytesReadRate: returns a long with the bytes read rate of the disk offering;

  • value.diskOffering.bytesReadBurst: returns a long with the burst bytes read rate of the disk offering;

  • value.diskOffering.bytesReadBurstLength: returns the length, in seconds, of the bytes read rate burst;

  • value.diskOffering.bytesWriteRate: returns a long with the bytes write rate of the disk offering;

  • value.diskOffering.bytesWriteBurst: returns a long with the burst bytes write rate of the disk offering;

  • value.diskOffering.bytesWriteBurstLength: returns the length, in seconds, of the bytes write rate burst;

  • value.diskOffering.iopsReadRate: returns a long with the I/O requests read rate of the disk offering;

  • value.diskOffering.iopsReadBurst: returns a long with the burst I/O requests read rate of the disk offering;

  • value.diskOffering.iopsReadBurstLength: returns the length, in seconds, of the IOPS read burst in seconds;

  • value.diskOffering.iopsWriteRate: returns a long with the I/O requests write rate of the disk offering;

  • value.diskOffering.iopsWriteBurst: returns a long with the burst I/O requests write rate of the disk offering;

  • value.diskOffering.iopsWriteBurstLength: returns the length, in seconds, of the IOPS write burst.

Volume:
  • value.volumeType: the volume type. Values can be: UNKNOWN, ROOT, SWAP, DATADISK and ISO.

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

Feature/Enhancement Scale

  • Major
  • Minor

How Has This Been Tested?

First, I executed the quotaPresetVariablesList API using the parameter usagetype=6, and it listed all the new preset variables.

Then, in the Create Quota Tariff form, I checked if the presets were available for different usage types by using them in an activation rule and pressing the Validate activation rule button. As expected, the VOLUME usage type was the only one that didn't result in an error.

Finally, for each preset variable, I created a tariff using them, and the tariff was applied in every case, as expected.

Copy link

codecov bot commented Feb 4, 2025

Codecov Report

Attention: Patch coverage is 66.97248% with 36 lines in your changes missing coverage. Please review.

Project coverage is 16.03%. Comparing base (cd81398) to head (928c043).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
...e/presetvariables/DiskOfferingPresetVariables.java 57.64% 36 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #10326      +/-   ##
============================================
+ Coverage     16.02%   16.03%   +0.01%     
- Complexity    13147    13161      +14     
============================================
  Files          5658     5659       +1     
  Lines        496312   496417     +105     
  Branches      60109    60109              
============================================
+ Hits          79527    79600      +73     
- Misses       407943   407968      +25     
- Partials       8842     8849       +7     
Flag Coverage Δ
uitests 4.01% <ø> (ø)
unittests 16.87% <66.97%> (+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.

Copy link
Contributor

@DaanHoogland DaanHoogland left a comment

Choose a reason for hiding this comment

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

clgtm

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

Successfully merging this pull request may close these issues.

3 participants