gadgets.cc File Reference
#include "squid.h"
#include "time/gadgets.h"
#include <iomanip>
#include <ostream>
Include dependency graph for gadgets.cc:

Go to the source code of this file.

Functions

time_t getCurrentTime ()
 
int tvSubUsec (struct timeval t1, struct timeval t2)
 
double tvSubDsec (struct timeval t1, struct timeval t2)
 
int tvSubMsec (struct timeval t1, struct timeval t2)
 
void tvSub (struct timeval &res, struct timeval const &t1, struct timeval const &t2)
 
void tvAdd (struct timeval &res, struct timeval const &t1, struct timeval const &t2)
 
void tvAssignAdd (struct timeval &t, struct timeval const &add)
 
std::ostream & operator<< (std::ostream &os, const timeval &t)
 prints <seconds>.<microseconds> More...
 

Variables

struct timeval current_time
 the current UNIX time in timeval {seconds, microseconds} format More...
 
double current_dtime
 the current UNIX time in seconds (with microsecond precision) More...
 
time_t squid_curtime = 0
 the current UNIX time in seconds More...
 

Function Documentation

◆ getCurrentTime()

time_t getCurrentTime ( )

Update squid_curtime (also current_time, and current_dtime)

Returns
new value of squid_curtime

Definition at line 22 of file gadgets.cc.

References current_dtime, current_time, double, and squid_curtime.

◆ operator<<()

std::ostream & operator<< ( std::ostream &  os,
const timeval &  t 
)

Definition at line 89 of file gadgets.cc.

◆ tvAdd()

void tvAdd ( struct timeval &  res,
struct timeval const &  t1,
struct timeval const &  t2 
)

timeval addition operation

Parameters
[out]res= t1 + t2

Definition at line 69 of file gadgets.cc.

◆ tvAssignAdd()

void tvAssignAdd ( struct timeval &  t,
struct timeval const &  add 
)

timeval addition assignment operation

Parameters
[out]t+= add

Definition at line 79 of file gadgets.cc.

Referenced by Adaptation::Icap::History::processingTime(), and Adaptation::Icap::History::stop().

◆ tvSub()

void tvSub ( struct timeval &  res,
struct timeval const &  t1,
struct timeval const &  t2 
)

◆ tvSubDsec()

double tvSubDsec ( struct timeval  A,
struct timeval  B 
)

◆ tvSubMsec()

◆ tvSubUsec()

int tvSubUsec ( struct timeval  A,
struct timeval  B 
)

timeval subtraction operation.

Returns
(A-B) in whole microseconds XXX: result is not compatible with time_msec_t millisecond storage

Definition at line 37 of file gadgets.cc.

Referenced by clientUpdateHierCounters(), and icpUdpSendQueue().

Variable Documentation

◆ current_dtime

double current_dtime

Definition at line 18 of file gadgets.cc.

Referenced by getCurrentTime().

◆ current_time

struct timeval current_time

Definition at line 17 of file gadgets.cc.

