Commit 494247692d2cd425602105109115562bbb09327b
1 parent
6783a56c
Exists in
master
and in
1 other branch
Indicador 18 - Coletando espaco usado de disco
Showing
1 changed file
with
18 additions
and
0 deletions
Show diff stats
rn/MdEstatisticasColetarRN.php
... | ... | @@ -35,6 +35,7 @@ class MdEstatisticasColetarRN extends InfraRN { |
35 | 35 | $ind['quantidadeDocumentosExternos'] = $this->obterQuantidadeDocumentosExternos(); |
36 | 36 | $ind['quantidadeMemoria'] = $this->obterUsoMemoria(); |
37 | 37 | $ind['porcentagemCPU'] = $this->obterUsoCPU(); |
38 | + $ind['espacoDiscoUsado'] = $this->obterEspacoDisco(); | |
38 | 39 | $ind['estrategiaCessao'] = $this->obterEstrategiaCessao(); |
39 | 40 | $ind['tamanhoDatabase'] = $this->obterTamanhoDataBase(); |
40 | 41 | $ind['bancoSei'] = $this->obterTipoSGBD(); |
... | ... | @@ -367,6 +368,23 @@ class MdEstatisticasColetarRN extends InfraRN { |
367 | 368 | InfraDebug::getInstance()->gravar('SEI18 - Porcentagem de uso de CPU: ' . json_encode($uso), InfraLog::$INFORMACAO); |
368 | 369 | return $uso; |
369 | 370 | } |
371 | + | |
372 | + private function obterEspacoDisco() { | |
373 | + $ds = null; | |
374 | + if(php_uname('s')=='Windows NT') { | |
375 | + $unidade = substr($_SERVER['DOCUMENT_ROOT'], 0, 2); | |
376 | + if (!$unidade) { | |
377 | + $unidade = 'C:'; | |
378 | + } | |
379 | + } else { | |
380 | + $unidade = "/"; | |
381 | + } | |
382 | + $total = disk_total_space($unidade); | |
383 | + $free = disk_free_space($unidade); | |
384 | + $ds = $total - $free; | |
385 | + InfraDebug::getInstance()->gravar('SEI18 - Espaco utilizado do disco: ' . json_encode($ds), InfraLog::$INFORMACAO); | |
386 | + return $ds; | |
387 | + } | |
370 | 388 | |
371 | 389 | private function obterBancoVersao(){ |
372 | 390 | $sgbd = $this->obterTipoSGBD(); | ... | ... |