Commit a409b6fa6fb6b93b43212b158e4611eebc01219b

Authored by Starlone Passos
1 parent ddc53bad

Indicador 15: Obter tamanho das tabelas

Showing 1 changed file with 17 additions and 2 deletions   Show diff stats
rn/MdEstatisticasColetarRN.php
... ... @@ -29,7 +29,8 @@ class MdEstatisticasColetarRN extends InfraRN {
29 29 'quantidadeDocumentosInternos' => $this->obterQuantidadeDocumentosInternos(),
30 30 'quantidadeDocumentosExternos' => $this->obterQuantidadeDocumentosExternos(),
31 31 'estrategiaCessao' => $this->obterEstrategiaCessao(),
32   - 'tamanhoDatabase' => $this->obterTamanoDataBase(),
  32 + 'tamanhoDatabase' => $this->obterTamanhoDataBase(),
  33 + 'tamanhoTabelas' => $this->obterTamanhoTabelas(),
33 34 'bancoSei' => $this->obterTipoSGBD(),
34 35 'servidorAplicacao' => $this->obterServidorAplicacao(),
35 36 'sistemaOperacional' => $this->obterSistemaOperacional(),
... ... @@ -237,7 +238,7 @@ class MdEstatisticasColetarRN extends InfraRN {
237 238 return $versao;
238 239 }
239 240  
240   - private function obterTamanoDatabase(){
  241 + private function obterTamanhoDatabase(){
241 242 $sgbd = $this->obterTipoSGBD();
242 243 $query = '';
243 244 if ($sgbd == 'MySql') {
... ... @@ -249,6 +250,20 @@ class MdEstatisticasColetarRN extends InfraRN {
249 250 InfraDebug::getInstance()->gravar('SEI03 - Tamanho do SGBD: ' . $tamanho, InfraLog::$INFORMACAO);
250 251 return $tamanho;
251 252 }
  253 +
  254 + private function obterTamanhoTabelas(){
  255 + $sgbd = $this->obterTipoSGBD();
  256 + $query = '';
  257 + if ($sgbd == 'MySql') {
  258 + $query = "SELECT table_name as tabela, data_length + index_length as tamanho FROM information_schema.TABLES WHERE table_schema = 'sei'";
  259 + }
  260 + $tabelas = BancoSEI::getInstance()->consultarSql($query);
  261 +
  262 + InfraDebug::getInstance()->gravar('SEI15 - Tamanho das tabelas: ' . json_encode($tabelas), InfraLog::$INFORMACAO);
  263 + return $tamanho;
  264 + }
  265 +
  266 +
252 267 private function obterVersaoSolr(){
253 268 $objConfiguracaoSEI = ConfiguracaoSEI::getInstance();
254 269 $url = $objConfiguracaoSEI->getValor('Solr','Servidor', false, 'http://localhost:8983/solr');
... ...