Referenced by ClientHttpRequest::ClientHttpRequest(), DebugMessageHeader::DebugMessageHeader(), Fs::Ufs::RebuildState::RebuildState(), Adaptation::Icap::Xaction::Xaction(), IpCacheLookupForwarder::additionalLookupDelay(), fqdncache_entry::age(), Format::Format::assemble(), authDigestNonceIsStale(), authenticateDigestNonceCacheCleanup(), authenticateDigestNonceNew(), IpcIoFile::canWait(), Auth::CredentialsCache::cleanup(), clientBeginRequest(), StoreEntry::complete(), Adaptation::Icap::History::currentTime(), IpcIoFile::DiskerHandleRequests(), Adaptation::Icap::Xaction::finalizeLogInfo(), IpCacheLookupForwarder::forwardLookup(), fqdncache_nbgethostbyaddr(), GetCountersStats(), getCurrentTime(), GetInfo(), Adaptation::Icap::ModXact::handleCommRead(), Adaptation::Icap::OptXact::handleCommRead(), PeerSelector::handleHtcpParentMiss(), PeerSelector::handleIcpParentMiss(), helperDispatch(), helperReturnBuffer(), helperStatefulDispatch(), helperStatefulHandleRead(), htcpSyncAle(), icpSyncAle(), icpUdpSend(), icpUdpSendQueue(), idnsCheckQueue(), idnsSendQuery(), idnsStartQuery(), idnsStats(), Rock::Rebuild::loadingSteps(), Icmp::Log(), ClientHttpRequest::logRequest(), IpCacheLookupForwarder::lookupsStarting(), neighborsUdpPing(), neighborUpdateRtt(), netdbReloadState(), netdbSaveState(), HierarchyLogEntry::notePeerRead(), HierarchyLogEntry::notePeerWrite(), PeerSelectorPingMonitor::noteWaitOver(), Helper::Client::packStatsInto(), peerCountHandleIcpReply(), peerCountMcastPeersCreateAndSend(), peerSelect(), ConnStateData::postHttpsAccept(), IpcIoFile::push(), Fs::Ufs::RebuildState::rebuildStep(), PeerSelector::resolveSelected(), Adaptation::History::Entry::rptm(), PeerSelector::selectSomeNeighbor(), Icmp4::SendEcho(), Icmp6::SendEcho(), snmp_prfSysFn(), snmp_sysFn(), Log::Format::SquidIcap(), SquidMain(), Log::Format::SquidNative(), Log::Format::SquidReferer(), Adaptation::Ecap::XactionRep::start(), Rock::Rebuild::start(), Adaptation::Icap::History::start(), HierarchyLogEntry::startPeerClock(), Adaptation::Icap::ModXact::startShoveling(), Adaptation::Icap::OptXact::startShoveling(), PeerSelectorPingMonitor::startWaiting(), IpcIoMsg::stat(), statAvgTick(), statClientRequests(), HierarchyLogEntry::stopPeerClock(), storeDirWriteCleanLogs(), storeLog(), storeRebuildComplete(), IpCacheLookupForwarder::totalResponseTime(), ClientHttpRequest::updateCounters(), Rock::Rebuild::validationSteps(), and IpcIoFile::WaitBeforePop().

◆ squid_curtime

time_t squid_curtime = 0

Definition at line 19 of file gadgets.cc.

