Data Structures | Defines | Typedefs | Functions | Variables

StatSystem.cc File Reference

A brief file description. More...

#include "Main.h"
#include "StatSystem.h"
#include "P_EventSystem.h"
#include "Error.h"
#include "ProcessManager.h"
#include "ProxyConfig.h"
#include "StatPages.h"
#include "HTTP.h"
#include "I_Layout.h"
#include "DynamicStats.h"
Include dependency graph for StatSystem.cc:

Go to the source code of this file.

Data Structures

struct  SnapStatsContinuation
struct  SnapCont

Defines

#define SNAP_USAGE_PERIOD   HRTIME_SECONDS(2)
#define DEFAULT_PERSISTENT
#define _HEADER   DynamicStatsString_t DynamicStatsStrings[] = {
#define _FOOTER   };
#define _D(_x)   { _x, #_x },

Typedefs

typedef int(SnapCont::* SnapContHandler )(int, void *)

Functions

static int persistent_stat (int i)
static int open_stats_snap ()
static void clear_stats ()
static void read_stats_snap ()
static void write_stats_snap ()
static void take_rusage_snap ()
void start_stats_snap ()
static Actionstat_callback (Continuation *cont, HTTPHdr *header)
static Actiontestpage_callback (Continuation *cont, HTTPHdr *)
static void testpage_callback_init ()
void initialize_all_global_stats ()
void * dyn_stats_int_msecs_to_float_seconds_cb (void *data, void *res)
void * dyn_stats_count_cb (void *data, void *res)
void * dyn_stats_sum_cb (void *data, void *res)
void * dyn_stats_avg_cb (void *data, void *res)
void * dyn_stats_fsum_cb (void *data, void *res)
void * dyn_stats_favg_cb (void *data, void *res)
void * dyn_stats_time_seconds_cb (void *data, void *res)
void * dyn_stats_time_mseconds_cb (void *data, void *res)
void * dyn_stats_time_useconds_cb (void *data, void *res)
void * http_trans_stats_int_msecs_to_float_seconds_cb (void *data, void *res)
void * http_trans_stats_count_cb (void *data, void *res)
void * http_trans_stats_sum_cb (void *data, void *res)
void * http_trans_stats_avg_cb (void *data, void *res)
void * http_trans_stats_fsum_cb (void *data, void *res)
void * http_trans_stats_favg_cb (void *data, void *res)
void * http_trans_stats_time_seconds_cb (void *data, void *res)
void * http_trans_stats_time_mseconds_cb (void *data, void *res)
void * http_trans_stats_time_useconds_cb (void *data, void *res)

Variables

ink_stat_lock_t global_http_trans_stat_lock
ink_unprot_global_stat_t global_http_trans_stats [MAX_HTTP_TRANS_STATS]
inkcoreapi ink_unprot_global_stat_t global_dyn_stats [MAX_DYN_STATS-DYN_STAT_START]
Ptr< ProxyMutexrusage_snap_mutex
struct rusage rusage_snap
struct rusage rusage_snap_old
ink_hrtime rusage_snap_time
ink_hrtime rusage_snap_time_old
int snap_stats_every = 60
ink_hrtime http_handler_times [MAX_HTTP_HANDLER_EVENTS]
int http_handler_counts [MAX_HTTP_HANDLER_EVENTS]
char snap_filename [PATH_NAME_MAX+1] = DEFAULT_SNAP_FILENAME
static int non_persistent_stats []

Detailed Description

A brief file description.

License

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Definition in file StatSystem.cc.


Define Documentation

#define _D (   _x  )     { _x, #_x },

Definition at line 155 of file StatSystem.cc.

#define _FOOTER   };

Definition at line 154 of file StatSystem.cc.

#define _HEADER   DynamicStatsString_t DynamicStatsStrings[] = {

Definition at line 151 of file StatSystem.cc.

#define DEFAULT_PERSISTENT

Definition at line 71 of file StatSystem.cc.

#define SNAP_USAGE_PERIOD   HRTIME_SECONDS(2)

Definition at line 41 of file StatSystem.cc.

Referenced by SnapCont::mainEvent(), and start_stats_snap().


Typedef Documentation

typedef int(SnapCont::* SnapContHandler)(int, void *)

Definition at line 366 of file StatSystem.cc.


Function Documentation

static void clear_stats (  )  [static]
void* dyn_stats_avg_cb ( void *  data,
void *  res 
)

Definition at line 580 of file StatSystem.cc.

References READ_DYN_STAT.

void* dyn_stats_count_cb ( void *  data,
void *  res 
)

Definition at line 560 of file StatSystem.cc.

References READ_DYN_STAT.

void* dyn_stats_favg_cb ( void *  data,
void *  res 
)

Definition at line 603 of file StatSystem.cc.

References READ_DYN_STAT.

void* dyn_stats_fsum_cb ( void *  data,
void *  res 
)

Definition at line 593 of file StatSystem.cc.

