Apache2
scoreboard.h File Reference

Apache scoreboard library. More...

#include "ap_config.h"
#include "http_config.h"
#include "apr_thread_proc.h"
#include "apr_portable.h"
#include "apr_shm.h"
#include "apr_optional.h"
Include dependency graph for scoreboard.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  worker_score
 
struct  global_score
 
struct  process_score
 
struct  scoreboard
 

Macros

#define DEFAULT_SCOREBOARD   "apache_runtime_status" /* within DEFAULT_REL_RUNTIMEDIR */
 
#define SERVER_DEAD   0
 
#define SERVER_STARTING   1 /* Server Starting up */
 
#define SERVER_READY   2 /* Waiting for connection (or accept() lock) */
 
#define SERVER_BUSY_READ   3 /* Reading a client request */
 
#define SERVER_BUSY_WRITE   4 /* Processing a client request */
 
#define SERVER_BUSY_KEEPALIVE   5 /* Waiting for more requests via keepalive */
 
#define SERVER_BUSY_LOG   6 /* Logging the request */
 
#define SERVER_BUSY_DNS   7 /* Looking up a hostname */
 
#define SERVER_CLOSING   8 /* Closing the connection */
 
#define SERVER_GRACEFUL   9 /* server is gracefully finishing request */
 
#define SERVER_IDLE_KILL   10 /* Server is cleaning up idle children. */
 
#define SERVER_NUM_STATUS   11 /* number of status settings */
 
#define START_PREQUEST   1
 
#define STOP_PREQUEST   2
 

Typedefs

typedef int ap_generation_t
 
typedef struct worker_score worker_score
 
typedef struct process_score process_score
 
typedef struct ap_sb_handle_t ap_sb_handle_t
 

Enumerations

enum  ap_scoreboard_e { SB_NOT_SHARED = 1 , SB_SHARED = 2 }
 

Functions

int ap_create_scoreboard (apr_pool_t *p, ap_scoreboard_e t)
 
apr_status_t ap_cleanup_scoreboard (void *d)
 
int ap_exists_scoreboard_image (void)
 
void ap_increment_counts (ap_sb_handle_t *sbh, request_rec *r)
 
void ap_set_conn_count (ap_sb_handle_t *sb, request_rec *r, unsigned short conn_count)
 
apr_status_t ap_reopen_scoreboard (apr_pool_t *p, apr_shm_t **shm, int detached)
 
void ap_init_scoreboard (void *shared_score)
 
int ap_calc_scoreboard_size (void)
 
void ap_create_sb_handle (ap_sb_handle_t **new_sbh, apr_pool_t *p, int child_num, int thread_num)
 
void ap_update_sb_handle (ap_sb_handle_t *sbh, int child_num, int thread_num)
 
void ap_sb_get_child_thread (ap_sb_handle_t *sbh, int *pchild_num, int *pthread_num)
 
int ap_find_child_by_pid (apr_proc_t *pid)
 
int ap_update_child_status (ap_sb_handle_t *sbh, int status, request_rec *r)
 
int ap_update_child_status_from_indexes (int child_num, int thread_num, int status, request_rec *r)
 
int ap_update_child_status_from_conn (ap_sb_handle_t *sbh, int status, conn_rec *c)
 
int ap_update_child_status_from_server (ap_sb_handle_t *sbh, int status, conn_rec *c, server_rec *s)
 
int ap_update_child_status_descr (ap_sb_handle_t *sbh, int status, const char *descr)
 
void ap_time_process_request (ap_sb_handle_t *sbh, int status)
 
int ap_update_global_status (void)
 
worker_scoreap_get_scoreboard_worker (ap_sb_handle_t *sbh)
 
worker_scoreap_get_scoreboard_worker_from_indexes (int child_num, int thread_num)
 
void ap_copy_scoreboard_worker (worker_score *dest, int child_num, int thread_num)
 
process_scoreap_get_scoreboard_process (int x)
 
global_scoreap_get_scoreboard_global (void)
 
const char * ap_set_scoreboard (cmd_parms *cmd, void *dummy, const char *arg)
 
const char * ap_set_extended_status (cmd_parms *cmd, void *dummy, int arg)
 
const char * ap_set_reqtail (cmd_parms *cmd, void *dummy, int arg)
 
int pre_mpm (apr_pool_t *p, ap_scoreboard_e sb_type)
 

Variables

AP_DECLARE_DATA scoreboardap_scoreboard_image
 
AP_DECLARE_DATA const char * ap_scoreboard_fname
 
AP_DECLARE_DATA int ap_extended_status
 
AP_DECLARE_DATA int ap_mod_status_reqtail
 

Detailed Description

Apache scoreboard library.

Macro Definition Documentation

◆ DEFAULT_SCOREBOARD

#define DEFAULT_SCOREBOARD   "apache_runtime_status" /* within DEFAULT_REL_RUNTIMEDIR */

◆ SERVER_BUSY_DNS

#define SERVER_BUSY_DNS   7 /* Looking up a hostname */

◆ SERVER_BUSY_KEEPALIVE

#define SERVER_BUSY_KEEPALIVE   5 /* Waiting for more requests via keepalive */

◆ SERVER_BUSY_LOG

#define SERVER_BUSY_LOG   6 /* Logging the request */

◆ SERVER_BUSY_READ

#define SERVER_BUSY_READ   3 /* Reading a client request */

◆ SERVER_BUSY_WRITE

#define SERVER_BUSY_WRITE   4 /* Processing a client request */

◆ SERVER_CLOSING

#define SERVER_CLOSING   8 /* Closing the connection */

