section 14 IP Cache
section 14 IP Storage and Handling
section 15 Neighbor Routines
+section 16 Cache Manager API
section 16 Cache Manager Objects
section 17 Request Forwarding
section 18 Cache Manager Statistics
typedef std::vector<Mgr::ActionProfilePointer> Menu;
void registerProfile(char const * action, char const * desc,
- OBJH * handler,
- int pw_req_flag, int atomic);
+ OBJH * handler,
+ int pw_req_flag, int atomic);
void registerProfile(char const * action, char const * desc,
- Mgr::ClassActionCreationHandler *handler,
- int pw_req_flag, int atomic);
+ Mgr::ClassActionCreationHandler *handler,
+ int pw_req_flag, int atomic);
Mgr::ActionProfilePointer findAction(char const * action) const;
Mgr::Action::Pointer createNamedAction(const char *actionName);
Mgr::Action::Pointer createRequestedAction(const Mgr::ActionParams &);
}
DiskdAction::DiskdAction(const Mgr::CommandPointer &aCmd):
- Action(aCmd), data()
+ Action(aCmd), data()
{
debugs(79, 5, HERE);
}
DiskThreadsIOStrategy::registerWithCacheManager(void)
{
Mgr::RegisterAction("squidaio_counts", "Async IO Function Counters",
- aioStats, 0, 1);
+ aioStats, 0, 1);
}
void
httpHeaderRegisterWithCacheManager(void)
{
Mgr::RegisterAction("http_headers",
- "HTTP Header Statistics",
- httpHeaderStoreReport, 0, 1);
+ "HTTP Header Statistics",
+ httpHeaderStoreReport, 0, 1);
}
void
operator <<(std::ostream &os, const StoreIOBuffer &b)
{
return os << "ioBuf(@" << b.offset << ", len=" << b.length << ", " <<
- (void*)b.data << (b.flags.error ? ", ERR" : "") << ')';
+ (void*)b.data << (b.flags.error ? ", ERR" : "") << ')';
}
#endif /* SQUID_STOREIOBUFFER_H */
{
#if DEBUGSTRINGS
Mgr::RegisterAction("strings",
- "Strings in use in squid", Stat, 0, 1);
+ "Strings in use in squid", Stat, 0, 1);
#endif
}
AuthBasicConfig::registerWithCacheManager(void)
{
Mgr::RegisterAction("basicauthenticator",
- "Basic User Authenticator Stats",
- authenticateBasicStats, 0, 1);
+ "Basic User Authenticator Stats",
+ authenticateBasicStats, 0, 1);
}
void
AuthDigestConfig::registerWithCacheManager(void)
{
Mgr::RegisterAction("digestauthenticator",
- "Digest User Authenticator Stats",
- authenticateDigestStats, 0, 1);
+ "Digest User Authenticator Stats",
+ authenticateDigestStats, 0, 1);
}
/* free any allocated configuration details */
AuthNegotiateConfig::registerWithCacheManager(void)
{
Mgr::RegisterAction("negotiateauthenticator",
- "Negotiate User Authenticator Stats",
- authenticateNegotiateStats, 0, 1);
+ "Negotiate User Authenticator Stats",
+ authenticateNegotiateStats, 0, 1);
}
bool
AuthNTLMConfig::registerWithCacheManager(void)
{
Mgr::RegisterAction("ntlmauthenticator",
- "NTLM User Authenticator Stats",
- authenticateNTLMStats, 0, 1);
+ "NTLM User Authenticator Stats",
+ authenticateNTLMStats, 0, 1);
}
bool
if (opt_send_signal == -1) {
Mgr::RegisterAction("config",
- "Current Squid Configuration",
- dump_config,
- 1, 1);
+ "Current Squid Configuration",
+ dump_config,
+ 1, 1);
}
return err_count;
public:
ClassActionCreator(Handler *aHandler): handler(aHandler) {}
- virtual Mgr::Action::Pointer create(const Mgr::Command::Pointer &cmd) const
- {
+ virtual Mgr::Action::Pointer create(const Mgr::Command::Pointer &cmd) const {
return handler(cmd);
}
{
debugs(16, 3, HERE << "registering legacy " << action);
const Mgr::ActionProfile::Pointer profile = new Mgr::ActionProfile(action,
- desc, pw_req_flag, atomic, new Mgr::FunActionCreator(handler));
+ desc, pw_req_flag, atomic, new Mgr::FunActionCreator(handler));
registerProfile(profile);
}
void
CacheManager::registerProfile(char const * action, char const * desc,
- ClassActionCreator::Handler *handler,
- int pw_req_flag, int atomic)
+ ClassActionCreator::Handler *handler,
+ int pw_req_flag, int atomic)
{
const Mgr::ActionProfile::Pointer profile = new Mgr::ActionProfile(action,
- desc, pw_req_flag, atomic, new ClassActionCreator(handler));
+ desc, pw_req_flag, atomic, new ClassActionCreator(handler));
registerProfile(profile);
}
/* warning: this prints decoded password which maybe not what you want to do @?@ @?@ */
debugs(16, 9, "CacheManager::ParseHeaders: got user: '" <<
- params.userName << "' passwd: '" << params.password << "'");
+ params.userName << "' passwd: '" << params.password << "'");
}
/**
ParseHeaders(request, cmd->params);
const char *userName = cmd->params.userName.size() ?
- cmd->params.userName.termedBuf() : "unknown";
+ cmd->params.userName.termedBuf() : "unknown";
/* Check password */
cbdataRegisterWithCacheManager(void)
{
Mgr::RegisterAction("cbdata",
- "Callback Data Registry Contents",
- cbdataDump, 0, 1);
+ "Callback Data Registry Contents",
+ cbdataDump, 0, 1);
#if CBDATA_DEBUG
Mgr::RegisterAction("cbdatahistory",
- "Detailed call history for all current cbdata contents",
- cbdataDumpHistory, 0, 1);
+ "Detailed call history for all current cbdata contents",
+ cbdataDumpHistory, 0, 1);
#endif
}
commEPollRegisterWithCacheManager(void)
{
Mgr::RegisterAction("comm_epoll_incoming",
- "comm_incoming() stats",
- commIncomingStats, 0, 1);
+ "comm_incoming() stats",
+ commIncomingStats, 0, 1);
}
static void
commPollRegisterWithCacheManager(void)
{
Mgr::RegisterAction("comm_poll_incoming",
- "comm_incoming() stats",
- commIncomingStats, 0, 1);
+ "comm_incoming() stats",
+ commIncomingStats, 0, 1);
}
void
commSelectRegisterWithCacheManager(void)
{
Mgr::RegisterAction("comm_select_incoming",
- "comm_incoming() stats",
- commIncomingStats, 0, 1);
+ "comm_incoming() stats",
+ commIncomingStats, 0, 1);
}
void
commSelectRegisterWithCacheManager(void)
{
Mgr::RegisterAction("comm_select_incoming",
- "comm_incoming() stats",
- commIncomingStats, 0, 1);
+ "comm_incoming() stats",
+ commIncomingStats, 0, 1);
}
void
externalAclRegisterWithCacheManager(void)
{
Mgr::RegisterAction("external_acl",
- "External ACL stats",
- externalAclStats, 0, 1);
+ "External ACL stats",
+ externalAclStats, 0, 1);
}
void
fqdncacheRegisterWithCacheManager(void)
{
Mgr::RegisterAction("fqdncache", "FQDN Cache Stats and Contents",
- fqdnStats, 0, 1);
+ fqdnStats, 0, 1);
}
Mgr::Action::Pointer action =
CacheManager::GetInstance()->createRequestedAction(request.params);
AsyncJob::Start(new Mgr::Inquirer(action,
- Mgr::ImportHttpFdIntoComm(request.fd), request, strands_));
+ Mgr::ImportHttpFdIntoComm(request.fd), request, strands_));
}
void
#include "ipc/StrandCoord.h"
#include <vector>
-namespace Ipc {
+namespace Ipc
+{
/// a collection of strand coordinates; the order, if any, is owner-dependent
typedef std::vector<StrandCoord> StrandCoords;
} ctrl; ///< same as .msg_control
/// data offset for the next get/put*() to start with
- mutable unsigned int offset;
+ mutable unsigned int offset;
};
} // namespace Ipc
ipcacheRegisterWithCacheManager(void)
{
Mgr::RegisterAction("ipcache",
- "IP Cache Stats and Contents",
- stat_ipcache_get, 0, 1);
+ "IP Cache Stats and Contents",
+ stat_ipcache_get, 0, 1);
}
{
Mgr::RegisterAction("via_headers", "Via Request Headers", fvdbDumpVia, 0, 1);
Mgr::RegisterAction("forw_headers", "X-Forwarded-For Request Headers",
- fvdbDumpForw, 0, 1);
+ fvdbDumpForw, 0, 1);
}
static void
/// calculate and keep local action-specific information
virtual void collect() {}
- /** start writing action-specific info to Store entry;
+ /** start writing action-specific info to Store entry;
* may collect info during dump, especially if collect() did nothing
* non-atomic() actions may continue writing asynchronously after returning
*/
#include "ipc/TypedMsgHdr.h"
#include "mgr/ActionParams.h"
-Mgr::ActionParams::ActionParams(): httpMethod(METHOD_NONE) {
+Mgr::ActionParams::ActionParams(): httpMethod(METHOD_NONE)
+{
}
Mgr::ActionParams::ActionParams(const Ipc::TypedMsgHdr &msg)
public:
ActionProfile(const char* aName, const char* aDesc, bool aPwReq,
- bool anAtomic, const ActionCreatorPointer &aCreator):
- name(aName), desc(aDesc), isPwReq(aPwReq), isAtomic(anAtomic),
- creator(aCreator)
- {
+ bool anAtomic, const ActionCreatorPointer &aCreator):
+ name(aName), desc(aDesc), isPwReq(aPwReq), isAtomic(anAtomic),
+ creator(aCreator) {
}
public:
CBDATA_NAMESPACED_CLASS_INIT(Mgr, ActionWriter);
Mgr::ActionWriter::ActionWriter(const Action::Pointer &anAction, int aFd):
- StoreToCommWriter(aFd, anAction->createStoreEntry()),
- action(anAction)
+ StoreToCommWriter(aFd, anAction->createStoreEntry()),
+ action(anAction)
{
debugs(16, 5, HERE << "FD " << aFd << " action: " << action);
}
}
Mgr::ReconfigureAction::ReconfigureAction(const Command::Pointer &cmd):
- Action(cmd)
+ Action(cmd)
{
debugs(16, 5, HERE);
}
}
Mgr::OfflineToggleAction::OfflineToggleAction(const Command::Pointer &cmd):
- Action(cmd)
+ Action(cmd)
{
debugs(16, 5, HERE);
}
{
/// combined hard-coded action profile with user-supplied action parameters
-class Command: public RefCountable {
+class Command: public RefCountable
+{
public:
typedef RefCount<Command> Pointer;
}
Mgr::CountersAction::CountersAction(const CommandPointer &cmd):
- Action(cmd), data()
+ Action(cmd), data()
{
debugs(16, 5, HERE);
}
Mgr::Filler::Filler(const Action::Pointer &anAction, int aFd,
unsigned int aRequestId):
- StoreToCommWriter(aFd, anAction->createStoreEntry()),
- action(anAction),
- requestId(aRequestId)
+ StoreToCommWriter(aFd, anAction->createStoreEntry()),
+ action(anAction),
+ requestId(aRequestId)
{
debugs(16, 5, HERE << "FD " << aFd << " action: " << action);
}
unsigned int Mgr::Forwarder::LastRequestId = 0;
Mgr::Forwarder::Forwarder(int aFd, const ActionParams &aParams,
- HttpRequest* aRequest, StoreEntry* anEntry):
- AsyncJob("Mgr::Forwarder"),
- params(aParams),
- request(aRequest), entry(anEntry), fd(aFd), requestId(0), closer(NULL)
+ HttpRequest* aRequest, StoreEntry* anEntry):
+ AsyncJob("Mgr::Forwarder"),
+ params(aParams),
+ request(aRequest), entry(anEntry), fd(aFd), requestId(0), closer(NULL)
{
debugs(16, 5, HERE << "FD " << aFd);
Must(fd >= 0);
EBIT_SET(entry->flags, ENTRY_FWD_HDR_WAIT);
closer = asyncCall(16, 5, "Mgr::Forwarder::noteCommClosed",
- CommCbMemFunT<Forwarder, CommCloseCbParams>(this, &Forwarder::noteCommClosed));
+ CommCbMemFunT<Forwarder, CommCloseCbParams>(this, &Forwarder::noteCommClosed));
comm_add_close_handler(fd, closer);
}
/// closes our copy of the client HTTP connection socket
void
-Mgr::Forwarder::close() {
+Mgr::Forwarder::close()
+{
if (fd >= 0) {
if (closer != NULL) {
comm_remove_close_handler(fd, closer);
debugs(16, 3, HERE);
entry->registerAbort(&Forwarder::Abort, this);
- typedef NullaryMemFunT<Mgr::Forwarder> Dialer;
- AsyncCall::Pointer callback = JobCallback(16, 5, Dialer, this,
- Forwarder::handleRemoteAck);
- if (++LastRequestId == 0) // don't use zero value as requestId
- ++LastRequestId;
- requestId = LastRequestId;
- TheRequestsMap[requestId] = callback;
- Request mgrRequest(KidIdentifier, requestId, fd, params);
- Ipc::TypedMsgHdr message;
+ typedef NullaryMemFunT<Mgr::Forwarder> Dialer;
+ AsyncCall::Pointer callback = JobCallback(16, 5, Dialer, this,
+ Forwarder::handleRemoteAck);
+ if (++LastRequestId == 0) // don't use zero value as requestId
+ ++LastRequestId;
+ requestId = LastRequestId;
+ TheRequestsMap[requestId] = callback;
+ Request mgrRequest(KidIdentifier, requestId, fd, params);
+ Ipc::TypedMsgHdr message;
try {
mgrRequest.pack(message);
- }
- catch (...) {
+ } catch (...) {
// assume the pack() call failed because the message did not fit
// TODO: add a more specific exception?
debugs(16, DBG_CRITICAL, "ERROR: uri " << entry->url() << " exceeds buffer size");
quitOnError("long URI", errorCon(ERR_INVALID_URL, HTTP_REQUEST_URI_TOO_LARGE, request));
}
- Ipc::SendMessage(Ipc::coordinatorAddr, message);
- const double timeout = 10; // in seconds
- eventAdd("Mgr::Forwarder::requestTimedOut", &Forwarder::RequestTimedOut,
- this, timeout, 0, false);
+ Ipc::SendMessage(Ipc::coordinatorAddr, message);
+ const double timeout = 10; // in seconds
+ eventAdd("Mgr::Forwarder::requestTimedOut", &Forwarder::RequestTimedOut,
+ this, timeout, 0, false);
}
void
{
public:
Forwarder(int aFd, const ActionParams &aParams, HttpRequest* aRequest,
- StoreEntry* anEntry);
+ StoreEntry* anEntry);
virtual ~Forwarder();
/// finds and calls the right Forwarder upon Coordinator's response
}
Mgr::FunAction::FunAction(const Command::Pointer &aCmd, OBJH* aHandler):
- Action(aCmd), handler(aHandler)
+ Action(aCmd), handler(aHandler)
{
Must(handler != NULL);
debugs(16, 5, HERE);
explicit FunActionCreator(OBJH *aHandler): handler(aHandler) {}
/* ActionCreator API */
- virtual Action::Pointer create(const CommandPointer &cmd) const
- {
+ virtual Action::Pointer create(const CommandPointer &cmd) const {
return FunAction::Create(cmd, handler);
}
}
Mgr::InfoAction::InfoAction(const CommandPointer &cmd):
- Action(cmd), data()
+ Action(cmd), data()
{
debugs(16, 5, HERE);
}
/// compare Ipc::StrandCoord using kidId, for std::sort() below
static bool
-LesserStrandByKidId(const Ipc::StrandCoord &c1, const Ipc::StrandCoord &c2) {
+LesserStrandByKidId(const Ipc::StrandCoord &c1, const Ipc::StrandCoord &c2)
+{
return c1.kidId < c2.kidId;
}
-Mgr::Inquirer::Inquirer(Action::Pointer anAction, int aFd,
- const Request &aCause, const Ipc::StrandCoords &coords):
- AsyncJob("Mgr::Inquirer"),
- aggrAction(anAction),
- cause(aCause),
- fd(aFd),
- strands(coords), pos(strands.begin()),
- requestId(0), closer(NULL), timeout(aggrAction->atomic() ? 10 : 100)
+Mgr::Inquirer::Inquirer(Action::Pointer anAction, int aFd,
+ const Request &aCause, const Ipc::StrandCoords &coords):
+ AsyncJob("Mgr::Inquirer"),
+ aggrAction(anAction),
+ cause(aCause),
+ fd(aFd),
+ strands(coords), pos(strands.begin()),
+ requestId(0), closer(NULL), timeout(aggrAction->atomic() ? 10 : 100)
{
debugs(16, 5, HERE << "FD " << aFd << " action: " << aggrAction);
std::sort(strands.begin(), strands.end(), LesserStrandByKidId);
closer = asyncCall(16, 5, "Mgr::Inquirer::noteCommClosed",
- CommCbMemFunT<Inquirer, CommCloseCbParams>(this, &Inquirer::noteCommClosed));
+ CommCbMemFunT<Inquirer, CommCloseCbParams>(this, &Inquirer::noteCommClosed));
comm_add_close_handler(fd, closer);
}
/// closes our copy of the client HTTP connection socket
void
-Mgr::Inquirer::close() {
+Mgr::Inquirer::close()
+{
if (fd >= 0) {
removeCloseHandler();
comm_close(fd);
reply->header.putStr(HDR_CONNECTION, "close"); // until we chunk response
std::auto_ptr<MemBuf> replyBuf(reply->pack());
writer = asyncCall(16, 5, "Mgr::Inquirer::noteWroteHeader",
- CommCbMemFunT<Inquirer, CommIoCbParams>(this, &Inquirer::noteWroteHeader));
+ CommCbMemFunT<Inquirer, CommIoCbParams>(this, &Inquirer::noteWroteHeader));
comm_write_mbuf(fd, replyBuf.get(), writer);
}
Must(requestId == 0);
AsyncCall::Pointer callback = asyncCall(16, 5, "Mgr::Inquirer::handleRemoteAck",
- HandleAckDialer(this, &Inquirer::handleRemoteAck, Response()));
+ HandleAckDialer(this, &Inquirer::handleRemoteAck, Response()));
if (++LastRequestId == 0) // don't use zero value as requestId
++LastRequestId;
requestId = LastRequestId;
debugs(16, 4, HERE << "inquire kid: " << kidId << status());
TheRequestsMap[requestId] = callback;
Request mgrRequest(KidIdentifier, requestId, fd,
- aggrAction->command().params);
+ aggrAction->command().params);
Ipc::TypedMsgHdr message;
mgrRequest.pack(message);
Ipc::SendMessage(Ipc::Port::MakeAddr(Ipc::strandAddrPfx, kidId), message);
eventAdd("Mgr::Inquirer::requestTimedOut", &Inquirer::RequestTimedOut,
- this, timeout, 0, false);
+ this, timeout, 0, false);
}
/// called when a strand is done writing its output
{
public:
Inquirer(Action::Pointer anAction, int aFd, const Request &aCause,
- const Ipc::StrandCoords &coords);
+ const Ipc::StrandCoords &coords);
virtual ~Inquirer();
/// finds and calls the right Inquirer upon strand's response
}
Mgr::IntervalAction::IntervalAction(const CommandPointer &cmd, int aMinutes, int aHours):
- Action(cmd), minutes(aMinutes), hours(aHours), data()
+ Action(cmd), minutes(aMinutes), hours(aHours), data()
{
debugs(16, 5, HERE);
}
}
Mgr::IoAction::IoAction(const CommandPointer &cmd):
- Action(cmd), data()
+ Action(cmd), data()
{
debugs(16, 5, HERE);
}
void
Mgr::RegisterAction(char const * action, char const * desc,
- OBJH * handler,
- int pw_req_flag, int atomic)
+ OBJH * handler,
+ int pw_req_flag, int atomic)
{
CacheManager::GetInstance()->registerProfile(action, desc, handler,
- pw_req_flag, atomic);
+ pw_req_flag, atomic);
}
void
Mgr::RegisterAction(char const * action, char const * desc,
- ClassActionCreationHandler *handler,
- int pw_req_flag, int atomic)
+ ClassActionCreationHandler *handler,
+ int pw_req_flag, int atomic)
{
CacheManager::GetInstance()->registerProfile(action, desc, handler,
- pw_req_flag, atomic);
+ pw_req_flag, atomic);
}
{
void RegisterAction(char const * action, char const * desc,
- OBJH * handler,
- int pw_req_flag, int atomic);
+ OBJH * handler,
+ int pw_req_flag, int atomic);
void RegisterAction(char const * action, char const * desc,
- ClassActionCreationHandler *handler,
- int pw_req_flag, int atomic);
+ ClassActionCreationHandler *handler,
+ int pw_req_flag, int atomic);
} // namespace Mgr
Mgr::Request::Request(int aRequestorId, unsigned int aRequestId, int aFd,
- const ActionParams &aParams):
- requestorId(aRequestorId), requestId(aRequestId),
- fd(aFd), params(aParams)
+ const ActionParams &aParams):
+ requestorId(aRequestorId), requestId(aRequestId),
+ fd(aFd), params(aParams)
{
Must(requestorId > 0);
Must(requestId != 0);
namespace Mgr
{
-/// cache manager request
+/// cache manager request
class Request
{
public:
Request(int aRequestorId, unsigned int aRequestId, int aFd,
- const ActionParams &aParams);
+ const ActionParams &aParams);
explicit Request(const Ipc::TypedMsgHdr& msg); ///< from recvmsg()
void pack(Ipc::TypedMsgHdr& msg) const; ///< prepare for sendmsg()
}
Mgr::Response::Response(unsigned int aRequestId, Action::Pointer anAction):
- requestId(aRequestId), action(anAction)
+ requestId(aRequestId), action(anAction)
{
Must(!action || action->name()); // if there is an action, it must be named
}
}
Mgr::ServiceTimesAction::ServiceTimesAction(const CommandPointer &cmd):
- Action(cmd), data()
+ Action(cmd), data()
{
debugs(16, 5, HERE);
}
}
Mgr::StoreIoAction::StoreIoAction(const CommandPointer &cmd):
- Action(cmd), data()
+ Action(cmd), data()
{
debugs(16, 5, HERE);
}
Mgr::StoreToCommWriter::StoreToCommWriter(int aFd, StoreEntry* anEntry):
- AsyncJob("Mgr::StoreToCommWriter"),
- fd(aFd), entry(anEntry), sc(NULL), writeOffset(0), closer(NULL)
+ AsyncJob("Mgr::StoreToCommWriter"),
+ fd(aFd), entry(anEntry), sc(NULL), writeOffset(0), closer(NULL)
{
debugs(16, 6, HERE << "FD " << fd);
closer = asyncCall(16, 5, "Mgr::StoreToCommWriter::noteCommClosed",
- CommCbMemFunT<StoreToCommWriter, CommCloseCbParams>(this, &StoreToCommWriter::noteCommClosed));
+ CommCbMemFunT<StoreToCommWriter, CommCloseCbParams>(this, &StoreToCommWriter::noteCommClosed));
comm_add_close_handler(fd, closer);
}
typedef UnaryMemFunT<StoreToCommWriter, StoreIOBuffer> MyDialer;
AsyncCall::Pointer call =
asyncCall(16, 5, "Mgr::StoreToCommWriter::noteStoreCopied",
- MyDialer(writer, &StoreToCommWriter::noteStoreCopied, ioBuf));
+ MyDialer(writer, &StoreToCommWriter::noteStoreCopied, ioBuf));
ScheduleCallHere(call);
}
typedef CommCbMemFunT<StoreToCommWriter, CommIoCbParams> MyDialer;
AsyncCall::Pointer writer =
asyncCall(16, 5, "Mgr::StoreToCommWriter::noteCommWrote",
- MyDialer(this, &StoreToCommWriter::noteCommWrote));
+ MyDialer(this, &StoreToCommWriter::noteCommWrote));
comm_write(fd, ioBuf.data, ioBuf.length, writer);
}
Mgr::StoreToCommWriter::doneAll() const
{
return entry &&
- entry->store_status == STORE_OK && // the action is over
- writeOffset >= entry->objectLen(); // we wrote all the results
+ entry->store_status == STORE_OK && // the action is over
+ writeOffset >= entry->objectLen(); // we wrote all the results
}
void
neighborsRegisterWithCacheManager()
{
Mgr::RegisterAction("server_list",
- "Peer Cache Statistics",
- neighborDumpPeers, 0, 1);
+ "Peer Cache Statistics",
+ neighborDumpPeers, 0, 1);
if (theInIcpConnection >= 0) {
Mgr::RegisterAction("non_peers",
- "List of Unknown sites sending ICP messages",
- neighborDumpNonPeers, 0, 1);
+ "List of Unknown sites sending ICP messages",
+ neighborDumpNonPeers, 0, 1);
}
}
PconnModule::registerWithCacheManager(void)
{
Mgr::RegisterAction("pconn",
- "Persistent Connection Utilization Histograms",
- DumpWrapper, 0, 1);
+ "Persistent Connection Utilization Histograms",
+ DumpWrapper, 0, 1);
}
void
peerSourceHashRegisterWithCacheManager(void)
{
Mgr::RegisterAction("sourcehash", "peer sourcehash information",
- peerSourceHashCachemgr, 0, 1);
+ peerSourceHashCachemgr, 0, 1);
}
peer *
peerUserHashRegisterWithCacheManager(void)
{
Mgr::RegisterAction("userhash", "peer userhash information", peerUserHashCachemgr,
- 0, 1);
+ 0, 1);
}
peer *
for (i = 0; i < _iostats::histSize; i++) {
storeAppendPrintf(sentry, "%5d-%5d: %9.0f %2.0f%%\n",
- i ? (1 << (i - 1)) + 1 : 1,
- 1 << i,
- stats.http_read_hist[i],
- Math::doublePercent(stats.http_read_hist[i], stats.http_reads));
+ i ? (1 << (i - 1)) + 1 : 1,
+ 1 << i,
+ stats.http_read_hist[i],
+ Math::doublePercent(stats.http_read_hist[i], stats.http_reads));
}
storeAppendPrintf(sentry, "\n");
for (i = 0; i < _iostats::histSize; i++) {
storeAppendPrintf(sentry, "%5d-%5d: %9.0f %2.0f%%\n",
- i ? (1 << (i - 1)) + 1 : 1,
- 1 << i,
- stats.ftp_read_hist[i],
- Math::doublePercent(stats.ftp_read_hist[i], stats.ftp_reads));
+ i ? (1 << (i - 1)) + 1 : 1,
+ 1 << i,
+ stats.ftp_read_hist[i],
+ Math::doublePercent(stats.ftp_read_hist[i], stats.ftp_reads));
}
storeAppendPrintf(sentry, "\n");
for (i = 0; i < _iostats::histSize; i++) {
storeAppendPrintf(sentry, "%5d-%5d: %9.0f %2.0f%%\n",
- i ? (1 << (i - 1)) + 1 : 1,
- 1 << i,
- stats.gopher_read_hist[i],
- Math::doublePercent(stats.gopher_read_hist[i], stats.gopher_reads));
+ i ? (1 << (i - 1)) + 1 : 1,
+ 1 << i,
+ stats.gopher_read_hist[i],
+ Math::doublePercent(stats.gopher_read_hist[i], stats.gopher_reads));
}
storeAppendPrintf(sentry, "\n");
stats.client_http_kbytes_out = XAVG(client_http.kbytes_out.kb);
stats.client_http_all_median_svc_time = statHistDeltaMedian(&l->client_http.all_svc_time,
- &f->client_http.all_svc_time) / 1000.0;
+ &f->client_http.all_svc_time) / 1000.0;
stats.client_http_miss_median_svc_time = statHistDeltaMedian(&l->client_http.miss_svc_time,
- &f->client_http.miss_svc_time) / 1000.0;
+ &f->client_http.miss_svc_time) / 1000.0;
stats.client_http_nm_median_svc_time = statHistDeltaMedian(&l->client_http.nm_svc_time,
- &f->client_http.nm_svc_time) / 1000.0;
+ &f->client_http.nm_svc_time) / 1000.0;
stats.client_http_nh_median_svc_time = statHistDeltaMedian(&l->client_http.nh_svc_time,
- &f->client_http.nh_svc_time) / 1000.0;
+ &f->client_http.nh_svc_time) / 1000.0;
stats.client_http_hit_median_svc_time = statHistDeltaMedian(&l->client_http.hit_svc_time,
- &f->client_http.hit_svc_time) / 1000.0;
+ &f->client_http.hit_svc_time) / 1000.0;
stats.server_all_requests = XAVG(server.all.requests);
stats.server_all_errors = XAVG(server.all.errors);
stats.icp_r_kbytes_recv = XAVG(icp.r_kbytes_recv.kb);
stats.icp_query_median_svc_time = statHistDeltaMedian(&l->icp.query_svc_time,
- &f->icp.query_svc_time) / 1000000.0;
+ &f->icp.query_svc_time) / 1000000.0;
stats.icp_reply_median_svc_time = statHistDeltaMedian(&l->icp.reply_svc_time,
- &f->icp.reply_svc_time) / 1000000.0;
+ &f->icp.reply_svc_time) / 1000000.0;
stats.dns_median_svc_time = statHistDeltaMedian(&l->dns.svc_time,
- &f->dns.svc_time) / 1000.0;
+ &f->dns.svc_time) / 1000.0;
stats.unlink_requests = XAVG(unlink.requests);
stats.page_faults = XAVG(page_faults);
stats.select_loops = XAVG(select_loops);
stats.select_fds = XAVG(select_fds);
stats.average_select_fd_period = f->select_fds > l->select_fds ?
- (f->select_time - l->select_time) / (f->select_fds - l->select_fds) : 0.0;
+ (f->select_time - l->select_time) / (f->select_fds - l->select_fds) : 0.0;
stats.median_select_fds = statHistDeltaMedian(&l->select_fds_hist, &f->select_fds_hist);
stats.swap_outs = XAVG(swap.outs);
statRegisterWithCacheManager(void)
{
Mgr::RegisterAction("info", "General Runtime Information",
- &Mgr::InfoAction::Create, 0, 1);
+ &Mgr::InfoAction::Create, 0, 1);
Mgr::RegisterAction("service_times", "Service Times (Percentiles)",
- &Mgr::ServiceTimesAction::Create, 0, 1);
+ &Mgr::ServiceTimesAction::Create, 0, 1);
Mgr::RegisterAction("filedescriptors", "Process Filedescriptor Allocation",
- fde::DumpStats, 0, 1);
+ fde::DumpStats, 0, 1);
Mgr::RegisterAction("objects", "All Cache Objects", stat_objects_get, 0, 0);
Mgr::RegisterAction("vm_objects", "In-Memory and In-Transit Objects",
- stat_vmobjects_get, 0, 0);
+ stat_vmobjects_get, 0, 0);
Mgr::RegisterAction("io", "Server-side network read() size histograms",
- &Mgr::IoAction::Create, 0, 1);
+ &Mgr::IoAction::Create, 0, 1);
Mgr::RegisterAction("counters", "Traffic and Resource Counters",
- &Mgr::CountersAction::Create, 0, 1);
+ &Mgr::CountersAction::Create, 0, 1);
Mgr::RegisterAction("peer_select", "Peer Selection Algorithms",
- statPeerSelect, 0, 1);
+ statPeerSelect, 0, 1);
Mgr::RegisterAction("digest_stats", "Cache Digest and ICP blob",
- statDigestBlob, 0, 1);
+ statDigestBlob, 0, 1);
Mgr::RegisterAction("5min", "5 Minute Average of Counters",
- &Mgr::IntervalAction::Create5min, 0, 1);
+ &Mgr::IntervalAction::Create5min, 0, 1);
Mgr::RegisterAction("60min", "60 Minute Average of Counters",
- &Mgr::IntervalAction::Create60min, 0, 1);
+ &Mgr::IntervalAction::Create60min, 0, 1);
Mgr::RegisterAction("utilization", "Cache Utilization",
- statUtilization, 0, 1);
+ statUtilization, 0, 1);
Mgr::RegisterAction("histograms", "Full Histogram Counts",
- statCountersHistograms, 0, 1);
+ statCountersHistograms, 0, 1);
Mgr::RegisterAction("active_requests",
- "Client-side Active Requests",
- statClientRequests, 0, 1);
+ "Client-side Active Requests",
+ statClientRequests, 0, 1);
Mgr::RegisterAction("username_cache",
- "Active Cached Usernames",
- AuthUser::UsernameCacheStats, 0, 1);
+ "Active Cached Usernames",
+ AuthUser::UsernameCacheStats, 0, 1);
#if DEBUG_OPENFD
Mgr::RegisterAction("openfd_objects", "Objects with Swapout files open",
- statOpenfdObj, 0, 0);
+ statOpenfdObj, 0, 0);
#endif
#if STAT_GRAPHS
Mgr::RegisterAction("graph_variables", "Display cache metrics graphically",
- statGraphDump, 0, 1);
+ statGraphDump, 0, 1);
#endif
}
Mgr::RegisterAction("storedir", "Store Directory Stats", Store::Stats, 0, 1);
Mgr::RegisterAction("store_io", "Store IO Interface Stats", &Mgr::StoreIoAction::Create, 0, 1);
Mgr::RegisterAction("store_check_cachable_stats", "storeCheckCachable() Stats",
- storeCheckCachableStats, 0, 1);
+ storeCheckCachableStats, 0, 1);
}
void
storeLogRegisterWithCacheManager(void)
{
Mgr::RegisterAction("store_log_tags", "Histogram of store.log tags",
- storeLogTagsHist, 0, 1);
+ storeLogTagsHist, 0, 1);
}
void
void
Mgr::RegisterAction(char const * action, char const * desc,
- Mgr::ClassActionCreationHandler *handler,
- int pw_req_flag, int atomic)
+ Mgr::ClassActionCreationHandler *handler,
+ int pw_req_flag, int atomic)
{
}