home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 8 / CDACTUAL8.iso / share / os2 / varios / apache / scoreboa.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-06-07  |  4.0 KB  |  95 lines

  1.  
  2. /* ====================================================================
  3.  * Copyright (c) 1995 The Apache Group.  All rights reserved.
  4.  *
  5.  * Redistribution and use in source and binary forms, with or without
  6.  * modification, are permitted provided that the following conditions
  7.  * are met:
  8.  *
  9.  * 1. Redistributions of source code must retain the above copyright
  10.  *    notice, this list of conditions and the following disclaimer. 
  11.  *
  12.  * 2. Redistributions in binary form must reproduce the above copyright
  13.  *    notice, this list of conditions and the following disclaimer in
  14.  *    the documentation and/or other materials provided with the
  15.  *    distribution.
  16.  *
  17.  * 3. All advertising materials mentioning features or use of this
  18.  *    software must display the following acknowledgment:
  19.  *    "This product includes software developed by the Apache Group
  20.  *    for use in the Apache HTTP server project (http://www.apache.org/)."
  21.  *
  22.  * 4. The names "Apache Server" and "Apache Group" must not be used to
  23.  *    endorse or promote products derived from this software without
  24.  *    prior written permission.
  25.  *
  26.  * 5. Redistributions of any form whatsoever must retain the following
  27.  *    acknowledgment:
  28.  *    "This product includes software developed by the Apache Group
  29.  *    for use in the Apache HTTP server project (http://www.apache.org/)."
  30.  *
  31.  * THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS'' AND ANY
  32.  * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  33.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  34.  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE APACHE GROUP OR
  35.  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  36.  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  37.  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  38.  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  39.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  40.  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  41.  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
  42.  * OF THE POSSIBILITY OF SUCH DAMAGE.
  43.  * ====================================================================
  44.  *
  45.  * This software consists of voluntary contributions made by many
  46.  * individuals on behalf of the Apache Group and was originally based
  47.  * on public domain software written at the National Center for
  48.  * Supercomputing Applications, University of Illinois, Urbana-Champaign.
  49.  * For more information on the Apache Group and the Apache HTTP server
  50.  * project, please see <http://www.apache.org/>.
  51.  *
  52.  */
  53.  
  54. #include <sys/times.h>
  55.  
  56. /* Scoreboard info on a process is, for now, kept very brief --- 
  57.  * just status value and pid (the latter so that the caretaker process
  58.  * can properly update the scoreboard when a process dies).  We may want
  59.  * to eventually add a separate set of long_score structures which would
  60.  * give, for each process, the number of requests serviced, and info on
  61.  * the current, or most recent, request.
  62.  *
  63.  * Status values:
  64.  */
  65.  
  66. #define SERVER_UNKNOWN (-1)    /* should never be in this state */
  67. #define SERVER_DEAD 0
  68. #define SERVER_READY 1          /* Waiting for connection (or accept() lock) */
  69. #define SERVER_STARTING 3       /* Server Starting up */
  70. #define SERVER_BUSY_READ 2      /* Reading a client request */
  71. #define SERVER_BUSY_WRITE 4     /* Processing a client request */
  72. #define SERVER_BUSY_KEEPALIVE 5 /* Waiting for more requests via keepalive */
  73. #define SERVER_BUSY_LOG 6       /* Logging the request */
  74. #define SERVER_BUSY_DNS 7       /* Looking up a hostname */
  75.  
  76. typedef struct {
  77.     pid_t pid;
  78.     char status;
  79. #if defined(STATUS)
  80.     unsigned long access_count;
  81.     unsigned long bytes_served;
  82.     unsigned long my_access_count;
  83.     unsigned long my_bytes_served;
  84.     unsigned long conn_bytes;
  85.     unsigned short conn_count;
  86.     struct tms times;
  87.     time_t last_used;
  88.     char client[32];    /* Keep 'em small... */
  89.     char request[64];    /* We just want an idea... */
  90. #endif
  91. } short_score;
  92.  
  93. extern void sync_scoreboard_image(void);
  94. short_score get_scoreboard_info(int x);
  95.