فهرست منبع

Se pasa a giga los consumos.

Maximiliano Schvindt 7 سال پیش
والد
کامیت
b548b92485
1فایلهای تغییر یافته به همراه5 افزوده شده و 2 حذف شده
  1. 5 2
      Command/FiberhomePonOctetsCommand.php

+ 5 - 2
Command/FiberhomePonOctetsCommand.php

@@ -118,9 +118,12 @@ class FiberhomePonOctetsCommand extends BaseCommand
         $oltBandwidth["{$subId}_inbandwidth_olt"] = "{$totalIn}|g";
         $oltBandwidth["{$subId}_outbandwidth_olt"] = "{$totalOut}|g";
         
+        $div = 1073741824; //bytes => giga
+        $consIn = number_format(($totalConsIn / $div),3);
+        $consOut = number_format(($totalConsOut / $div),3);
         $oltConsumption = array();
-        $oltConsumption["{$subId}_inconsumption_olt"] = "{$totalConsIn}|g";
-        $oltConsumption["{$subId}_outconsumption_olt"] = "{$totalConsOut}|g";
+        $oltConsumption["{$subId}_inconsumption_olt"] = "{$consIn}|g";
+        $oltConsumption["{$subId}_outconsumption_olt"] = "{$consOut}|g";
 
         $statsdService = $this->getContainer()->get('statsd');
         $statsdService->send($oltBandwidth);