Changeset 8676


Ignore:
Timestamp:
06/01/13 10:59:58 (9 years ago)
Author:
bowman
Message:

Added csp cache peer ping times in webif (mode column). E.g: csp (12 ms). Will be shown for all csp cache peers with confirmed working bidirectional traffic.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/globals.h

    r8663 r8676  
    924924    int32_t         cwignored;          // count ignored  ECMs per client
    925925    int32_t         cwtout;             // count timeouted ECMs per client
    926     int32_t         cwlastresptime;     //last Responsetime (ms)
     926    int32_t         cwlastresptime;     // last Responsetime (ms)
    927927#ifdef CW_CYCLE_CHECK
    928928    int32_t         cwcycledchecked;    // count checked cwcycles per client
     
    938938    int32_t         cwcacheexgot;       // count got ecms/cws
    939939    int32_t         cwcacheexhit;       // count hit ecms/cws
    940     LLIST           *ll_cacheex_stats;  // List for Cacheex statistics
     940    LLIST           *ll_cacheex_stats;  // list for Cacheex statistics
    941941    int8_t          cacheex_maxhop;
    942     int32_t     cwcacheexerr;   //cw=00 or chksum wrong
    943     int32_t     cwcacheexerrcw; //Same Hex, different CW
     942    int32_t         cwcacheexerr;       // cw=00 or chksum wrong
     943    int32_t         cwcacheexerrcw;     // same Hex, different CW
     944    int16_t         cwcacheexping;      // peer ping in ms, only used by csp
    944945#endif
    945946
  • trunk/module-csp.c

    r8669 r8676  
    2525#define FAKE_TAG       0x80
    2626
    27 #define PING_INTVL     4
     27#define PING_INTVL     4
    2828
    2929static void * csp_server(struct s_client *client __attribute__((unused)), uchar *mbuf __attribute__((unused)), int32_t n __attribute__((unused)))
     
    9494    /*
    9595    struct SOCKADDR peer_sa = {0};
    96     SIN_GET_FAMILY(peer_sa) = cl->udp_sa.sin_family;
    97     cs_inet_addr("127.0.0.1", &peer_sa.sin_addr.s_addr);
     96    SIN_GET_FAMILY(peer_sa) = SIN_GET_FAMILY(cl->udp_sa);
     97    cs_inet_addr("127.0.0.1", &SIN_GET_ADDR(peer_sa));
    9898    SIN_GET_PORT(peer_sa) = htons(12346);
    9999    int32_t status = sendto(cl->udp_fd, buf, size, 0, (struct sockaddr *)&peer_sa, sizeof(peer_sa));
     
    199199                uint32_t now = tpe.time * 1000 + tpe.millitm;
    200200                cs_debug_mask(D_TRACE, "received ping reply from cache peer: %s:%d (%d ms)", cs_inet_ntoa(SIN_GET_ADDR(client->udp_sa)), ntohs(SIN_GET_PORT(client->udp_sa)), now - ping);
     201                client->cwcacheexping = now - ping;
    201202            }
    202203            break;
  • trunk/module-webif.c

    r8654 r8676  
    45794579            tpl_addVar(vars, TPLADD, "IP", cs_inet_ntoa(cl->ip));
    45804580            tpl_addVar(vars, TPLADD, "NODE", "csp");
    4581             tpl_addVar(vars, TPLADD, "LEVEL", "csp");
     4581            if(cl->cwcacheexping) {
     4582                tpl_printf(vars, TPLADD, "LEVEL", "csp (%d ms)", cl->cwcacheexping);
     4583            } else {
     4584                tpl_addVar(vars, TPLADD, "LEVEL", "csp");
     4585            }
    45824586            tpl_printf(vars, TPLADD, "PUSH", "%d", cl->cwcacheexpush);
    45834587            tpl_printf(vars, TPLADD, "GOT", "%d", cl->cwcacheexgot);
    45844588            tpl_printf(vars, TPLADD, "HIT", "%d", cl->cwcacheexhit);
     4589            tpl_printf(vars, TPLADD, "ERR", "%d", cl->cwcacheexerr);
     4590            tpl_printf(vars, TPLADD, "ERRCW", "%d", cl->cwcacheexerrcw);           
    45854591            tpl_addVar(vars, TPLADD, "DIRECTIONIMG", getting);
    45864592            rowvariable = "TABLECLIENTROWS";
Note: See TracChangeset for help on using the changeset viewer.