Esempio n. 1
0
int
get_num_from_key (int data_nkey, GModule module, GMetric metric)
{
  GHashTable *ht = NULL;
  GStorageMetrics *metrics;

  metrics = get_storage_metrics_by_module (module);
  /* bandwidth modules */
  switch (metric) {
  case MTRC_HITS:
    ht = metrics->hits;
    break;
  case MTRC_VISITORS:
    ht = metrics->visitors;
    break;
  default:
    ht = NULL;
  }

  if (ht == NULL)
    return 0;

  return get_int_from_int_key (ht, data_nkey);
}
Esempio n. 2
0
int
get_num_from_key (int data_nkey, GModule module, GSMetric metric)
{
  TCADB *adb = NULL;
  GStorageMetrics *metrics;

  metrics = get_storage_metrics_by_module (module);
  /* bandwidth modules */
  switch (metric) {
  case MTRC_HITS:
    adb = metrics->hits;
    break;
  case MTRC_VISITORS:
    adb = metrics->visitors;
    break;
  default:
    adb = NULL;
  }

  if (adb == NULL)
    return 0;

  return get_int_from_int_key (adb, data_nkey);
}