scoreboard.h revision 95e04bdfdb8fbb70158afd18bbf0acc340615d65
421def3c7b0b9ca7762f809a2c57c6ee74495ffaJonathan von Schroeder/* Licensed to the Apache Software Foundation (ASF) under one or more
421def3c7b0b9ca7762f809a2c57c6ee74495ffaJonathan von Schroeder * contributor license agreements. See the NOTICE file distributed with
f9096659967df62573bb5a5fd069c41bf5a0eca1Jonathan von Schroeder * this work for additional information regarding copyright ownership.
f9096659967df62573bb5a5fd069c41bf5a0eca1Jonathan von Schroeder * The ASF licenses this file to You under the Apache License, Version 2.0
421def3c7b0b9ca7762f809a2c57c6ee74495ffaJonathan von Schroeder * (the "License"); you may not use this file except in compliance with
421def3c7b0b9ca7762f809a2c57c6ee74495ffaJonathan von Schroeder * the License. You may obtain a copy of the License at
421def3c7b0b9ca7762f809a2c57c6ee74495ffaJonathan von Schroeder * http://www.apache.org/licenses/LICENSE-2.0
421def3c7b0b9ca7762f809a2c57c6ee74495ffaJonathan von Schroeder * Unless required by applicable law or agreed to in writing, software
f9096659967df62573bb5a5fd069c41bf5a0eca1Jonathan von Schroeder * distributed under the License is distributed on an "AS IS" BASIS,
421def3c7b0b9ca7762f809a2c57c6ee74495ffaJonathan von Schroeder * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
421def3c7b0b9ca7762f809a2c57c6ee74495ffaJonathan von Schroeder * See the License for the specific language governing permissions and
f9096659967df62573bb5a5fd069c41bf5a0eca1Jonathan von Schroeder * limitations under the License.
f9096659967df62573bb5a5fd069c41bf5a0eca1Jonathan von Schroeder * @brief Apache scoreboard library
e24ad3f655daa60ddabe690e4b11de3187996c16cmaeder/* Scoreboard file, if there is one */
e24ad3f655daa60ddabe690e4b11de3187996c16cmaeder#define DEFAULT_SCOREBOARD "apache_runtime_status" /* within DEFAULT_REL_RUNTIMEDIR */
f9096659967df62573bb5a5fd069c41bf5a0eca1Jonathan von Schroeder/* Scoreboard info on a process is, for now, kept very brief ---
f9096659967df62573bb5a5fd069c41bf5a0eca1Jonathan von Schroeder * just status value and pid (the latter so that the caretaker process
e24ad3f655daa60ddabe690e4b11de3187996c16cmaeder * can properly update the scoreboard when a process dies). We may want
f9096659967df62573bb5a5fd069c41bf5a0eca1Jonathan von Schroeder * to eventually add a separate set of long_score structures which would
f9096659967df62573bb5a5fd069c41bf5a0eca1Jonathan von Schroeder * give, for each process, the number of requests serviced, and info on
f9096659967df62573bb5a5fd069c41bf5a0eca1Jonathan von Schroeder * the current, or most recent, request.
e24ad3f655daa60ddabe690e4b11de3187996c16cmaeder * Status values:
f9096659967df62573bb5a5fd069c41bf5a0eca1Jonathan von Schroeder#define SERVER_STARTING 1 /* Server Starting up */
e24ad3f655daa60ddabe690e4b11de3187996c16cmaeder#define SERVER_READY 2 /* Waiting for connection (or accept() lock) */
f9096659967df62573bb5a5fd069c41bf5a0eca1Jonathan von Schroeder#define SERVER_BUSY_READ 3 /* Reading a client request */
f9096659967df62573bb5a5fd069c41bf5a0eca1Jonathan von Schroeder#define SERVER_BUSY_WRITE 4 /* Processing a client request */
typedef int ap_generation_t;
struct worker_score {
#if APR_HAS_THREADS
int thread_num;
unsigned char status;
unsigned short conn_count;
unsigned long access_count;
unsigned long my_access_count;
#ifdef HAVE_TIMES
int server_limit;
int thread_limit;
} global_score;
struct process_score {
} scoreboard;
int thread_num);
/* for time_process_request() in http_main.c */
#ifdef __cplusplus