Changeset f59d8ed0e12bf7351fe924612229a1b69cf00fd5

Show
Ignore:
Timestamp:
01/28/08 23:02:15 (6 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1201561335 +0000
git-parent:

[fb90c74b988a187602cf743f22813de38cb8dd94]

git-author:
Theo Schlossnagle <jesus@omniti.com> 1201561335 +0000
Message:

add a generation counter to loaded checks

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/noit_poller.c

    rfb90c74 rf59d8ed  
    2020 
    2121static noit_hash_table polls = NOIT_HASH_EMPTY; 
     22static u_int32_t __config_load_generation = 0; 
    2223struct uuid_dummy { 
    2324  uuid_t foo; 
     
    4748  int i, cnt = 0; 
    4849  noit_conf_section_t *sec; 
     50  __config_load_generation++; 
    4951  sec = noit_conf_get_sections(NULL, "/noit/checks//check", &cnt); 
    5052  for(i=0; i<cnt; i++) { 
     
    158160  new_check = calloc(1, sizeof(*new_check)); 
    159161  if(!new_check) return -1; 
     162  new_check->generation = __config_load_generation; 
    160163  new_check->target_family = family; 
    161164  memcpy(&new_check->target_addr, &a, sizeof(a)); 
  • src/noit_poller.h

    rfb90c74 rf59d8ed  
    6161  char *name; 
    6262  noit_hash_table *config; 
    63   u_int32_t period; 
    64   u_int32_t timeout; 
     63  u_int32_t period;            /* period of checks in milliseconds */ 
     64  u_int32_t timeout;           /* timeout of check in milliseconds */ 
    6565  u_int32_t flags;             /* NP_KILLED, NP_RUNNING */ 
    6666 
     
    7171    stats_t previous; 
    7272  } stats; 
     73  u_int32_t generation;        /* This can roll, we don't care */ 
    7374  void *closure; 
    7475} * noit_check_t;