#include <CodeContext.h>
![Inheritance graph](classCodeContext__inherit__graph.png)
![Collaboration graph](classCodeContext__coll__graph.png)
Public Types | |
typedef RefCount< CodeContext > | Pointer |
Public Member Functions | |
~CodeContext () override | |
virtual ScopedId | codeContextGist () const =0 |
virtual std::ostream & | detailCodeContext (std::ostream &os) const =0 |
appends human-friendly context description line(s) to a cache.log record More... | |
Static Public Member Functions | |
static const Pointer & | Current () |
static void | Reset () |
forgets the current context, setting it to nil/unknown More... | |
static void | Reset (const Pointer) |
changes the current context; nil argument sets it to nil/unknown More... | |
Public Attributes | |
Stopwatch | busyTime |
time spent in this context (see also: busy_time) More... | |
Static Private Member Functions | |
static void | ForgetCurrent () |
static void | Entering (const Pointer &codeCtx) |
static void | Leaving () |
Detailed Description
Interface for reporting what Squid code is working on. Such reports are usually requested outside creator's call stack. They are especially useful for attributing low-level errors to transactions.
Definition at line 52 of file CodeContext.h.
Member Typedef Documentation
◆ Pointer
typedef RefCount<CodeContext> CodeContext::Pointer |
Definition at line 55 of file CodeContext.h.
Constructor & Destructor Documentation
◆ ~CodeContext()
|
inlineoverride |
Definition at line 66 of file CodeContext.h.
Member Function Documentation
◆ codeContextGist()
|
pure virtual |
- Returns
- a small, permanent ID of the current context gists persist forever and are suitable for passing to other SMP workers
Implemented in Comm::Connection, htcpSpecifier, Acl::ParsingContext, AccessLogEntry, AnyP::PortCfg, PrecomputedCodeContext, and FadingCodeContext.
Referenced by Entering(), and operator<<().
◆ Current()
|
static |
- Returns
- the known global context or, to indicate unknown context, nil
Definition at line 33 of file CodeContext.cc.
References Instance().
Referenced by CallAndRestore_(), CallSubscription< Call_ >::callback(), CallContextCreator(), clientConnectionsClose(), clientHttpConnectionsOpen(), commStartHalfClosedMonitor(), CurrentCodeContextDetail(), HappyOrderEnforcer::enqueue(), CommQuotaQueue::enqueue(), StoreEntry::invokeHandlers(), neighborsUdpPing(), peerDnsRefreshStart(), Security::KeyLog::record(), Reset(), ScheduleCall(), Ftp::StartListening(), Ftp::StopListening(), tunnelDelayedClientRead(), and tunnelDelayedServerRead().
◆ detailCodeContext()
|
pure virtual |
Implemented in Comm::Connection, htcpSpecifier, Acl::ParsingContext, AccessLogEntry, AnyP::PortCfg, PrecomputedCodeContext, and FadingCodeContext.
◆ Entering()
|
staticprivate |
Switches the current context to the given known context. Improves debugging output by replacing omni-directional "Reset" with directional "Entering".
Definition at line 55 of file CodeContext.cc.
References busyTime, codeContextGist(), debugs, ForgetCurrent(), Instance(), and Stopwatch::resume().
Referenced by Reset().
◆ ForgetCurrent()
|
staticprivate |
Forgets the current known context, possibly triggering its destruction. Preserves the gist of the being-forgotten context during its destruction. Knows nothing about the next context – the caller must set it.
Definition at line 42 of file CodeContext.cc.
References assert, FadingCodeContext::gist, and Instance().
Referenced by Entering(), and Leaving().
◆ Leaving()
|
staticprivate |
Forgets the current known context. Improves debugging output by replacing omni-directional "Reset" with directional "Leaving".
Definition at line 68 of file CodeContext.cc.
References debugs, ForgetCurrent(), and Instance().
Referenced by Reset().
◆ Reset() [1/2]
|
static |
Definition at line 77 of file CodeContext.cc.
References Instance(), and Leaving().
Referenced by CallAndRestore_(), CallContextCreator(), checkTimeouts(), clientConnectionsClose(), clientHttpConnectionsOpen(), ClientHttpRequest::ClientHttpRequest(), CodeContextGuard::CodeContextGuard(), comm_close_complete(), Http::Stream::finished(), AsyncCallQueue::fire(), StoreEntry::invokeHandlers(), neighborsUdpPing(), peerCountMcastPeersCreateAndSend(), peerDnsRefreshStart(), ConnStateData::postHttpsAccept(), Ftp::StartListening(), Ftp::StopListening(), tunnelDelayedClientRead(), tunnelDelayedServerRead(), and CodeContextGuard::~CodeContextGuard().
◆ Reset() [2/2]
|
static |
Definition at line 84 of file CodeContext.cc.
References Current(), Entering(), and Leaving().
Member Data Documentation
◆ busyTime
Stopwatch CodeContext::busyTime |
Definition at line 76 of file CodeContext.h.
Referenced by Format::Format::assemble(), and Entering().
The documentation for this class was generated from the following files:
- src/base/CodeContext.h
- src/base/CodeContext.cc
Introduction
- About Squid
- Why Squid?
- Squid Developers
- How to Donate
- How to Help Out
- Getting Squid
- Squid Source Packages
- Squid Deployment Case-Studies
- Squid Software Foundation
Documentation
- Quick Setup
- Configuration:
- FAQ and Wiki
- Guide Books:
- Non-English
- More...
Support
- Security Advisories
- Bugzilla Database
- Mailing lists
- Contacting us
- Commercial services
- Project Sponsors
- Squid-based products