Commit a39e56aec5791c1d8e4a0de16a2f9c9b42ba6adc
1 parent
72864e61
Exists in
master
and in
1 other branch
Indicador 3 - Obtendo tamanho do database quando mysql
Showing
1 changed file
with
16 additions
and
1 deletions
Show diff stats
rn/MdEstatisticasColetarRN.php
@@ -31,7 +31,8 @@ class MdEstatisticasColetarRN extends InfraRN { | @@ -31,7 +31,8 @@ class MdEstatisticasColetarRN extends InfraRN { | ||
31 | 'quantidadeDocumentosExternos' => $this->obterQuantidadeDocumentosExternos(), | 31 | 'quantidadeDocumentosExternos' => $this->obterQuantidadeDocumentosExternos(), |
32 | 'quantidadeDocumentosExternosPorExtensao' => $this->obterQuantidadeDocumentosExternosPorExtensao(), | 32 | 'quantidadeDocumentosExternosPorExtensao' => $this->obterQuantidadeDocumentosExternosPorExtensao(), |
33 | 'estrategiaCessao' => $this->obterEstrategiaCessao(), | 33 | 'estrategiaCessao' => $this->obterEstrategiaCessao(), |
34 | - 'versaoMemcached' => $this->obterVersaoMemcached() | 34 | + 'versaoMemcached' => $this->obterVersaoMemcached(), |
35 | + 'tamanhoDatabase' => $this->obterTamanoDataBase() | ||
35 | ); | 36 | ); |
36 | 37 | ||
37 | return $indicadores; | 38 | return $indicadores; |
@@ -229,5 +230,19 @@ class MdEstatisticasColetarRN extends InfraRN { | @@ -229,5 +230,19 @@ class MdEstatisticasColetarRN extends InfraRN { | ||
229 | return $versao; | 230 | return $versao; |
230 | } | 231 | } |
231 | 232 | ||
233 | + private function obterTamanoDatabase(){ | ||
234 | + $sgbd = $this->obterTipoSGBD(); | ||
235 | + $query = ''; | ||
236 | + if ($sgbd == 'MySql') { | ||
237 | + $query = "SELECT table_schema, SUM(data_length + index_length) as tamanho FROM information_schema.TABLES WHERE table_schema = 'sei' GROUP BY table_schema"; | ||
238 | + } | ||
239 | + $rs = BancoSEI::getInstance()->consultarSql($query); | ||
240 | + $tamanho = (count($rs) && isset($rs[0]['tamanho'])) ? $rs[0]['tamanho'] : 0; | ||
241 | + | ||
242 | + InfraDebug::getInstance()->gravar('SEI03 - Tamanho do SGBD: ' . $tamanho, InfraLog::$INFORMACAO); | ||
243 | + return $tamanho; | ||
244 | + } | ||
245 | + | ||
246 | + | ||
232 | } | 247 | } |
233 | ?> | 248 | ?> |