gadgets.h File Reference
#include <ctime>
#include <iosfwd>
Include dependency graph for gadgets.h:
This graph shows which files directly or indirectly include this file:

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

Definition at line 16 of file gadgets.h.

Function Documentation

◆ getCurrentTime()

◆ operator!=()

bool operator!= ( const timeval &  a,
const timeval &  b 
)
inline

Definition at line 116 of file gadgets.h.

References timercmp.

◆ operator<()

bool operator< ( const timeval &  a,
const timeval &  b 
)
inline

Definition at line 103 of file gadgets.h.

References timercmp.

◆ operator<<()

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

◆ operator<=()

bool operator<= ( const timeval &  a,
const timeval &  b 
)
inline

Definition at line 124 of file gadgets.h.

◆ operator==()

bool operator== ( const timeval &  a,
const timeval &  b 
)
inline

Definition at line 137 of file gadgets.h.

◆ operator>()

bool operator> ( const timeval &  a,
const timeval &  b 
)
inline

Definition at line 110 of file gadgets.h.

References timercmp.

◆ operator>=()

bool operator>= ( const timeval &  a,
const timeval &  b 
)
inline

Definition at line 131 of file gadgets.h.

◆ 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().

◆ tvToMsec()

long int tvToMsec ( struct timeval &  t)
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

◆ current_time

struct timeval 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

time_t squid_curtime
extern

Definition at line 20 of file stub_libtime.cc.

Referenced by getCurrentTime().

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors