jim         96/03/29 07:44:35

  Modified:    src       conf.h http_main.c mod_status.c scoreboard.h
  Log:
  add per process counters and PID info to status
  
  Revision  Changes    Path
  1.10      +1 -1      apache/src/conf.h
  
  Index: conf.h
  ===================================================================
  RCS file: /export/home/cvs/apache/src/conf.h,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -C3 -r1.9 -r1.10
  *** conf.h    1996/03/18 01:55:37     1.9
  --- conf.h    1996/03/29 15:44:31     1.10
  ***************
  *** 225,231 ****
    #define NEED_STRDUP
    #define JMP_BUF sigjmp_buf
    /* fcntl() locking is expensive with NFS */
  ! #define FLOCK_SERIALIZED_ACCEPT
    #define HAVE_SHMGET
    #define MOVEBREAK           0x4000000
    
  --- 225,231 ----
    #define NEED_STRDUP
    #define JMP_BUF sigjmp_buf
    /* fcntl() locking is expensive with NFS */
  ! #undef FLOCK_SERIALIZED_ACCEPT
    #define HAVE_SHMGET
    #define MOVEBREAK           0x4000000
    
  
  
  
  1.15      +9 -0      apache/src/http_main.c
  
  Index: http_main.c
  ===================================================================
  RCS file: /export/home/cvs/apache/src/http_main.c,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -C3 -r1.14 -r1.15
  *** http_main.c       1996/03/29 08:35:46     1.14
  --- http_main.c       1996/03/29 15:44:32     1.15
  ***************
  *** 665,670 ****
  --- 665,677 ----
    
    #if defined(STATUS_INSTRUMENTATION)
        new_score_rec.last_used=time(NULL);
  +     if (status == SERVER_DEAD) {
  +     /*
  +      * Reset individual counters
  +      */
  +     new_score_rec.my_access_count = 0;
  +     new_score_rec.my_bytes_served = 0;
  +     }
    #endif
    
    #if defined(HAVE_MMAP) || defined(HAVE_SHMGET)
  ***************
  *** 702,708 ****
  --- 709,717 ----
            bgetopt(r->connection->client, BO_BYTECT, &bs);
    
        new_score_rec.access_count ++;
  +     new_score_rec.my_access_count ++;
        new_score_rec.bytes_served += (long)bs;
  +     new_score_rec.my_bytes_served += (long)bs;
    
        times(&new_score_rec.times);
    
  
  
  
  1.6       +11 -2     apache/src/mod_status.c
  
  Index: mod_status.c
  ===================================================================
  RCS file: /export/home/cvs/apache/src/mod_status.c,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -C3 -r1.5 -r1.6
  *** mod_status.c      1996/03/29 08:56:49     1.5
  --- mod_status.c      1996/03/29 15:44:32     1.6
  ***************
  *** 138,143 ****
  --- 138,144 ----
        int busy=0;
        long count=0;
        long lres,bytes;
  +     long my_lres,my_bytes;
        long bcount=0;
        int short_report=0;
        server_rec *server = r->server;
  ***************
  *** 223,232 ****
        for (i = 0; i<HARD_SERVER_MAX; ++i) {
            score_record=get_scoreboard_info(i);
            lres = score_record.access_count;
        bytes= score_record.bytes_served;
            if (lres!=0 || (score_record.status != SERVER_READY && 
score_record.status != SERVER_DEAD)) {
            if (!short_report) {
  !             sprintf(buffer,"<br>Server %d: %ld [",i,lres);
                rputs(buffer,r);
    
                switch (score_record.status) {
  --- 224,236 ----
        for (i = 0; i<HARD_SERVER_MAX; ++i) {
            score_record=get_scoreboard_info(i);
            lres = score_record.access_count;
  +         my_lres = score_record.my_access_count;
        bytes= score_record.bytes_served;
  +     my_bytes= score_record.my_bytes_served;
            if (lres!=0 || (score_record.status != SERVER_READY && 
score_record.status != SERVER_DEAD)) {
            if (!short_report) {
  !             sprintf(buffer,"<br>Server %d (%d): %ld|%ld [",
  !              i,(int)score_record.pid,my_lres,lres);
                rputs(buffer,r);
    
                switch (score_record.status) {
  ***************
  *** 242,247 ****
  --- 246,254 ----
                case SERVER_BUSY_WRITE:
                    rputs("Write",r);
                    break;
  +             case SERVER_DEAD:
  +                 rputs("Dead",r);
  +                 break;
                }
                sprintf(buffer,"] u%g s%g cu%g cs%g %s (",
                        score_record.times.tms_utime/tick,
  ***************
  *** 250,255 ****
  --- 257,264 ----
                        score_record.times.tms_cstime/tick,
                        asctime(localtime(&score_record.last_used)));
                rputs(buffer,r);
  +             format_byte_out(r,my_bytes);
  +             rputs("|",r);
                format_byte_out(r,bytes);
                rputs(")",r);
            }
  ***************
  *** 262,268 ****
        }
        }
        if (short_report) {
  !         sprintf(buffer,"Accesses: %ld\nBytes: %ld\n",count,bcount);
        rputs(buffer,r);
        } else {
            sprintf(buffer,"<p>Total accesses: %ld u%g s%g cu%g cs%g (",
  --- 271,277 ----
        }
        }
        if (short_report) {
  !         sprintf(buffer,"Total Accesses: %ld\nTotal Bytes: 
%ld\n",count,bcount);
        rputs(buffer,r);
        } else {
            sprintf(buffer,"<p>Total accesses: %ld u%g s%g cu%g cs%g (",
  
  
  
  1.5       +2 -0      apache/src/scoreboard.h
  
  Index: scoreboard.h
  ===================================================================
  RCS file: /export/home/cvs/apache/src/scoreboard.h,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -C3 -r1.4 -r1.5
  *** scoreboard.h      1996/03/26 20:31:29     1.4
  --- scoreboard.h      1996/03/29 15:44:33     1.5
  ***************
  *** 75,80 ****
  --- 75,82 ----
    #if defined(STATUS_INSTRUMENTATION)
        long access_count;
        long bytes_served;
  +     long my_access_count;
  +     long my_bytes_served;
        struct tms times;
        time_t last_used;
    #endif
  
  
  

Reply via email to