Changeset 2417a3262808d93c08cb01f0c7dfc7a7d40df766

Show
Ignore:
Timestamp:
06/14/12 16:02:57 (3 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1339689777 -0400
git-parent:

[4496cc4e7850184a250647f0a956c335c15f5f18]

git-author:
Theo Schlossnagle <jesus@omniti.com> 1339689777 -0400
Message:

Allow livestreaming to attach to the non-transient check.

If a period of 0 is provided, just add this livestream as
a feed on the master check. It won't show up in watches, but
it acts like a normal watch.

Files:

Legend:

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

    r4496cc4 r2417a32  
    594594 
    595595  uuid_unparse_lower(in, uuid_str); 
     596 
     597  noitL(noit_error, "noit_check_watch(%s,%d)\n", uuid_str, period); 
     598  if(period == 0) { 
     599    return noit_poller_lookup(in); 
     600  } 
     601 
    596602  /* Find the check */ 
    597603  snprintf(xpath, sizeof(xpath), "//checks//check[@uuid=\"%s\"]", uuid_str); 
  • src/noit_conf_checks.c

    re88e9e3 r2417a32  
    534534                  noit_check_state_string(c->state)); 
    535535        nc_printf(ncct, " status: %s\n", c->status ? c->status : "[[null]]"); 
     536        nc_printf(ncct, " feeds: %d\n", check->feeds ? check->feeds->size : 0); 
    536537        nc_printf(ncct, " metrics:\n"); 
    537538        memset(&iter, 0, sizeof(iter)); 
  • src/noit_livestream_listener.c

    r26d8ac6 r2417a32  
    5353typedef struct { 
    5454  u_int32_t period; 
     55  noit_boolean period_read; 
    5556  struct log_entry *lqueue; 
    5657  struct log_entry *lqueue_end; 
     
    238239    /* Setup logger to this channel */ 
    239240    noitL(noit_debug, "livestream initializing on fd %d\n", e->fd); 
    240     if(!jcl->period) { 
     241    if(!jcl->period_read) { 
    241242      u_int32_t nperiod; 
    242243      len = e->opset->read(e->fd, &nperiod, sizeof(nperiod), &mask, e); 
     
    244245      if(len != sizeof(nperiod)) goto socket_error; 
    245246      jcl->period = ntohl(nperiod); 
    246       if(!jcl->period) { 
    247         noitL(noit_error, "period of 0 specified in livestream.  not allowed.\n"); 
    248         goto socket_error; 
    249       } 
     247      jcl->period_read = noit_true; 
    250248      noitL(noit_debug, "livestream initializing on fd %d [period %d]\n", 
    251249            e->fd, jcl->period);