Commit 6e37cd649e65d91d3ba82a4c146d95f32c343a71
1 parent
2f8b0101
Exists in
master
and in
1 other branch
Indicador 18 - Quantidade de uso de memoria e porcentagem de cpu
Showing
1 changed file
with
16 additions
and
0 deletions
Show diff stats
rn/MdEstatisticasColetarRN.php
@@ -28,6 +28,8 @@ class MdEstatisticasColetarRN extends InfraRN { | @@ -28,6 +28,8 @@ class MdEstatisticasColetarRN extends InfraRN { | ||
28 | 'quantidadeUsuarios' => $this->obterQuantidadeUsuarios(), | 28 | 'quantidadeUsuarios' => $this->obterQuantidadeUsuarios(), |
29 | 'quantidadeDocumentosInternos' => $this->obterQuantidadeDocumentosInternos(), | 29 | 'quantidadeDocumentosInternos' => $this->obterQuantidadeDocumentosInternos(), |
30 | 'quantidadeDocumentosExternos' => $this->obterQuantidadeDocumentosExternos(), | 30 | 'quantidadeDocumentosExternos' => $this->obterQuantidadeDocumentosExternos(), |
31 | + 'quantidadeMemoria' => $this->obterUsoMemoria(), | ||
32 | + 'porcentagemCPU' => $this->obterUsoCPU(), | ||
31 | 'estrategiaCessao' => $this->obterEstrategiaCessao(), | 33 | 'estrategiaCessao' => $this->obterEstrategiaCessao(), |
32 | 'tamanhoDatabase' => $this->obterTamanhoDataBase(), | 34 | 'tamanhoDatabase' => $this->obterTamanhoDataBase(), |
33 | 'tabelasTamanhos' => $this->obterTamanhoTabelas(), | 35 | 'tabelasTamanhos' => $this->obterTamanhoTabelas(), |
@@ -349,6 +351,20 @@ class MdEstatisticasColetarRN extends InfraRN { | @@ -349,6 +351,20 @@ class MdEstatisticasColetarRN extends InfraRN { | ||
349 | InfraDebug::getInstance()->gravar('SEI26 - Sistemas Operacionais dos Clientes: ' . json_encode($sistemas), InfraLog::$INFORMACAO); | 351 | InfraDebug::getInstance()->gravar('SEI26 - Sistemas Operacionais dos Clientes: ' . json_encode($sistemas), InfraLog::$INFORMACAO); |
350 | return $sistemas; | 352 | return $sistemas; |
351 | } | 353 | } |
354 | + private function obterUsoMemoria(){ | ||
355 | + $memoria = memory_get_usage(); | ||
356 | + InfraDebug::getInstance()->gravar('SEI18 - Quantidade de byte de uso de memoria: ' . json_encode($memoria), InfraLog::$INFORMACAO); | ||
357 | + return $memoria; | ||
358 | + } | ||
359 | + private function obterUsoCPU(){ | ||
360 | + $load = sys_getloadavg(); | ||
361 | + $uso = null; | ||
362 | + if ($load) { | ||
363 | + $uso = $load[0]; | ||
364 | + } | ||
365 | + InfraDebug::getInstance()->gravar('SEI18 - Porcentagem de uso de CPU: ' . json_encode($uso), InfraLog::$INFORMACAO); | ||
366 | + return $uso; | ||
367 | + } | ||
352 | 368 | ||
353 | } | 369 | } |
354 | ?> | 370 | ?> |