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

[COST-4844] Add group by storageclass to OCP volume endpoint. #5044

Merged
merged 8 commits into from
Apr 24, 2024

Conversation

myersCody
Copy link
Contributor

@myersCody myersCody commented Apr 16, 2024

Jira Ticket

COST-4844

Description

This change will add the ability to group by storage class to the OpenShift volume endpoint.

Testing

  1. Load data on this branch.
  2. Hit this url:
http://localhost:8000/api/cost-management/v1/reports/openshift/volumes/?group_by[storageclass]=*
  1. Examine Return

Example Snip it:

"data": [
        {
            "date": "2024-04-07",
            "storageclasss": [
                {
                    "storageclass": "hostpath",
                    "values": [
                        {
                            "storageclass": "hostpath",
                            "date": "2024-04-07",
                            "usage": {
                                "value": 6.094625000000002,
                                "units": "GiB-Mo"
                            },
                            "request": {
                                "value": 11.33333333333334,
                                "units": "GiB-Mo",
                                "unused": 5.238708333333337,
                                "unused_percent": 46.22389705882354
                            },
                            "capacity": {
                                "value": 11.33333333333334,
                                "units": "GiB-Mo",
                                "unused": 0.0,
                                "unused_percent": 0.0,
                                "count": 120.0,
                                "count_units": "GiB"
                            },
                            "clusters": [
                                "Test OCP on Premises"
                            ],
                            "source_uuid": [
                                "f8f3e249-0770-443f-9de3-fd7f71908d1e"
                            ],
                            "persistent_volume_claim": [
                                "multi_pvc_1_data",
                                "multi_pvc_2_data",
                                "multi_pvc_3_data",
                                "multi_pvc_4_data",
                                "multi_pvc_5_data",
                                "multi_pvc_6_data",
                                "pod_name10_data",
                                "pod_name11_data",
                                "pod_name1_data",
                                "pod_name2_data",
                                "pod_name3_data",
                                "pod_name4_data",
                                "pod_name5_data",
                                "pod_name6_data",
                                "pod_name7_data",
                                "pod_name8_data",
                                "pod_name9_data"
                            ],
                            "storage_class": [
                                "hostpath"
                            ],
                            "infrastructure": {
                                "raw": {
                                    "value": 0.0,
                                    "units": "USD"
                                },
                                "markup": {
                                    "value": 0.0,
                                    "units": "USD"
                                },
                                "usage": {
                                    "value": 28.93333333333333,
                                    "units": "USD"
                                },
                                "total": {
                                    "value": 28.93333333333333,
                                    "units": "USD"
                                }
                            },
                            "supplementary": {
                                "raw": {
                                    "value": 0.0,
                                    "units": "USD"
                                },
                                "markup": {
                                    "value": 0.0,
                                    "units": "USD"
                                },
                                "usage": {
                                    "value": 0.17427958333333,
                                    "units": "USD"
                                },
                                "total": {
                                    "value": 0.17427958333333,
                                    "units": "USD"
                                }
                            },
                            "cost": {
                                "raw": {
                                    "value": 0.0,
                                    "units": "USD"
                                },
                                "markup": {
                                    "value": 0.0,
                                    "units": "USD"
                                },
                                "usage": {
                                    "value": 29.10761291666666,
                                    "units": "USD"
                                },
                                "total": {
                                    "value": 29.10761291666666,
                                    "units": "USD"
                                }
                            }
                        }
                    ]
                },

Release Notes

  • proposed release note
* [COST-4844](https://issues.redhat.com/browse/COST-4844) Support group by storage class for the OCP volume endpoint

@myersCody myersCody requested review from a team as code owners April 16, 2024 18:18
@myersCody myersCody added the smoke-tests pr_check will build the image and run minimal required smokes label Apr 16, 2024
@myersCody
Copy link
Contributor Author

/retest

Copy link

codecov bot commented Apr 16, 2024

Codecov Report

Merging #5044 (14f2b25) into main (9e1aa1c) will increase coverage by 0.0%.
The diff coverage is 100.0%.

Additional details and impacted files
@@          Coverage Diff          @@
##            main   #5044   +/-   ##
=====================================
  Coverage   94.1%   94.1%           
=====================================
  Files        377     377           
  Lines      31330   31331    +1     
  Branches    3714    3714           
=====================================
+ Hits       29491   29492    +1     
  Misses      1172    1172           
  Partials     667     667           

@myersCody myersCody enabled auto-merge (squash) April 24, 2024 15:41
@myersCody myersCody merged commit ac27436 into main Apr 24, 2024
11 checks passed
@myersCody myersCody deleted the COST-4844-group-by-storageclass branch April 24, 2024 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
smoke-tests pr_check will build the image and run minimal required smokes smokes-required
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants