Record process definitions. More...
#include "libts.h"
#include "I_Tasks.h"
#include "P_EventSystem.h"
#include "P_RecCore.h"
#include "P_RecProcess.h"
#include "P_RecMessage.h"
#include "P_RecUtils.h"
#include "P_RecFile.h"
#include "mgmtapi.h"
#include "ProcessManager.h"
Go to the source code of this file.
Record process definitions.
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 RecProcess.cc.
int _RecRegisterRawStat | ( | RecRawStatBlock * | rsb, | |
RecT | rec_type, | |||
const char * | name, | |||
RecDataT | data_type, | |||
RecPersistT | persist_type, | |||
int | id, | |||
RecRawStatSyncCb | sync_cb | |||
) |
Definition at line 545 of file RecProcess.cc.
References RecStatMeta::data_raw, Debug, RecRawStatBlock::global, i_am_the_record_owner(), ink_assert, RecRawStat::last_count, RecRawStat::last_sum, RecRecord::rec_type, RecRegisterRawStatSyncCb(), RecRegisterStat(), RecRecord::rsb_id, send_register_message(), RecRecord::stat_meta, and RecRecord::sync_required.
bool i_am_the_record_owner | ( | RecT | rec_type | ) |
Definition at line 53 of file RecProcess.cc.
References g_mode_type, ink_assert, RECM_CLIENT, RECM_STAND_ALONE, RECT_CLUSTER, RECT_CONFIG, RECT_LOCAL, RECT_NODE, RECT_PLUGIN, and RECT_PROCESS.
Referenced by _RecRegisterRawStat(), RecResetStatRecord(), RecSetRecord(), RecSetSyncRequired(), send_pull_message(), and send_push_message().
static int raw_stat_clear | ( | RecRawStatBlock * | rsb, | |
int | id | |||
) | [static] |
Definition at line 215 of file RecProcess.cc.
References EventProcessor::all_dthreads, EventProcessor::all_ethreads, RecRawStat::count, Debug, RecRawStatBlock::ethr_stat_offset, eventProcessor, RecRawStatBlock::global, ink_mutex_acquire(), ink_mutex_release(), RecRawStat::last_count, RecRawStat::last_sum, RecRawStatBlock::mutex, EventProcessor::n_dthreads, EventProcessor::n_ethreads, and RecRawStat::sum.
Referenced by RecExecRawStatSyncCbs().
static int raw_stat_clear_count | ( | RecRawStatBlock * | rsb, | |
int | id | |||
) | [static] |
Definition at line 281 of file RecProcess.cc.
References EventProcessor::all_dthreads, EventProcessor::all_ethreads, RecRawStat::count, Debug, RecRawStatBlock::ethr_stat_offset, eventProcessor, RecRawStatBlock::global, ink_mutex_acquire(), ink_mutex_release(), RecRawStat::last_count, RecRawStatBlock::mutex, EventProcessor::n_dthreads, and EventProcessor::n_ethreads.
Referenced by RecSetRawStatCount().
static int raw_stat_clear_sum | ( | RecRawStatBlock * | rsb, | |
int | id | |||
) | [static] |
Definition at line 250 of file RecProcess.cc.
References EventProcessor::all_dthreads, EventProcessor::all_ethreads, Debug, RecRawStatBlock::ethr_stat_offset, eventProcessor, RecRawStatBlock::global, ink_mutex_acquire(), ink_mutex_release(), RecRawStat::last_sum, RecRawStatBlock::mutex, EventProcessor::n_dthreads, EventProcessor::n_ethreads, and RecRawStat::sum.
Referenced by RecSetRawStatSum().
static int raw_stat_get_total | ( | RecRawStatBlock * | rsb, | |
int | id, | |||
RecRawStat * | total | |||
) | [static] |
Definition at line 122 of file RecProcess.cc.
References EventProcessor::all_dthreads, EventProcessor::all_ethreads, RecRawStat::count, RecRawStatBlock::ethr_stat_offset, eventProcessor, RecRawStatBlock::global, EventProcessor::n_dthreads, EventProcessor::n_ethreads, and RecRawStat::sum.
Referenced by RecGetRawStatCount(), and RecGetRawStatSum().
static int raw_stat_sync_to_global | ( | RecRawStatBlock * | rsb, | |
int | id | |||
) | [static] |
Definition at line 159 of file RecProcess.cc.
References EventProcessor::all_dthreads, EventProcessor::all_ethreads, RecRawStat::count, RecRawStatBlock::ethr_stat_offset, eventProcessor, RecRawStatBlock::global, ink_mutex_acquire(), ink_mutex_release(), RecRawStat::last_count, RecRawStat::last_sum, RecRawStatBlock::mutex, EventProcessor::n_dthreads, EventProcessor::n_ethreads, and RecRawStat::sum.
Referenced by RecRawStatSyncAvg(), RecRawStatSyncCount(), RecRawStatSyncHrTimeAvg(), RecRawStatSyncIntMsecsToFloatSeconds(), RecRawStatSyncMHrTimeAvg(), and RecRawStatSyncSum().
RecRawStatBlock* RecAllocateRawStatBlock | ( | int | num_stats | ) |
Definition at line 519 of file RecProcess.cc.
References EventProcessor::allocate(), ats_malloc(), RecRawStatBlock::ethr_stat_offset, eventProcessor, RecRawStatBlock::global, ink_mutex_init(), RecRawStatBlock::max_stats, RecRawStatBlock::mutex, and RecRawStatBlock::num_stats.
Referenced by api_init(), CacheProcessor::diskInitialized(), UpdateConfigManager::init(), Log::init(), ClusterProcessor::init(), ink_aio_init(), ink_cache_init(), ink_dns_init(), ink_hostdb_init(), ink_net_init(), register_congest_stats(), spdy_config_load(), SSLInitializeStatistics(), start_SocksProxy(), and HttpConfig::startup().
int RecExecRawStatSyncCbs | ( | ) |
Definition at line 875 of file RecProcess.cc.
References RecRecord::data, RecRecord::data_type, g_num_records, g_records, RecRawStatBlock::global, RecRecord::lock, RecRecord::name, raw_stat_clear(), rec_mutex_acquire(), rec_mutex_release(), RecRecord::rec_type, REC_TYPE_IS_STAT, RecRecord::stat_meta, RecStatMeta::sync_cb, RecStatMeta::sync_id, RecRecord::sync_required, RecStatMeta::sync_rsb, RecRawStat::version, and RecRecord::version.
Referenced by raw_stat_sync_cont::exec_callbacks().
int RecGetGlobalRawStatCount | ( | RecRawStatBlock * | rsb, | |
int | id, | |||
int64_t * | data | |||
) |
Definition at line 811 of file RecProcess.cc.
References RecRawStat::count, and RecRawStatBlock::global.
Referenced by aio_stats_cb().
int64_t* RecGetGlobalRawStatCountPtr | ( | RecRawStatBlock * | rsb, | |
int | id | |||
) |
Definition at line 834 of file RecProcess.cc.
References RecRawStat::count, and RecRawStatBlock::global.
RecRawStat* RecGetGlobalRawStatPtr | ( | RecRawStatBlock * | rsb, | |
int | id | |||
) |
Definition at line 822 of file RecProcess.cc.
References RecRawStatBlock::global.
Referenced by dumpICPstatEntry().
int RecGetGlobalRawStatSum | ( | RecRawStatBlock * | rsb, | |
int | id, | |||
int64_t * | data | |||
) |
Definition at line 804 of file RecProcess.cc.
References RecRawStatBlock::global, and RecRawStat::sum.
Referenced by aio_stats_cb(), cache_stats_bytes_used_cb(), and TSStatIntGet().
int64_t* RecGetGlobalRawStatSumPtr | ( | RecRawStatBlock * | rsb, | |
int | id | |||
) |
Definition at line 828 of file RecProcess.cc.
References RecRawStatBlock::global, and RecRawStat::sum.
int RecGetRawStatCount | ( | RecRawStatBlock * | rsb, | |
int | id, | |||
int64_t * | data | |||
) |
Definition at line 746 of file RecProcess.cc.
References RecRawStat::count, and raw_stat_get_total().
int RecGetRawStatSum | ( | RecRawStatBlock * | rsb, | |
int | id, | |||
int64_t * | data | |||
) |
Definition at line 736 of file RecProcess.cc.
References raw_stat_get_total(), and RecRawStat::sum.
int RecIncrGlobalRawStat | ( | RecRawStatBlock * | rsb, | |
int | id, | |||
int64_t | incr | |||
) |
Definition at line 760 of file RecProcess.cc.
References RecRawStat::count, RecRawStatBlock::global, and RecRawStat::sum.
Referenced by CacheProcessor::mark_storage_offline().
int RecIncrGlobalRawStatCount | ( | RecRawStatBlock * | rsb, | |
int | id, | |||
int64_t | incr | |||
) |
Definition at line 775 of file RecProcess.cc.
References RecRawStat::count, and RecRawStatBlock::global.
int RecIncrGlobalRawStatSum | ( | RecRawStatBlock * | rsb, | |
int | id, | |||
int64_t | incr | |||
) |
Definition at line 768 of file RecProcess.cc.
References RecRawStatBlock::global, and RecRawStat::sum.
int RecIncrRawStatBlock | ( | RecRawStatBlock * | , | |
EThread * | , | |||
RecRawStat * | ||||
) |
Definition at line 698 of file RecProcess.cc.
void RecMessageInit | ( | ) |
Definition at line 449 of file RecProcess.cc.
References g_mode_type, ink_assert, message_initialized_p, RECM_NULL, and RecMessageRecvThis().
int RecMessageSend | ( | RecMessage * | msg | ) |
Definition at line 919 of file RecProcess.cc.
References g_mode_type, message_initialized_p, RecMessageHdr::o_end, RecMessageHdr::o_start, RecMessageHdr::o_write, RECM_CLIENT, and RECM_SERVER.
Referenced by send_pull_message(), send_push_message(), send_register_message(), send_reset_message(), and send_set_message().
void RecProcess_set_config_update_interval_ms | ( | int | ms | ) |
Definition at line 100 of file RecProcess.cc.
References Debug, g_rec_config_update_interval_ms, HRTIME_MSECONDS, and Event::schedule_every().
void RecProcess_set_raw_stat_sync_interval_ms | ( | int | ms | ) |
Definition at line 91 of file RecProcess.cc.
References Debug, g_rec_raw_stat_sync_interval_ms, HRTIME_MSECONDS, and Event::schedule_every().
void RecProcess_set_remote_sync_interval_ms | ( | int | ms | ) |
Definition at line 109 of file RecProcess.cc.
References Debug, g_rec_remote_sync_interval_ms, HRTIME_MSECONDS, and Event::schedule_every().
Definition at line 409 of file RecProcess.cc.
References g_mode_type, REC_ERR_FAIL, and RecCoreInit().
Referenced by initialize_process_manager().
int RecProcessInitMessage | ( | RecModeT | mode_type | ) |
Definition at line 460 of file RecProcess.cc.
References EventNotify::lock(), RECG_PULL_REQ, RECM_CLIENT, RecMessageInit(), RecMessageRegisterRecvCb(), recv_message_cb__process(), send_pull_message(), EventNotify::unlock(), and EventNotify::wait().
Referenced by initialize_process_manager().
int RecProcessStart | ( | void | ) |
Definition at line 490 of file RecProcess.cc.
References Debug, ET_TASK, eventProcessor, g_rec_config_update_interval_ms, g_rec_raw_stat_sync_interval_ms, g_rec_remote_sync_interval_ms, g_started, HRTIME_MSECONDS, new_ProxyMutex(), and EventProcessor::schedule_every().
Referenced by main().
int RecRawStatSyncAvg | ( | const char * | name, | |
RecDataT | data_type, | |||
RecData * | data, | |||
RecRawStatBlock * | rsb, | |||
int | id | |||
) |
Definition at line 619 of file RecProcess.cc.
References RecRawStat::count, Debug, RecRawStatBlock::global, raw_stat_sync_to_global(), RecDataSetFromFloat(), and RecRawStat::sum.
Referenced by ClusterProcessor::init(), ink_hostdb_init(), and register_stat_callbacks().
int RecRawStatSyncCount | ( | const char * | name, | |
RecDataT | data_type, | |||
RecData * | data, | |||
RecRawStatBlock * | rsb, | |||
int | id | |||
) |
Definition at line 605 of file RecProcess.cc.
References RecRawStat::count, Debug, RecRawStatBlock::global, raw_stat_sync_to_global(), RecDataSetFromInk64(), and RecRawStat::sum.
Referenced by UpdateConfigManager::init(), ClusterProcessor::init(), ink_hostdb_init(), LogConfig::register_stat_callbacks(), register_stat_callbacks(), spdy_config_load(), SSLInitializeStatistics(), SSLRecRawStatSyncCount(), and start_SocksProxy().
int RecRawStatSyncHrTimeAvg | ( | const char * | name, | |
RecDataT | data_type, | |||
RecData * | data, | |||
RecRawStatBlock * | rsb, | |||
int | id | |||
) |
Definition at line 635 of file RecProcess.cc.
References RecRawStat::count, Debug, RecRawStatBlock::global, HRTIME_SECOND, raw_stat_sync_to_global(), RecDataSetFromFloat(), and RecRawStat::sum.
Referenced by ClusterProcessor::init(), and ink_dns_init().
int RecRawStatSyncIntMsecsToFloatSeconds | ( | const char * | name, | |
RecDataT | data_type, | |||
RecData * | data, | |||
RecRawStatBlock * | rsb, | |||
int | id | |||
) |
Definition at line 655 of file RecProcess.cc.
References RecRawStat::count, Debug, RecRawStatBlock::global, raw_stat_sync_to_global(), RecDataSetFromFloat(), and RecRawStat::sum.
Referenced by register_stat_callbacks().
int RecRawStatSyncMHrTimeAvg | ( | const char * | name, | |
RecDataT | data_type, | |||
RecData * | data, | |||
RecRawStatBlock * | rsb, | |||
int | id | |||
) |
Definition at line 674 of file RecProcess.cc.
References RecRawStat::count, Debug, RecRawStatBlock::global, HRTIME_MSECOND, raw_stat_sync_to_global(), RecDataSetFromFloat(), and RecRawStat::sum.
int RecRawStatSyncSum | ( | const char * | name, | |
RecDataT | data_type, | |||
RecData * | data, | |||
RecRawStatBlock * | rsb, | |||
int | id | |||
) |
Definition at line 591 of file RecProcess.cc.
References RecRawStat::count, Debug, RecRawStatBlock::global, raw_stat_sync_to_global(), RecDataSetFromInk64(), and RecRawStat::sum.
Referenced by cache_stats_bytes_used_cb(), ClusterProcessor::init(), ink_dns_init(), ink_hostdb_init(), register_congest_stats(), register_net_stats(), LogConfig::register_stat_callbacks(), register_stat_callbacks(), spdy_config_load(), and SSLInitializeStatistics().
int RecRegisterManagerCb | ( | int | _signal, | |
RecManagerCb | _fn, | |||
void * | _data | |||
) |
Definition at line 909 of file RecProcess.cc.
Referenced by LogConfig::register_mgmt_callbacks().
int RecRegisterRawStatSyncCb | ( | const char * | name, | |
RecRawStatSyncCb | sync_cb, | |||
RecRawStatBlock * | rsb, | |||
int | id | |||
) |
Definition at line 844 of file RecProcess.cc.
References g_records_ht, g_records_rwlock, RecRawStatBlock::global, ink_hash_table_lookup(), ink_release_assert, ink_rwlock_rdlock(), ink_rwlock_unlock(), rec_mutex_acquire(), rec_mutex_release(), REC_TYPE_IS_STAT, and RecRawStat::version.
Referenced by _RecRegisterRawStat().
int RecSetGlobalRawStatCount | ( | RecRawStatBlock * | rsb, | |
int | id, | |||
int64_t | data | |||
) |
Definition at line 793 of file RecProcess.cc.
References RecRawStat::count, and RecRawStatBlock::global.
Referenced by aio_stats_cb().
int RecSetGlobalRawStatSum | ( | RecRawStatBlock * | rsb, | |
int | id, | |||
int64_t | data | |||
) |
Definition at line 786 of file RecProcess.cc.
References RecRawStatBlock::global, and RecRawStat::sum.
Referenced by aio_stats_cb(), cache_stats_bytes_used_cb(), and TSStatIntSet().
int RecSetRawStatBlock | ( | RecRawStatBlock * | , | |
RecRawStat * | ||||
) |
Definition at line 725 of file RecProcess.cc.
int RecSetRawStatCount | ( | RecRawStatBlock * | rsb, | |
int | id, | |||
int64_t | data | |||
) |
Definition at line 717 of file RecProcess.cc.
References RecRawStat::count, RecRawStatBlock::global, and raw_stat_clear_count().
Referenced by Log::init(), and LogConfig::update_space_used().
int RecSetRawStatSum | ( | RecRawStatBlock * | rsb, | |
int | id, | |||
int64_t | data | |||
) |
Definition at line 709 of file RecProcess.cc.
References RecRawStatBlock::global, raw_stat_clear_sum(), and RecRawStat::sum.
Referenced by Log::init(), and LogConfig::update_space_used().
void RecSignalManager | ( | int | id, | |
const char * | msg, | |||
size_t | msgsize | |||
) |
Definition at line 902 of file RecProcess.cc.
References ink_assert.
Referenced by AIO_Callback_handler::handle_disk_failure(), ClusterHandler::machine_down(), LogUtils::manager_alarm(), RecSignalManager(), RecSignalWarning(), ClusterHandler::startClusterEvent(), and TSMgmtConfigIntSet().
static int recv_message_cb__process | ( | RecMessage * | msg, | |
RecMessageT | msg_type, | |||
void * | cookie | |||
) | [static] |
Definition at line 312 of file RecProcess.cc.
References EventNotify::lock(), REC_ERR_OKAY, RECG_PULL_ACK, recv_message_cb(), EventNotify::signal(), and EventNotify::unlock().
Referenced by RecProcessInitMessage().
Event* config_update_cont_event [static] |
Definition at line 46 of file RecProcess.cc.
EventNotify g_force_req_notify [static] |
Definition at line 41 of file RecProcess.cc.
int g_rec_config_update_interval_ms = REC_CONFIG_UPDATE_INTERVAL_MS [static] |
Definition at line 43 of file RecProcess.cc.
Referenced by RecProcess_set_config_update_interval_ms(), and RecProcessStart().
int g_rec_raw_stat_sync_interval_ms = REC_RAW_STAT_SYNC_INTERVAL_MS [static] |
Definition at line 42 of file RecProcess.cc.
Referenced by RecProcess_set_raw_stat_sync_interval_ms(), and RecProcessStart().
int g_rec_remote_sync_interval_ms = REC_REMOTE_SYNC_INTERVAL_MS [static] |
Definition at line 44 of file RecProcess.cc.
Referenced by RecProcess_set_remote_sync_interval_ms(), and RecProcessStart().
bool g_started = false [static] |
Definition at line 40 of file RecProcess.cc.
Referenced by RecProcessStart().
bool message_initialized_p = false [static] |
Definition at line 39 of file RecProcess.cc.
Referenced by RecMessageInit(), and RecMessageSend().
Event* raw_stat_sync_cont_event [static] |
Definition at line 45 of file RecProcess.cc.
Event* sync_cont_event [static] |
Definition at line 47 of file RecProcess.cc.