◆ SERVER_DEAD

#define SERVER_DEAD   0

◆ SERVER_GRACEFUL

#define SERVER_GRACEFUL   9 /* server is gracefully finishing request */

◆ SERVER_IDLE_KILL

#define SERVER_IDLE_KILL   10 /* Server is cleaning up idle children. */

◆ SERVER_NUM_STATUS

#define SERVER_NUM_STATUS   11 /* number of status settings */

◆ SERVER_READY

#define SERVER_READY   2 /* Waiting for connection (or accept() lock) */

◆ SERVER_STARTING

#define SERVER_STARTING   1 /* Server Starting up */

◆ START_PREQUEST

#define START_PREQUEST   1

◆ STOP_PREQUEST

#define STOP_PREQUEST   2

Typedef Documentation

◆ ap_generation_t

◆ ap_sb_handle_t

◆ process_score

typedef struct process_score process_score

◆ worker_score

typedef struct worker_score worker_score

Enumeration Type Documentation

◆ ap_scoreboard_e

Enumerator
SB_NOT_SHARED 
SB_SHARED 

Function Documentation

◆ ap_calc_scoreboard_size()

int ap_calc_scoreboard_size ( void  )

◆ ap_cleanup_scoreboard()

apr_status_t ap_cleanup_scoreboard ( void *  d)

◆ ap_copy_scoreboard_worker()

void ap_copy_scoreboard_worker ( worker_score dest,
int  child_num,
int  thread_num 
)

Copy the contents of a worker scoreboard entry. The contents of the worker_score structure are copied verbatim into the dest structure.

Parameters
destOutput parameter.
child_numThe child number.
thread_numThe thread number.

◆ ap_create_sb_handle()

void ap_create_sb_handle ( ap_sb_handle_t **  new_sbh,
apr_pool_t p,
int  child_num,
int  thread_num 
)

◆ ap_create_scoreboard()

int ap_create_scoreboard ( apr_pool_t p,
ap_scoreboard_e  t 
)

◆ ap_exists_scoreboard_image()

int ap_exists_scoreboard_image ( void  )

◆ ap_find_child_by_pid()

int ap_find_child_by_pid ( apr_proc_t pid)

◆ ap_get_scoreboard_global()

global_score* ap_get_scoreboard_global ( void  )

◆ ap_get_scoreboard_process()

process_score* ap_get_scoreboard_process ( int  x)

◆ ap_get_scoreboard_worker()

worker_score* ap_get_scoreboard_worker ( ap_sb_handle_t sbh)

◆ ap_get_scoreboard_worker_from_indexes()

worker_score* ap_get_scoreboard_worker_from_indexes ( int  child_num,
int  thread_num 
)

Return a pointer to the worker_score for a given child, thread pair.

Parameters
child_numThe child number.
thread_numThe thread number.
Returns
A pointer to the worker_score structure.
Deprecated:
This function is deprecated, use ap_copy_scoreboard_worker instead.

◆ ap_increment_counts()

void ap_increment_counts ( ap_sb_handle_t sbh,
request_rec r 
)

◆ ap_init_scoreboard()

void ap_init_scoreboard ( void *  shared_score)

◆ ap_reopen_scoreboard()

apr_status_t ap_reopen_scoreboard ( apr_pool_t p,
apr_shm_t **  shm,
int  detached 
)

◆ ap_sb_get_child_thread()

void ap_sb_get_child_thread ( ap_sb_handle_t sbh,
int pchild_num,
int pthread_num 
)

◆ ap_set_conn_count()

void ap_set_conn_count ( ap_sb_handle_t sb,
request_rec r,
unsigned short  conn_count 
)

◆ ap_set_extended_status()

const char* ap_set_extended_status ( cmd_parms cmd,
void *  dummy,
int  arg 
)

◆ ap_set_reqtail()

const char* ap_set_reqtail ( cmd_parms cmd,
void *  dummy,
int  arg 
)

◆ ap_set_scoreboard()

const char* ap_set_scoreboard ( cmd_parms cmd,
void *  dummy,
const char *  arg 
)

◆ ap_time_process_request()

void ap_time_process_request ( ap_sb_handle_t sbh,
int  status 
)

◆ ap_update_child_status()

int ap_update_child_status ( ap_sb_handle_t sbh,
int  status,
request_rec r 
)

◆ ap_update_child_status_descr()

int ap_update_child_status_descr ( ap_sb_handle_t sbh,
int  status,
const char *  descr 
)

◆ ap_update_child_status_from_conn()

int ap_update_child_status_from_conn ( ap_sb_handle_t sbh,
int  status,
conn_rec c 
)

◆ ap_update_child_status_from_indexes()

int ap_update_child_status_from_indexes ( int  child_num,
int  thread_num,
int  status,
request_rec r 
)

◆ ap_update_child_status_from_server()

int ap_update_child_status_from_server ( ap_sb_handle_t sbh,
int  status,
conn_rec c,
server_rec s 
)

◆ ap_update_global_status()

int ap_update_global_status ( void  )

◆ ap_update_sb_handle()

void ap_update_sb_handle ( ap_sb_handle_t sbh,
int  child_num,
int  thread_num 
)

Variable Documentation

◆ ap_extended_status

AP_DECLARE_DATA int ap_extended_status
extern

◆ ap_mod_status_reqtail

AP_DECLARE_DATA int ap_mod_status_reqtail
extern

◆ ap_scoreboard_fname

AP_DECLARE_DATA const char* ap_scoreboard_fname
extern

◆ ap_scoreboard_image

AP_DECLARE_DATA scoreboard* ap_scoreboard_image
extern