#include <Congestion.h>
Inherits RequestData.
Definition at line 199 of file Congestion.h.
CongestionEntry::CongestionEntry | ( | const char * | hostname, | |
sockaddr const * | ip, | |||
CongestionControlRecord * | rule, | |||
uint64_t | key | |||
) |
Definition at line 552 of file Congestion.cc.
References ats_ip_copy(), ats_strdup, clearFailHistory(), CongestionControlRecord::get(), m_hist_lock, m_hostname, m_ip, new_ProxyMutex(), and IpEndpoint::sa.
CongestionEntry::CongestionEntry | ( | ) | [inline] |
Definition at line 411 of file Congestion.h.
References m_hist_lock, m_ip, and new_ProxyMutex().
CongestionEntry::~CongestionEntry | ( | ) | [inline, virtual] |
Definition at line 422 of file Congestion.h.
References ats_free(), m_hist_lock, and m_hostname.
void CongestionEntry::applyNewRule | ( | CongestionControlRecord * | rule | ) |
Definition at line 605 of file Congestion.cc.
References FailHistory::events, CongestionControlRecord::fail_window, CongestionControlRecord::get(), init(), m_congested, m_history, m_M_congested, and m_num_connections.
Referenced by validate().
void CongestionEntry::clearFailHistory | ( | ) | [inline] |
Definition at line 405 of file Congestion.h.
References FailHistory::init(), m_congested, and m_history.
Referenced by CongestionEntry(), and init().
int CongestionEntry::client_retry_after | ( | ) | [inline] |
Definition at line 307 of file Congestion.h.
References F_congested(), ink_get_hrtime(), ink_hrtime_to_sec(), FailHistory::last_event, m_history, and InkRand::random().
Referenced by HttpTransact::build_error_response().
bool CongestionEntry::compCongested | ( | ) | [inline] |
Definition at line 378 of file Congestion.h.
References FailHistory::events, m_congested, and m_history.
Referenced by failed_at().
bool CongestionEntry::congested | ( | ) | [inline] |
Definition at line 340 of file Congestion.h.
References F_congested(), and m_M_congested.
Referenced by get_congest_list(), and CongestionDBCont::get_congest_list().
int CongestionEntry::connect_retries | ( | ) | [inline] |
Definition at line 346 of file Congestion.h.
References F_congested().
Referenced by HttpTransact::handle_response_from_server().
int CongestionEntry::connect_timeout | ( | ) | [inline] |
Definition at line 356 of file Congestion.h.
References F_congested().
Referenced by HttpSM::attach_server_session(), and HttpSM::do_http_server_open().
void CongestionEntry::connection_closed | ( | ) | [inline] |
Definition at line 396 of file Congestion.h.
References m_M_congested, and m_num_connections.
Referenced by HttpTransact::State::destroy().
void CongestionEntry::connection_opened | ( | ) | [inline] |
Definition at line 389 of file Congestion.h.
References m_num_connections.
Referenced by HttpSM::handle_http_server_open(), and HttpSM::state_raw_http_server_open().
virtual RD_Type CongestionEntry::data_type | ( | void | ) | [inline, virtual] |
Reimplemented from RequestData.
Definition at line 249 of file Congestion.h.
bool CongestionEntry::F_congested | ( | ) | [inline] |
Definition at line 323 of file Congestion.h.
References m_congested.
Referenced by client_retry_after(), congested(), connect_retries(), connect_timeout(), HttpSM::do_http_server_open(), and HttpTransact::handle_server_died().
void CongestionEntry::failed_at | ( | ink_hrtime | t | ) |
Definition at line 702 of file Congestion.cc.
References compCongested(), Debug, FailHistory::last_event, m_congested, m_hist_lock, m_history, m_last_congested, MUTEX_TRY_LOCK, FailHistory::regist_event(), and this_ethread().
Referenced by HttpTransact::handle_server_died(), and CCFailHistoryTestCont::schedule_event().
void CongestionEntry::get | ( | void | ) | [inline] |
Definition at line 432 of file Congestion.h.
References m_ref_count.
Referenced by CongestionDB::addRecord(), and get_congest_entry().
virtual const sockaddr* CongestionEntry::get_client_ip | ( | ) | [inline, virtual] |
Implements RequestData.
Definition at line 245 of file Congestion.h.
virtual const char* CongestionEntry::get_host | ( | ) | [inline, virtual] |
virtual sockaddr const* CongestionEntry::get_ip | ( | ) | [inline, virtual] |
Implements RequestData.
Definition at line 241 of file Congestion.h.
References m_ip, and IpEndpoint::sa.
virtual char* CongestionEntry::get_string | ( | ) | [inline, virtual] |
Implements RequestData.
Definition at line 233 of file Congestion.h.
char* CongestionEntry::getErrorPage | ( | ) | [inline] |
Definition at line 278 of file Congestion.h.
Referenced by HttpTransact::handle_server_died().
void CongestionEntry::go_alive | ( | ) |
Definition at line 726 of file Congestion.cc.
References m_congested.
Referenced by HttpSM::kill_this().
void CongestionEntry::init | ( | CongestionControlRecord * | rule | ) |
Definition at line 571 of file Congestion.cc.
References clearFailHistory(), CongestionControlRecord::get(), m_M_congested, and m_num_connections.
Referenced by applyNewRule(), and CCFailHistoryTestCont::mainEvent().
bool CongestionEntry::M_congested | ( | ink_hrtime | t | ) | [inline] |
Definition at line 328 of file Congestion.h.
References m_last_M_congested, m_M_congested, and m_num_connections.
Referenced by HttpSM::do_http_server_open().
bool CongestionEntry::proxy_retry | ( | ink_hrtime | t | ) | [inline] |
Definition at line 318 of file Congestion.h.
References ink_hrtime_to_sec(), FailHistory::last_event, and m_history.
Referenced by HttpSM::do_http_server_open().
void CongestionEntry::put | ( | ) | [inline] |
Definition at line 438 of file Congestion.h.
References m_ref_count.
Referenced by CongestionDB::addRecord(), congestEntryGC(), HttpTransact::State::destroy(), CongestionDBCont::GC(), CongestionDB::process(), CongestionDB::removeAllRecords(), CongestionDB::removeRecord(), CongestionDB::revalidateBucket(), and CCFailHistoryTestCont::~CCFailHistoryTestCont().
int CongestionEntry::sprint | ( | char * | buf, | |
int | buflen, | |||
int | format = 0 | |||
) |
Definition at line 641 of file Congestion.cc.
References ats_ip_ntop(), ats_is_ip(), congestionControlLocalTime, FailHistory::events, ink_get_hrtime(), ink_hrtime_to_sec(), ink_localtime_r(), FailHistory::last_event, m_congested, m_history, m_hostname, m_ip, m_key, m_last_congested, m_num_connections, m_ref_count, m_stat_congested_conn_failures, m_stat_congested_max_conn, PER_IP, IpEndpoint::sa, and LogUtils::timestamp().
Referenced by CCFailHistoryTestCont::check_history(), CCCongestionDBTestCont::get_congest_list(), get_congest_list(), and CongestionDBCont::get_congest_list().
void CongestionEntry::stat_inc_F | ( | ) | [inline] |
Definition at line 367 of file Congestion.h.
References m_stat_congested_conn_failures.
Referenced by HttpSM::do_http_server_open(), and HttpTransact::handle_server_died().
void CongestionEntry::stat_inc_M | ( | ) | [inline] |
Definition at line 373 of file Congestion.h.
References m_stat_congested_max_conn.
Referenced by HttpSM::do_http_server_open().
bool CongestionEntry::usefulInfo | ( | ink_hrtime | t | ) | [inline] |
Definition at line 299 of file Congestion.h.
References FailHistory::events, FailHistory::last_event, m_congested, m_history, m_num_connections, and m_ref_count.
Referenced by congestEntryGC(), and CongestionDBCont::GC().
bool CongestionEntry::validate | ( | ) |
Definition at line 587 of file Congestion.cc.
References applyNewRule(), CongestionControlled(), m_hostname, m_ip, m_key, make_key(), and IpEndpoint::sa.
Referenced by CongestionDB::revalidateBucket().
volatile int CongestionEntry::m_congested |
Definition at line 215 of file Congestion.h.
Referenced by applyNewRule(), clearFailHistory(), compCongested(), F_congested(), failed_at(), CCCongestionDBTestCont::gen_CongestionEntry(), go_alive(), sprint(), and usefulInfo().
Definition at line 213 of file Congestion.h.
Referenced by CongestionEntry(), failed_at(), and ~CongestionEntry().
Definition at line 212 of file Congestion.h.
Referenced by applyNewRule(), CCFailHistoryTestCont::check_history(), clearFailHistory(), client_retry_after(), compCongested(), failed_at(), proxy_retry(), sprint(), and usefulInfo().
Definition at line 205 of file Congestion.h.
Referenced by CongestionEntry(), get_host(), sprint(), validate(), and ~CongestionEntry().
Definition at line 204 of file Congestion.h.
Referenced by CongestionEntry(), get_ip(), sprint(), and validate().
uint64_t CongestionEntry::m_key |
Definition at line 202 of file Congestion.h.
Referenced by CongestionDB::addRecord(), CCCongestionDBTestCont::mainEvent(), sprint(), and validate().
Definition at line 214 of file Congestion.h.
Referenced by failed_at(), and sprint().
Definition at line 219 of file Congestion.h.
Referenced by M_congested().
volatile int CongestionEntry::m_M_congested |
Definition at line 218 of file Congestion.h.
Referenced by applyNewRule(), congested(), connection_closed(), init(), and M_congested().
Definition at line 222 of file Congestion.h.
Referenced by applyNewRule(), connection_closed(), connection_opened(), init(), M_congested(), sprint(), and usefulInfo().
Definition at line 226 of file Congestion.h.
Referenced by CCCongestionDBTestCont::gen_CongestionEntry(), get(), put(), sprint(), and usefulInfo().
Definition at line 216 of file Congestion.h.
Referenced by sprint(), and stat_inc_F().
Definition at line 223 of file Congestion.h.
Referenced by sprint(), and stat_inc_M().
Definition at line 209 of file Congestion.h.
Referenced by get_congest_list(), and CongestionDBCont::get_congest_list().