Changeset d10f13b10b05856e66c66dc5f7efb410316d9d6d

Show
Ignore:
Timestamp:
06/30/11 06:23:27 (3 years ago)
Author:
Dan Di Spaltro <dan@cloudkick.com>
git-committer:
Dan Di Spaltro <dan@cloudkick.com> 1309415007 -0700
git-parent:

[9a7a2027dffd0153012a872c18fb583cf26e6d90]

git-author:
Dan Di Spaltro <dan@cloudkick.com> 1309408550 -0700
Message:

Add Delete messages to noit so we get a message when we deschedule a check

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/modules/postgres_ingestor.c

    re721131 rd10f13b  
    693693        DECLARE_PARAM_STR(final_buff, final_len); 
    694694        free(final_buff); 
     695        break; 
     696      case 'D': 
    695697        break; 
    696698      case 'C': 
     
    772774      PQclear(d->res); 
    773775      break; 
     776    case 'D': 
     777      break; 
    774778    case 'M': 
    775779      switch(d->metric_type) { 
  • src/noit_check.c

    r455a074 rd10f13b  
    778778  checker->flags |= (NP_DISABLED|NP_KILLED); 
    779779 
     780  noit_check_log_delete(checker); 
     781 
    780782  noit_skiplist_remove(&polls_by_name, checker, NULL); 
    781783  noit_hash_delete(&polls, (char *)in, UUID_SIZE, NULL, NULL); 
  • src/noit_check.h

    r870413e rd10f13b  
    266266API_EXPORT(void) noit_check_log_check(noit_check_t *check); 
    267267API_EXPORT(void) noit_check_log_status(noit_check_t *check); 
     268API_EXPORT(void) noit_check_log_delete(noit_check_t *check); 
    268269API_EXPORT(void) noit_check_log_metrics(noit_check_t *check); 
    269270API_EXPORT(void) noit_check_log_metric(noit_check_t *check, 
  • src/noit_check_log.c

    r870413e rd10f13b  
    4545 *  'n' TIMESTAMP strlen(xmlconfig) base64(gzip(xmlconfig)) 
    4646 * 
     47 * DELETE: 
     48 *  'D' TIMESTAMP UUID 
     49 * 
    4750 * CHECK: 
    4851 *  'C' TIMESTAMP UUID TARGET MODULE NAME 
     
    5861static noit_log_stream_t status_log = NULL; 
    5962static noit_log_stream_t metrics_log = NULL; 
     63static noit_log_stream_t delete_log = NULL; 
    6064#define SECPART(a) ((unsigned long)(a)->tv_sec) 
    6165#define MSECPART(a) ((unsigned long)((a)->tv_usec / 1000)) 
     
    105109 
    106110static int 
     111_noit_check_log_delete(noit_log_stream_t ls, 
     112                       noit_check_t *check) { 
     113  stats_t *c; 
     114  char uuid_str[256*3+37]; 
     115  SETUP_LOG(delete, ); 
     116  MAKE_CHECK_UUID_STR(uuid_str, sizeof(uuid_str), status_log, check); 
     117 
     118  c = &check->stats.current; 
     119  return noit_log(ls, &c->whence, __FILE__, __LINE__, 
     120                  "D\t%lu.%03lu\t%s\n", 
     121                  SECPART(&c->whence), MSECPART(&c->whence), uuid_str); 
     122} 
     123void 
     124noit_check_log_delete(noit_check_t *check) { 
     125  if(!(check->flags & NP_TRANSIENT)) { 
     126    handle_extra_feeds(check, _noit_check_log_delete); 
     127    SETUP_LOG(delete, return); 
     128    _noit_check_log_delete(delete_log, check); 
     129  } 
     130} 
     131 
     132static int 
    107133_noit_check_log_check(noit_log_stream_t ls, 
    108134                      noit_check_t *check) { 
  • src/stratcon_datastore.c

    r5f816fc rd10f13b  
    222222    case 'S': 
    223223    case 'M': 
     224    case 'D': 
    224225      if(line[1] == '\t' && (cp1 = strchr(line+2, '\t')) != NULL && 
    225226         (cp2 = strchr(cp1+1, '\t')) != NULL &&