|
@@ -374,6 +374,7 @@ class ZteService
|
|
|
$t1 = time();
|
|
|
$totalConsOut = $totalConsIn = $totalIn = $totalOut = 0;
|
|
|
$bandwidthCached = $this->redisHelper->getData($keyOltPonBandwidth, true);
|
|
|
+ $newBandwidth = $bandwidthCached;
|
|
|
foreach($dataCached as $index => $pon) {
|
|
|
|
|
|
if(isset($pon['nexo'])){
|
|
@@ -385,12 +386,12 @@ class ZteService
|
|
|
(isset($inOctets[$realIndex]))? $in1 = $inOctets[$realIndex] : $in1 = 0;
|
|
|
(isset($outOctets[$realIndex]))? $out1 = $outOctets[$realIndex] : $out1 = 0;
|
|
|
|
|
|
- if(isset($bandwidthCached[$index])) {
|
|
|
- $t0 = $bandwidthCached[$index]['t'];
|
|
|
- $in0 = $bandwidthCached[$index]['inOct'];
|
|
|
- $out0 = $bandwidthCached[$index]['outOct'];
|
|
|
- $inAcc = $bandwidthCached[$index]['inAcc'];
|
|
|
- $outAcc = $bandwidthCached[$index]['outAcc'];
|
|
|
+ if(isset($bandwidthCached[$realIndex])) {
|
|
|
+ $t0 = $bandwidthCached[$realIndex]['t'];
|
|
|
+ $in0 = $bandwidthCached[$realIndex]['inOct'];
|
|
|
+ $out0 = $bandwidthCached[$realIndex]['outOct'];
|
|
|
+ $inAcc = $bandwidthCached[$realIndex]['inAcc'];
|
|
|
+ $outAcc = $bandwidthCached[$realIndex]['outAcc'];
|
|
|
|
|
|
$inBandwidth = $outBandwidth = 0;
|
|
|
|
|
@@ -426,13 +427,13 @@ class ZteService
|
|
|
$totalConsOut += $outAcc;
|
|
|
$totalConsIn += $inAcc;
|
|
|
|
|
|
- $bandwidthCached[$index] = array('t' => $t1, 'inOct' => $in1, 'outOct' => $out1, 'inAcc' => $inAcc, 'outAcc' => $outAcc, 'inBand' => $inBandwidth, 'outBand' => $outBandwidth);
|
|
|
+ $newBandwidth[$realIndex] = array('t' => $t1, 'inOct' => $in1, 'outOct' => $out1, 'inAcc' => $inAcc, 'outAcc' => $outAcc, 'inBand' => $inBandwidth, 'outBand' => $outBandwidth);
|
|
|
} else {
|
|
|
- $bandwidthCached[$index] = array('t' => $t1, 'inOct' => $in1, 'outOct' => $out1, 'inAcc' => 0, 'outAcc' => 0, 'inBand' => 0, 'outBand' => 0);
|
|
|
+ $newBandwidth[$realIndex] = array('t' => $t1, 'inOct' => $in1, 'outOct' => $out1, 'inAcc' => 0, 'outAcc' => 0, 'inBand' => 0, 'outBand' => 0);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- $this->redisHelper->setData($keyOltPonBandwidth, $bandwidthCached, true);
|
|
|
+ $this->redisHelper->setData($keyOltPonBandwidth, $newBandwidth, true);
|
|
|
|
|
|
$oltBandwidth = array();
|
|
|
$oltBandwidth["{$subId}_inbandwidth_olt"] = "{$totalIn}|g";
|