soreana commented on code in PR #7007:
URL: https://github.com/apache/cloudstack/pull/7007#discussion_r1058404412


##########
plugins/integrations/prometheus/src/main/java/org/apache/cloudstack/metrics/PrometheusExporterImpl.java:
##########
@@ -156,7 +157,7 @@ private void addHostMetrics(final List<Item> metricsList, 
final long dcId, final
 
             final String cpuFactor = 
String.valueOf(CapacityManager.CpuOverprovisioningFactor.valueIn(host.getClusterId()));
             final CapacityVO cpuCapacity = 
capacityDao.findByHostIdType(host.getId(), Capacity.CAPACITY_TYPE_CPU);
-            if (cpuCapacity != null) {
+            if (cpuCapacity != null && cpuCapacity.getCapacityState() == 
CapacityState.Enabled) {

Review Comment:
   @benj-n I missed an else statement. That looks good. Ignore my comment. :-)



##########
plugins/integrations/prometheus/src/main/java/org/apache/cloudstack/metrics/PrometheusExporterImpl.java:
##########
@@ -166,7 +167,7 @@ private void addHostMetrics(final List<Item> metricsList, 
final long dcId, final
 
             final String memoryFactor = 
String.valueOf(CapacityManager.MemOverprovisioningFactor.valueIn(host.getClusterId()));
             final CapacityVO memCapacity = 
capacityDao.findByHostIdType(host.getId(), Capacity.CAPACITY_TYPE_MEMORY);
-            if (memCapacity != null) {
+            if (memCapacity != null && memCapacity.getCapacityState() == 
CapacityState.Enabled) {

Review Comment:
   @benj-n And also here.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to