Changeset 7830d95186c5ff499fc6214b8def1cac353fe471

Show
Ignore:
Timestamp:
12/12/08 21:32:46 (5 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1229117566 +0000
git-parent:

[416627dc1e5d2db16ec5482c8af88377163298c8]

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

a better test for the front-end

Files:

Legend:

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

    r49e329e r7830d95  
    2525stratcon_realtime_ticker(eventer_t old, int mask, void *closure, 
    2626                         struct timeval *now) { 
    27   int f; 
    2827  char buffer[100]; 
    2928  noit_http_session_ctx *ctx = closure; 
    30   f = rand() % 10; 
    3129 
    32   if(!f) { 
     30  if(0) { 
    3331    noit_http_response_end(ctx); 
    3432    memset(ctx->dispatcher_closure, 0, sizeof(realtime_context)); 
     
    3937  eventer_t e = eventer_alloc(); 
    4038  gettimeofday(&e->whence, NULL); 
    41   snprintf(buffer, sizeof(buffer), "[%lu] Ticker...<br />\n", e->whence.tv_sec); 
     39  snprintf(buffer, sizeof(buffer), "<script>reconnoiter_realtime_feed(%lu,'%s','%s','%0.3f');</script>\n", 
     40           e->whence.tv_sec * 1000 + e->whence.tv_usec / 1000, "A-UUID", "metric-name", (float)(rand() % 100000) / 1000.0); 
    4241  noit_http_response_append(ctx, buffer, strlen(buffer)); 
    4342  noit_http_response_flush(ctx, false); 
    4443 
    45   fprintf(stderr, " Next tick in %d seconds\n", f); 
    4644  e->mask = EVENTER_TIMER; 
    47   e->whence.tv_sec += f; 
     45  e->whence.tv_sec += 0; 
     46  e->whence.tv_usec += 500; 
    4847  e->callback = stratcon_realtime_ticker; 
    4948  e->closure = closure; 
     
    6665  } 
    6766  if(!rc->setup) { 
    68     const char *c = "<html><body><div id=\"foo\">Here</div>\n"; 
     67    const char *c = "<html><body>\n"; 
    6968    noitL(noit_error, "http: %s %s %s\n", 
    7069          req->method_str, req->uri_str, req->protocol_str);