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"
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 Action * | stat_callback (Continuation *cont, HTTPHdr *header) |
static Action * | testpage_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< ProxyMutex > | rusage_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 [] |
A brief file description.
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 _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 int(SnapCont::* SnapContHandler)(int, void *) |
Definition at line 366 of file StatSystem.cc.
static void clear_stats | ( | ) | [static] |
Definition at line 195 of file StatSystem.cc.
References ink_unprot_global_stat_t::count, Debug, global_dyn_stats, persistent_stat(), snap_filename, socketManager, ink_unprot_global_stat_t::sum, and SocketManager::unlink().
Referenced by read_stats_snap().
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 | ( | ) |
Definition at line 471 of file StatSystem.cc.
References clear_http_handler_times(), Debug, global_dyn_stats, global_http_trans_stat_lock, INITIALIZE_GLOBAL_DYN_STATS, INITIALIZE_GLOBAL_TRANS_STATS, ink_mutex_init(), new_ProxyMutex(), PATH_NAME_MAX, persistent_stat(), read_stats_snap(), REC_ReadConfigString, RecConfigReadRuntimeDir(), StatPagesManager::register_http(), Layout::relative_to(), snap_filename, stat_callback(), STAT_LOCK_INIT, statPagesManager, take_rusage_snap(), testpage_callback_init(), and Warning.
Referenced by main().
static int open_stats_snap | ( | ) | [static] |
Definition at line 183 of file StatSystem.cc.
References _O_ATTRIB_NORMAL, SocketManager::open(), snap_filename, socketManager, and Warning.
Referenced by read_stats_snap(), and write_stats_snap().
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] |
Definition at line 219 of file StatSystem.cc.
References clear_stats(), SocketManager::close(), ink_unprot_global_stat_t::count, Debug, global_dyn_stats, Note, open_stats_snap(), SocketManager::read(), socketManager, and ink_unprot_global_stat_t::sum.
Referenced by initialize_all_global_stats().
void start_stats_snap | ( | void | ) |
Definition at line 383 of file StatSystem.cc.
References ET_CALL, eventProcessor, HRTIME_SECONDS, EventProcessor::schedule_every(), snap_stats_every, SNAP_USAGE_PERIOD, and Warning.
Referenced by main().
static Action* stat_callback | ( | Continuation * | cont, | |
HTTPHdr * | header | |||
) | [static] |
Definition at line 393 of file StatSystem.cc.
References ats_free(), ats_malloc(), StatPageData::data, Continuation::handleEvent(), ink_strlcat(), ink_strlcpy(), StatPageData::length, URL::path_get(), RecGetRecordPrefix_Xmalloc(), STAT_PAGE_FAILURE, STAT_PAGE_SUCCESS, and HTTPHdr::url_get().
Referenced by initialize_all_global_stats().
static void take_rusage_snap | ( | ) | [static] |
Definition at line 348 of file StatSystem.cc.
References Debug, ink_get_hrtime(), Note, rusage_snap, rusage_snap_old, rusage_snap_time, and rusage_snap_time_old.
Referenced by initialize_all_global_stats(), and SnapCont::mainEvent().
static Action* testpage_callback | ( | Continuation * | cont, | |
HTTPHdr * | ||||
) | [static] |
Definition at line 445 of file StatSystem.cc.
References ats_malloc(), StatPageData::data, Continuation::handleEvent(), StatPageData::length, and STAT_PAGE_SUCCESS.
Referenced by testpage_callback_init().
static void testpage_callback_init | ( | ) | [static] |
Definition at line 465 of file StatSystem.cc.
References StatPagesManager::register_http(), statPagesManager, and testpage_callback().
Referenced by initialize_all_global_stats().
static void write_stats_snap | ( | ) | [static] |
Definition at line 277 of file StatSystem.cc.
References ats_free(), ats_malloc(), SocketManager::close(), ink_unprot_global_stat_t::count, Debug, global_dyn_stats, global_http_trans_stat_lock, memcpy, open_stats_snap(), READ_GLOBAL_DYN_STAT, socketManager, STAT_LOCK_ACQUIRE, STAT_LOCK_RELEASE, ink_unprot_global_stat_t::sum, Warning, and SocketManager::write().
Referenced by SnapStatsContinuation::mainEvent().
inkcoreapi ink_unprot_global_stat_t global_dyn_stats[MAX_DYN_STATS-DYN_STAT_START] |
Definition at line 53 of file StatSystem.cc.
Referenced by clear_stats(), initialize_all_global_stats(), read_stats_snap(), and write_stats_snap().
ink_stat_lock_t global_http_trans_stat_lock |
Definition at line 50 of file StatSystem.cc.
Referenced by initialize_all_global_stats(), HttpTransact::State::record_transaction_stats(), and write_stats_snap().
ink_unprot_global_stat_t global_http_trans_stats[MAX_HTTP_TRANS_STATS] |
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().