Changeset 4519

Show
Ignore:
Timestamp:
02/01/10 13:44:07 (6 months ago)
Author:
phk
Message:

Add a varnish "uptime" counter, which counts seconds of uptime for
the worker thread.

Location:
trunk/varnish-cache
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/varnish-cache/bin/varnishd/cache_acceptor.c

    r4497 r4519  
    188188        struct listen_sock *ls; 
    189189        unsigned u; 
    190         double now, pace; 
     190        double t0, now, pace; 
    191191 
    192192        THR_SetName("cache-acceptor"); 
     
    209209        need_test = 1; 
    210210        pace = 0; 
     211        t0 = TIM_real(); 
    211212        while (1) { 
    212213#ifdef SO_SNDTIMEO_WORKS 
     
    245246                i = poll(pfd, heritage.nsocks, 1000); 
    246247                now = TIM_real(); 
     248                VSL_stats->uptime = (uint64_t)(now - t0); 
    247249                u = 0; 
    248250                VTAILQ_FOREACH(ls, &heritage.socks, list) { 
  • trunk/varnish-cache/include/stat_field.h

    r4497 r4519  
    152152MAC_STAT(accept_fail,           uint64_t, 0, 'a', "Accept failures") 
    153153MAC_STAT(client_drop_late,      uint64_t, 0, 'a', "Connection dropped late") 
     154MAC_STAT(uptime,                uint64_t, 0, 'a', "Client uptime")