Support from Acquia helps fund testing for Drupal Acquia logo

Comments

MasatoTakada created an issue. See original summary.

MasatoTakada’s picture

Status: Active » Needs review
FileSize
10.12 KB

@yas @Masami

I uploaded a patch for the bugs.
So, please review it.

yas’s picture

@masatotakada

Thank you for fixing the issue.

+++ b/modules/cloud_budget/src/Plugin/cloud_cost_storage/CloudCostStorageBase.php
@@ -110,10 +110,10 @@ abstract class CloudCostStorageBase extends CloudPluginBase implements CloudCost
+    $entities = $this->entityTypeManager->getStorage($entity_type_id)->loadByproperties([]);

Is this fix including the patch at #3163708-3?

MasatoTakada’s picture

FileSize
0 bytes

@yas

Yes, it is including, So I just removed that part from my patch.
Please review it.

yas’s picture

Issue summary: View changes
Status: Needs review » Needs work

@masatotakada

+++ b/modules/cloud_service_providers/k8s/src/Plugin/cloud_cost_storage/K8sCloudCostStoragePlugin.php
@@ -111,19 +111,27 @@ class K8sCloudCostStoragePlugin extends CloudCostStorageBase {
           $result[$label][$time_range]['cnt'] += 1;

@@ -134,22 +142,22 @@ class K8sCloudCostStoragePlugin extends CloudCostStorageBase {
+          $avg_cost = (float) ($value['total_cost'] / $value['cnt']);
...
+          $cpu_usage_avg = (float) ($value['resources']['cpu_usage'] / $value['cnt']);
...
+          $memory_usage_avg = (float) ($value['resources']['memory_usage'] / $value['cnt']);
...
+          $pod_usage_avg = (float) ($value['resources']['pod_usage'] / $value['cnt']);

Can you change 'cnt' to 'count'?

MasatoTakada’s picture

Issue summary: View changes
FileSize
10.15 KB

@yas

Oh, sorry that I uploaded nothing file.
I just re uploaded my patch including your tiny requirement.

yas’s picture

Issue summary: View changes
Status: Needs work » Needs review
yas’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community

@masatotakada

Thank you for the update. I'll merge the patch to 8.x-2.x and 3.x and close this issue as Fixed.

  • yas committed 17eb1ef on 8.x-2.x authored by MasatoTakada
    Issue #3163826 by MasatoTakada, yas: Fix the bug in Resource and Cost...

  • yas committed 876a284 on 3.x authored by MasatoTakada
    Issue #3163826 by MasatoTakada, yas: Fix the bug in Resource and Cost...
yas’s picture

Status: Reviewed & tested by the community » Fixed

@masatotakada

Thank you for the update. I'll merge the patch to 8.x-2.x and 3.x and close this issue as Fixed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.