FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[Usage] Create network billing by SadiJr · Pull Request #7236 · apache/cloudstack · GitHub

Repository navigation

[Usage] Create network billing - #7236

Merged
DaanHoogland merged 15 commits into
apache:4.19from
scclouds:usage-network-billing
Apr 24, 2024
Merged

DaanHoogland merged 15 commits into
apache:4.19from
scclouds:usage-network-billing

Conversation

SadiJr commented Feb 15, 2023

Copy link
Copy Markdown
Contributor

Description

The usage of networks is not captured and saved by the Usage plugin, which makes it impossible to charge via the Quota plugin. The Usage plugin has been updated to record network events in the database. When a network is created, the event EVENT_NETWORK_CREATE is used; when a network is removed, the event EVENT_NETWORK_DELETE is used; and when a network is updated, the event EVENT_NETWORK_UPDATE is used. Also, this new type has the attributes value.state, value.id and value.name injected in the Quota plugin.

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)

Feature/Enhancement Scale or Bug Severity

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

It was tested in a local lab:

  1. I created and destroyed networks via UI;
  2. Previously, ACS did not save any network events in Usage;
  3. Now, ACS saves these events in Usage.

codecov Bot commented Feb 15, 2023 •
edited
Loading

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 13.06533% with 173 lines in your changes are missing coverage. Please review.

Project coverage is 29.90%. Comparing base (ffd5972) to head (2d9f0c4).
Report is 11 commits behind head on 4.19.

Files Patch % Lines
...java/com/cloud/usage/dao/UsageNetworksDaoImpl.java 3.03% 64 Missing ⚠️
...src/main/java/com/cloud/usage/UsageNetworksVO.java 7.31% 38 Missing ⚠️
...va/com/cloud/usage/parser/NetworksUsageParser.java 0.00% 37 Missing ⚠️
...rc/main/java/com/cloud/usage/UsageManagerImpl.java 0.00% 16 Missing ⚠️
...tionrule/presetvariables/PresetVariableHelper.java 8.33% 11 Missing ⚠️
.../schema/src/main/java/com/cloud/usage/UsageVO.java 0.00% 3 Missing ⚠️
api/src/main/java/com/cloud/event/EventTypes.java 0.00% 2 Missing ⚠️
...ck/quota/activationrule/presetvariables/Value.java 75.00% 1 Missing ⚠️
...ain/java/com/cloud/network/NetworkServiceImpl.java 88.88% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               4.19    #7236      +/-   ##
============================================
- Coverage     30.96%   29.90%   -1.06%     
+ Complexity    34304    33070    -1234     
============================================
  Files          5354     5359       +5     
  Lines        376105   376883     +778     
  Branches      54694    54833     +139     
============================================
- Hits         116454   112716    -3738     
- Misses       244336   249277    +4941     
+ Partials      15315    14890     -425     
Flag Coverage Δ
simulator-marvin-tests 23.36% <10.05%> (-1.45%) ⬇️
uitests 4.38% <ø> (-0.01%) ⬇️
unit-tests 16.56% <3.01%> (-0.03%) ⬇️

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
Copy Markdown

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

Copy link
Copy Markdown

SonarCloud Quality Gate failed.   

0 Bugs
0 Vulnerabilities
0 Security Hotspots
10 Code Smells

1.4% Coverage
3.1% Duplication

stephankruggg left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

CLGTM, not manually tested

Copy link
Copy Markdown
Contributor

SonarCloud Quality Gate failed.

0 Bugs 0 Vulnerabilities 0 Security Hotspots 10 Code Smells

1.4% Coverage 3.1% Duplication

@SadiJr 4 of those 10 code smells look more serious, can you look at those. I will review this later.

github-actions Bot commented Mar 6, 2023

Copy link
Copy Markdown

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

Copy link
Copy Markdown
Member

@SadiJr Could you please resolve the merge conflicts

Copy link
Copy Markdown

SonarCloud Quality Gate failed.   

0 Bugs
0 Vulnerabilities
0 Security Hotspots
10 Code Smells

1.4% Coverage
3.1% Duplication

Copy link
Copy Markdown
Contributor

@SadiJr for this one as well, we have to decide what to base this on and correct the upgrade path accordingly.

DaanHoogland added this to the 4.19.0.0 milestone Jun 22, 2023
DELETE FROM `cloud`.`snapshot_store_ref`
WHERE store_role = "Primary" AND store_id IN (SELECT id FROM storage_pool WHERE removed IS NOT NULL);


Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

maybe undo this delete?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

@DaanHoogland I think the file indentation is better by removing this line.

Copy link
Copy Markdown

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

BryanMLima and others added 2 commits April 23, 2024 14:11
Co-authored-by: Henrique Sato <henriquesato2003@gmail.com>
apache deleted a comment from kiranchavala Apr 24, 2024
apache deleted a comment from blueorangutan Apr 24, 2024
apache deleted a comment from blueorangutan Apr 24, 2024
apache deleted a comment from blueorangutan Apr 24, 2024
apache deleted a comment from blueorangutan Apr 24, 2024
apache deleted a comment from blueorangutan Apr 24, 2024
apache deleted a comment from blueorangutan Apr 24, 2024
apache deleted a comment from blueorangutan Apr 24, 2024
apache deleted a comment from blueorangutan Apr 24, 2024
apache deleted a comment from blueorangutan Apr 24, 2024
apache deleted a comment from blueorangutan Apr 24, 2024
apache deleted a comment from blueorangutan Apr 24, 2024
apache deleted a comment from BryanMLima Apr 24, 2024
apache deleted a comment from blueorangutan Apr 24, 2024
apache deleted a comment from blueorangutan Apr 24, 2024
apache deleted a comment from blueorangutan Apr 24, 2024
apache deleted a comment from blueorangutan Apr 24, 2024
apache deleted a comment from BryanMLima Apr 24, 2024
apache deleted a comment from blueorangutan Apr 24, 2024
apache deleted a comment from blueorangutan Apr 24, 2024
apache deleted a comment from blueorangutan Apr 24, 2024
apache deleted a comment from blueorangutan Apr 24, 2024
apache deleted a comment from blueorangutan Apr 24, 2024
apache deleted a comment from BryanMLima Apr 24, 2024
apache deleted a comment from blueorangutan Apr 24, 2024
apache deleted a comment from blueorangutan Apr 24, 2024
apache deleted a comment from blueorangutan Apr 24, 2024

Copy link
Copy Markdown
Contributor

This looks good to everyone. merging

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

No open projects

Development

Successfully merging this pull request may close these issues.


Back | FazBrowse Home | New Git URL