Uploaded image for project: 'Cost Management'
  1. Cost Management
  2. COST-5738

Requests total values are duplicated

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Normal Normal
    • 2024-Nov-29, 2024Q4
    • None
    • None
    • None

      The total memory request and total CPU request are double the expected value, running test_api_ocp_virtual_machines_report_content will result in a failure where those individual totals are expected to have value 17.0, but API returns 34.0

      Example API call:

       

      http://localhost:8000/api/cost-management/v1/reports/openshift/resources/virtual-machines/?filter[time_scope_value]=-1&filter[cluster]=ocp_static_cluster_0

       

      Requests total field:

      "request": { 
        "cpu": { "value": 34.0, "units": "Core" }, 
        "memory": { "value": 34.0, "units": "GiB" } 
      }
      

      Individual totals for all VMs returned by the API call:

      "request": {
        "cpu": {
        "value": 6.0,
        "units": "Core"
       },
        "memory": {
        "value": 6.0,
        "units": "GiB"
       }
      }

       

      "request": {
        "cpu": {
        "value": 6.0,
        "units": "Core"
       },
        "memory": {
        "value": 6.0,
        "units": "GiB"
       }
      }
      "request": {
        "cpu": {
        "value": 5.0,
        "units": "Core"
       },
        "memory": {
        "value": 5.0,
        "units": "GiB"
       }
      }

      You can see each of those adds up to 17.0 total, but we get this duplicated in the meta total field. 
      To reproduce, you can run test_api_ocp_virtual_machines_report_content test and see the failure.

       

       

              myersco Cody Myers
              dchorvat@redhat.com Daniel Chorvatovic
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

                Created:
                Updated:
                Resolved: