Browse Source

Split taxonomy info from content info.

- orders of magnitude are typically different
- added vocabulary count as negative for terms
Frederic G. MARAND 13 years ago
parent
commit
6cf6966630
1 changed files with 18 additions and 0 deletions
  1. 18 0
      modules/munin_core/munin_core.module

+ 18 - 0
modules/munin_core/munin_core.module

@@ -86,10 +86,22 @@ function munin_core_munin_api_info() {
         '#type'     => MUNIN_API_GAUGE,
         '#negative' => 'comment_count_unpub',
       ),
+    ),
+
+    'munin_core_taxonomy' => array(
+      '#title'     => t('Core taxonomy statistics'),
+      '#info'      => t('Core statistics regarding taxonomy.'),
+      '#graph_vlabel' => t('Vocabularies (-)/Terms (+)'),
 
+      'vocab_count' => $int + array(
+        '#label'    => t('Vocabularies'),
+        '#type'     => MUNIN_API_GAUGE,
+        '#graph'    => 'no',
+      ),
       'term_count' => $int + array(
         '#label'    => t('Terms'),
         '#type'     => MUNIN_API_GAUGE,
+        '#negative' => 'vocab_count',
       ),
     ),
   );
@@ -172,9 +184,15 @@ function munin_core_munin_api_fetch($graph_name) {
             ), WATCHDOG_NOTICE);
         }
       }
+      break;
 
+    case 'munin_core_taxonomy':
       $sq = 'SELECT COUNT(*) FROM {term_data}';
       $ret['term_count'] = db_result(db_query($sq));
+
+      $sq = 'SELECT COUNT(*) FROM {vocabulary}';
+      $ret['vocab_count'] = db_result(db_query($sq));
+      break;
   }
 
   return $ret;