Referenced by ClpMap< Key, Value, MemoryUsedBy >::Entry::Entry(), ipcache_entry::ipcache_entry(), MemChunk::MemChunk(), PeerDigest::PeerDigest(), Auth::User::absorb(), addedEntry(), Auth::User::addIp(), StoreEntry::adjustVary(), AlreadyTimedOut(), Format::Format::assemble(), clientReplyContext::buildReplyHeader(), Downloader::buildRequest(), Adaptation::Icap::ServiceRep::changeOptions(), HttpStateData::checkDateSkew(), CommSelectEngine::checkEvents(), checkFailureRatio(), Mem::Meter::checkHighWater(), StoreEntry::checkNegativeHit(), Adaptation::Icap::ServiceRep::checkOptions(), MemPoolChunked::clean(), clientdbCutoffDenied(), clientdbGC(), clientdbUpdate(), commSetConnTimeout(), ErrorState::compileLegacyCode(), Adaptation::Icap::Options::configure(), MemPoolChunked::convertFreeCacheToChunkFreeCache(), CachePeer::countFailure(), TestRock::createEntry(), Comm::ConnOpener::createFd(), Auth::User::CredentialsCacheStats(), death(), Kid::deathDuration(), ErrorState::Dump(), dump_peers(), fde::dumpStats(), Enqueue(), ClpMap< Key, Value, MemoryUsedBy >::Entry::expired(), StoreEntry::expireNow(), expiresMoreThan(), external_acl_entry_expired(), external_acl_grace_expired(), fdAdjustReserved(), Mgr::Action::fillEntry(), FwdState::ForwardTimeout(), fqdncache_gethostbyaddr(), fqdncacheAddEntry(), fqdncacheCallback(), fqdncacheExpiredEntry(), fqdncacheParse(), fqdnStats(), Store::Controller::freeMemorySpace(), Adaptation::Icap::Options::fresh(), MemPoolChunked::get(), get_session_cb(), getCurrentTime(), Helper::Client::handleFewerServers(), PeerPoolMgr::handleOpenedConnection(), HttpReply::hdrExpirationTime(), HeapKeyGen_StoreEntry_LFUDA(), htcpTstReply(), Log::Format::HttpdCombined(), Log::Format::HttpdCommon(), Ftp::HttpReplyWrapper(), icpGetCommonOpcode(), idnsRead(), internalStart(), ipcache_gethostbyname(), ipcacheAddEntry(), ipcacheCallback(), ipcacheExpiredEntry(), ipcacheHandleReply(), ipcacheInvalidate(), ipcacheInvalidateNegative(), ipcacheStatPrint(), Comm::Connection::lifeTime(), logfile_mod_daemon_writeline(), lru_stats(), Fs::Ufs::UFSSwapDir::maintain(), Store::Controller::maintain(), Adaptation::Icap::ModXact::makeRequestHeaders(), Acl::CurrentTimeCheck::match(), Comm::MortalReadTimeout(), StoreEntry::negativeCache(), neighborsUdpPing(), neighborUp(), netdbBinaryExchange(), netdbClosestParent(), netdbExchangeUpdatePeer(), netdbHostData(), netdbHostHops(), netdbHostRtt(), netdbPingSite(), netdbSendPing(), netdbUpdatePeer(), Comm::Connection::noteStart(), Comm::TcpAcceptor::okToAccept(), Helper::Client::openSessions(), statefulhelper::openSessions(), Adaptation::Icap::ServiceRep::optionsFetchTime(), peerAlive(), peerDigestCheck(), peerDigestFetchReply(), peerDigestFetchSetStats(), peerDigestNeeded(), peerDigestNewDelay(), peerDigestPDFinish(), peerDigestRequest(), peerDigestSetCheck(), peerProbeConnect(), peerProbeIsBusy(), peerWouldBePinged(), Mem::PoolReport(), Helper::Client::prepSubmit(), ClientInfo::quota(), HttpReply::redirect(), MessageDelayPool::refillBucket(), refreshCheck(), Helper::Session::requestTimeout(), helper_stateful_server::reserve(), FwdState::retryOrBail(), saneDiff(), Adaptation::Icap::ServiceRep::scheduleUpdate(), Mgr::Forwarder::sendError(), HttpReply::setHeaders(), Comm::SetSelect(), squidaio_queue_request(), Log::Format::SquidUserAgent(), Mgr::Inquirer::start(), CacheManager::start(), Kid::start(), MyTestProgram::startup(), StatefulEnqueue(), StatefulGetFirstAvailable(), Kid::stop(), store_session_cb(), storeCreatePureEntry(), storeDigestCalcCap(), storeDigestRewriteFinish(), storeDigestRewriteResume(), storeRebuildProgress(), Adaptation::Icap::ServiceRep::suspend(), DiskdIOStrategy::sync(), Helper::Client::syncQueueStats(), TestClpMap::testReplaceEntryWithShorterTtl(), TestClpMap::testTtlExpiration(), TestUfs::testUfsSearch(), TestClpMap::testZeroTtl(), Helper::Request::timedOut(), StoreEntry::timestampsSet(), StoreEntry::touch(), clientReplyContext::traceReply(), ExternalACLEntry::update(), DelayPools::Update(), ipcache_entry::updateTtl(), urnHandleReply(), StoreEntry::validToSend(), Comm::Write(), and writeTimedOut().

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors