#include <ctime>
#include <iosfwd>
Go to the source code of this file.
Namespaces | |
namespace | Time |
Time and Date handling tools. | |
Typedefs | |
typedef uint64_t | time_msec_t |
Functions | |
time_t | getCurrentTime () |
time_t | Time::ParseIso3307 (const char *) |
Convert from ISO 3307 style time: YYYYMMDDHHMMSS or YYYYMMDDHHMMSS.xxx. More... | |
const char * | Time::FormatRfc1123 (time_t) |
time_t | Time::ParseRfc1123 (const char *) |
Convert from RFC 1123 style time: "www, DD MMM YYYY hh:mm:ss ZZZ". More... | |
const char * | Time::FormatStrf (time_t) |
const char * | Time::FormatHttpd (time_t) |
int | tvSubUsec (struct timeval A, struct timeval B) |
double | tvSubDsec (struct timeval A, struct timeval B) |
int | tvSubMsec (struct timeval A, struct timeval B) |
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) |
long int | tvToMsec (struct timeval &t) |
std::ostream & | operator<< (std::ostream &, const timeval &) |
prints <seconds>.<microseconds> More... | |
bool | operator< (const timeval &a, const timeval &b) |
bool | operator> (const timeval &a, const timeval &b) |
bool | operator!= (const timeval &a, const timeval &b) |
bool | operator<= (const timeval &a, const timeval &b) |
bool | operator>= (const timeval &a, const timeval &b) |
bool | operator== (const timeval &a, const timeval &b) |
Variables | |
double | current_dtime |
the current UNIX time in seconds (with microsecond precision) More... | |
time_t | squid_curtime |
the current UNIX time in seconds More... | |
struct timeval | current_time |
the current UNIX time in timeval {seconds, microseconds} format More... | |
Typedef Documentation
◆ time_msec_t
typedef uint64_t time_msec_t |
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.
Referenced by BandwidthBucket::BandwidthBucket(), DebugMessageHeader::DebugMessageHeader(), IcmpSquid::Close(), Helper::SessionBase::closePipesSafely(), Helper::SessionBase::closeWritePipeSafely(), comm_check_incoming_poll_handlers(), comm_check_incoming_select_handlers(), Fs::Ufs::UFSSwapDir::createDirectory(), IpcIoFile::DiskerHandleRequests(), Comm::DoSelect(), DelayPools::Init(), ipc_thread_1(), Rock::Rebuild::loadingSteps(), main(), netdbReloadState(), netdbSaveState(), IcmpPinger::Open(), Helper::Client::openSessions(), statefulhelper::openSessions(), Fs::Ufs::RebuildState::rebuildStep(), SquidMain(), storeDirWriteCleanLogs(), Time::Engine::tick(), unlinkdClose(), Rock::Rebuild::validationSteps(), and watch_child().
◆ operator!=()
|
inline |
◆ operator<()
|
inline |
◆ operator<<()
std::ostream & operator<< | ( | std::ostream & | os, |
const timeval & | t | ||
) |
Definition at line 28 of file stub_libtime.cc.
References Time::FormatHttpd(), Time::FormatRfc1123(), Time::FormatStrf(), Time::ParseIso3307(), Time::ParseRfc1123(), and STUB_RETVAL().
◆ operator<=()
|
inline |
◆ operator==()
|
inline |
◆ operator>()
|
inline |
◆ operator>=()
|
inline |
◆ tvAdd()
void tvAdd | ( | struct timeval & | res, |
struct timeval const & | t1, | ||
struct timeval const & | t2 | ||
) |
◆ 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 | ||
) |
timeval subtraction operation
- Parameters
-
[out] res = t2 - t1
Definition at line 58 of file gadgets.cc.
Referenced by Adaptation::Icap::History::currentTime(), Adaptation::Icap::Xaction::finalizeLogInfo(), ClientHttpRequest::logRequest(), HierarchyLogEntry::peerResponseTime(), IpcIoMsg::stat(), and HierarchyLogEntry::stopPeerClock().
◆ tvSubDsec()
double tvSubDsec | ( | struct timeval | A, |
struct timeval | B | ||
) |
timeval subtraction operation.
- Returns
- (A-B) in seconds (with microsecond precision)
Definition at line 44 of file gadgets.cc.
Referenced by cacheResetDigest(), GetAvgStat(), GetCountersStats(), GetInfo(), idnsCheckQueue(), idnsStats(), snmp_prfSysFn(), snmp_sysFn(), PeerSelectorPingMonitor::startWaiting(), statAvgTick(), statClientRequests(), statCPUUsage(), storeDirWriteCleanLogs(), and storeRebuildComplete().
◆ tvSubMsec()
int tvSubMsec | ( | struct timeval | A, |
struct timeval | B | ||
) |
timeval subtraction operation.
- Returns
- (A-B) in whole milliseconds XXX: result is not compatible with time_msec_t millisecond storage
Definition at line 51 of file gadgets.cc.
Referenced by IpCacheLookupForwarder::additionalLookupDelay(), fqdncache_entry::age(), IpcIoFile::canWait(), IpcIoFile::DiskerHandleRequests(), PeerSelector::handleHtcpParentMiss(), PeerSelector::handleIcpParentMiss(), helperReturnBuffer(), helperStatefulHandleRead(), idnsCheckQueue(), Rock::Rebuild::loadingSteps(), neighborUpdateRtt(), netdbReloadState(), netdbSaveState(), Helper::Client::packStatsInto(), peerCountHandleIcpReply(), Fs::Ufs::RebuildState::rebuildStep(), Icmp4::Recv(), Icmp6::Recv(), Adaptation::History::Entry::rptm(), Ping::TimerStop(), IpCacheLookupForwarder::totalResponseTime(), ClientHttpRequest::updateCounters(), Rock::Rebuild::validationSteps(), and IpcIoFile::WaitBeforePop().
◆ 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().
◆ tvToMsec()
|
inline |
Convert timeval to milliseconds XXX: result is not compatible with time_msec_t millisecond storage
Definition at line 93 of file gadgets.h.
Referenced by Format::Format::assemble(), Adaptation::Icap::History::processingTime(), Log::Format::SquidIcap(), Log::Format::SquidNative(), Adaptation::Icap::History::start(), and Adaptation::Icap::History::stop().
Variable Documentation
◆ current_dtime
|
extern |
Definition at line 19 of file stub_libtime.cc.
Referenced by BandwidthBucket::BandwidthBucket(), FadingCounter::clear(), FadingCounter::count(), EventScheduler::dump(), DumpMallocStatistics(), getCurrentTime(), HappyConnOpener::maybeOpenPrimeConnection(), SpareAllowanceGiver::recordAllowance(), BandwidthBucket::refillBucket(), Mem::Report(), EventScheduler::schedule(), ClientInfo::setWriteLimiter(), HappyOrderEnforcer::startedWaiting(), and EventScheduler::timeRemaining().
◆ current_time
|
extern |
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
|
extern |
Definition at line 20 of file stub_libtime.cc.
Referenced by getCurrentTime().