References READ_DYN_STAT.

void* dyn_stats_int_msecs_to_float_seconds_cb ( void *  data,
void *  res 
)

Definition at line 544 of file StatSystem.cc.

References READ_DYN_STAT.

void* dyn_stats_sum_cb ( void *  data,
void *  res 
)

Definition at line 570 of file StatSystem.cc.

References READ_DYN_STAT.

void* dyn_stats_time_mseconds_cb ( void *  data,
void *  res 
)

Definition at line 632 of file StatSystem.cc.

References HRTIME_MSECOND, and READ_DYN_STAT.

void* dyn_stats_time_seconds_cb ( void *  data,
void *  res 
)

Definition at line 616 of file StatSystem.cc.

References HRTIME_SECOND, and READ_DYN_STAT.

void* dyn_stats_time_useconds_cb ( void *  data,
void *  res 
)

Definition at line 648 of file StatSystem.cc.

References HRTIME_USECOND, and READ_DYN_STAT.

void* http_trans_stats_avg_cb ( void *  data,
void *  res 
)

Definition at line 703 of file StatSystem.cc.

References READ_HTTP_TRANS_STAT.

void* http_trans_stats_count_cb ( void *  data,
void *  res 
)

Definition at line 683 of file StatSystem.cc.

References READ_HTTP_TRANS_STAT.

void* http_trans_stats_favg_cb ( void *  data,
void *  res 
)

Definition at line 726 of file StatSystem.cc.

References READ_HTTP_TRANS_STAT.

void* http_trans_stats_fsum_cb ( void *  data,
void *  res 
)

Definition at line 716 of file StatSystem.cc.

References READ_HTTP_TRANS_STAT.

void* http_trans_stats_int_msecs_to_float_seconds_cb ( void *  data,
void *  res 
)

Definition at line 667 of file StatSystem.cc.

References READ_HTTP_TRANS_STAT.

void* http_trans_stats_sum_cb ( void *  data,
void *  res 
)

Definition at line 693 of file StatSystem.cc.

References READ_HTTP_TRANS_STAT.

void* http_trans_stats_time_mseconds_cb ( void *  data,
void *  res 
)

Definition at line 755 of file StatSystem.cc.

References HRTIME_MSECOND, and READ_HTTP_TRANS_STAT.

void* http_trans_stats_time_seconds_cb ( void *  data,
void *  res 
)

Definition at line 739 of file StatSystem.cc.

References HRTIME_SECOND, and READ_HTTP_TRANS_STAT.

void* http_trans_stats_time_useconds_cb ( void *  data,
void *  res 
)

Definition at line 771 of file StatSystem.cc.

References HRTIME_USECOND, and READ_HTTP_TRANS_STAT.

void initialize_all_global_stats (  ) 
static int open_stats_snap (  )  [static]
static int persistent_stat ( int  i  )  [static]

Definition at line 167 of file StatSystem.cc.

References countof, and non_persistent_stats.

Referenced by clear_stats(), and initialize_all_global_stats().

static void read_stats_snap (  )  [static]
void start_stats_snap ( void   ) 
static Action* stat_callback ( Continuation cont,
HTTPHdr header 
) [static]
static void take_rusage_snap (  )  [static]
static Action* testpage_callback ( Continuation cont,
HTTPHdr  
) [static]
static void testpage_callback_init (  )  [static]
static void write_stats_snap (  )  [static]

Variable Documentation

inkcoreapi ink_unprot_global_stat_t global_dyn_stats[MAX_DYN_STATS-DYN_STAT_START]
ink_stat_lock_t global_http_trans_stat_lock

Definition at line 51 of file StatSystem.cc.

int http_handler_counts[MAX_HTTP_HANDLER_EVENTS]

Definition at line 66 of file StatSystem.cc.

ink_hrtime http_handler_times[MAX_HTTP_HANDLER_EVENTS]

Definition at line 65 of file StatSystem.cc.

int non_persistent_stats[] [static]

Definition at line 78 of file StatSystem.cc.

Referenced by persistent_stat().

struct rusage rusage_snap

Definition at line 59 of file StatSystem.cc.

Referenced by take_rusage_snap().

Definition at line 58 of file StatSystem.cc.

struct rusage rusage_snap_old

Definition at line 60 of file StatSystem.cc.

Referenced by take_rusage_snap().

Definition at line 61 of file StatSystem.cc.

Referenced by take_rusage_snap().

Definition at line 62 of file StatSystem.cc.

Referenced by take_rusage_snap().

char snap_filename[PATH_NAME_MAX+1] = DEFAULT_SNAP_FILENAME

Definition at line 69 of file StatSystem.cc.

Referenced by clear_stats(), initialize_all_global_stats(), and open_stats_snap().

int snap_stats_every = 60

Definition at line 63 of file StatSystem.cc.

Referenced by SnapStatsContinuation::mainEvent(), and start_stats_snap().