Changeset 0181abdce529ba17b164ec0a0165a96b920821f2

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

[7940b59f502685b82ede05d10c856a31a3a50caf]

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

temp fixes to testing

Files:

Legend:

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

    rf5b00dc r0181abd  
    2525stratcon_realtime_ticker(eventer_t old, int mask, void *closure, 
    2626                         struct timeval *now) { 
    27   char buffer[100]; 
     27  char buffer[1024]; 
    2828  noit_http_session_ctx *ctx = closure; 
    2929 
     
    3737  eventer_t e = eventer_alloc(); 
    3838  gettimeofday(&e->whence, NULL); 
    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); 
     39 
     40  snprintf(buffer, sizeof(buffer), "<script>window.parent.plot_iframe_data('%lu','%s','%0.3f','%lu');</script>\n", 
     41           (unsigned long)1179, "allocator_requests", (float)(rand() % 100000) / 1000.0, 
     42           e->whence.tv_sec * 1000 + e->whence.tv_usec / 100); 
    4143  noit_http_response_append(ctx, buffer, strlen(buffer)); 
    4244  noit_http_response_flush(ctx, noit_false); 
     
    4446  e->mask = EVENTER_TIMER; 
    4547  e->whence.tv_sec += 0; 
    46   e->whence.tv_usec += 500
     48  e->whence.tv_usec += 500000
    4749  e->callback = stratcon_realtime_ticker; 
    4850  e->closure = closure; 
     
    6567  } 
    6668  if(!rc->setup) { 
    67     const char *c = "<html><body>\n"
     69    char c[1024]
    6870    noitL(noit_error, "http: %s %s %s\n", 
    6971          req->method_str, req->uri_str, req->protocol_str); 
     
    7375    noit_http_response_status_set(ctx, 200, "OK"); 
    7476    noit_http_response_option_set(ctx, NOIT_HTTP_CHUNKED); 
    75     noit_http_response_option_set(ctx, NOIT_HTTP_DEFLATE); 
     77/*    noit_http_response_option_set(ctx, NOIT_HTTP_DEFLATE); */ 
    7678    noit_http_response_header_set(ctx, "Content-Type", "text/html"); 
     79 
     80    snprintf(c, sizeof(c), "<html><head><script>document.domain='omniti.com';</script></head><body>\n"); 
    7781    noit_http_response_append(ctx, c, strlen(c)); 
     82 
     83    memset(c, ' ', 1024); 
     84    noit_http_response_append(ctx, c, sizeof(c)); 
    7885    noit_http_response_flush(ctx, noit_false); 
     86 
    7987    stratcon_realtime_ticker(NULL, 0, ctx, NULL); 
    8088    rc->setup = 1;