Squid Web Cache master
Loading...
Searching...
No Matches
PeeringActivityTimer Class Reference

#include <FwdState.h>

Collaboration diagram for PeeringActivityTimer:
[legend]

Public Member Functions

 PeeringActivityTimer (const HttpRequestPointer &)
 resumes timer
 
 ~PeeringActivityTimer ()
 pauses timer if stop() has not been called
 
void stop ()
 pauses timer if stop() has not been called
 

Private Member Functions

Stopwatch & timer ()
 managed Stopwatch object within HierarchyLogEntry
 

Private Attributes

HttpRequestPointer request
 the owner of managed HierarchyLogEntry
 
bool stopped = false
 Whether the task is done participating in the managed activity.
 

Detailed Description

Eliminates excessive Stopwatch pause() calls in a task with multiple code locations that pause a stopwatch. Ideally, there would be just one such location (e.g., a task class destructor), but current code idiosyncrasies necessitate this state. For simplicity sake, this class currently manages a Stopwatch at a hard-coded location: HttpRequest::hier.totalPeeringTime.

Definition at line 57 of file FwdState.h.

Constructor & Destructor Documentation

◆ PeeringActivityTimer()

PeeringActivityTimer::PeeringActivityTimer ( const HttpRequestPointer &  r)

Definition at line 1563 of file FwdState.cc.

References Assure, request, Stopwatch::resume(), and timer().

◆ ~PeeringActivityTimer()

PeeringActivityTimer::~PeeringActivityTimer ( )

Definition at line 1569 of file FwdState.cc.

References stop().

Member Function Documentation

◆ stop()

void PeeringActivityTimer::stop ( )
inline

◆ timer()

Stopwatch & PeeringActivityTimer::timer ( )
private

Definition at line 1575 of file FwdState.cc.

References HttpRequest::hier, request, and HierarchyLogEntry::totalPeeringTime.

Referenced by PeeringActivityTimer(), and stop().

Member Data Documentation

◆ request

HttpRequestPointer PeeringActivityTimer::request
private

Definition at line 77 of file FwdState.h.

Referenced by PeeringActivityTimer(), and timer().

◆ stopped

bool PeeringActivityTimer::stopped = false
private

Definition at line 83 of file FwdState.h.

Referenced by stop().


The documentation for this class was generated from the following files: