示例#1
0
/* Initialize GLib hash tables */
void
init_storage (void)
{
  GModule module;

  ht_agent_keys = new_str_ht (g_free, g_free);
  ht_agent_vals = new_str_ht (g_free, g_free);
  ht_hostnames = new_str_ht (g_free, g_free);
  ht_unique_keys = new_str_ht (g_free, g_free);

  ht_storage = new_gstorage (TOTAL_MODULES);
  for (module = 0; module < TOTAL_MODULES; ++module) {
    init_tables (module);
  }
}
示例#2
0
static void
init_tables (GModule module)
{
  ht_storage[module].module = module;
  ht_storage[module].metrics = new_ht_metrics ();

  /* Initialize metrics hash tables */
  ht_storage[module].metrics->keymap = new_str_ht (g_free, g_free);
  ht_storage[module].metrics->datamap = new_int_ht (g_free, g_free);
  ht_storage[module].metrics->rootmap = new_int_ht (g_free, g_free);
  ht_storage[module].metrics->uniqmap = new_str_ht (g_free, g_free);

  ht_storage[module].metrics->hits = new_int_ht (g_free, NULL);
  ht_storage[module].metrics->visitors = new_int_ht (g_free, g_free);
  ht_storage[module].metrics->bw = new_int_ht (g_free, g_free);
  ht_storage[module].metrics->time_served = new_int_ht (g_free, g_free);
  ht_storage[module].metrics->methods = new_int_ht (g_free, g_free);
  ht_storage[module].metrics->protocols = new_int_ht (g_free, g_free);
  ht_storage[module].metrics->agents = new_int_ht (g_free, NULL);
}