Page Speed Optimization Libraries
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
net_instaweb::RequestTimingInfo Class Reference

#include "request_timing_info.h"

Public Member Functions

 RequestTimingInfo (Timer *timer, AbstractMutex *mutex)
void RequestStarted ()
void ProcessingStarted ()
void ParsingStarted ()
 This should be called if/when HTML parsing begins.
void FirstByteReturned ()
 Called when the first byte is sent back to the user.
void PropertyCacheLookupStarted ()
 This should be called when a PropertyCache lookup is initiated.
void PropertyCacheLookupFinished ()
 This should be called when a PropertyCache lookup completes.
void RequestFinished ()
void FetchStarted ()
void FetchHeaderReceived ()
void FetchFinished ()
void SetHTTPCacheLatencyMs (int64 latency_ms)
void SetL2HTTPCacheLatencyMs (int64 latency_ms)
int64 GetElapsedMs () const
 Milliseconds since Init.
bool GetTimeToStartProcessingMs (int64 *elapsed_ms) const
 Milliseconds from request start to processing start.
bool GetProcessingElapsedMs (int64 *elapsed_ms) const
bool GetTimeToPropertyCacheLookupStartMs (int64 *elapsed_ms) const
 Milliseconds from request start to pcache lookup start.
bool GetTimeToPropertyCacheLookupEndMs (int64 *elapsed_ms) const
 Milliseconds from request start to pcache lookup end.
bool GetHTTPCacheLatencyMs (int64 *latency_ms) const
 HTTP Cache latencies.
bool GetL2HTTPCacheLatencyMs (int64 *latency_ms) const
bool GetTimeToStartFetchMs (int64 *elapsed_ms) const
 Milliseconds from request start to fetch start.
bool GetFetchHeaderLatencyMs (int64 *latency_ms) const
 Milliseconds from fetch start to header received.
bool GetFetchLatencyMs (int64 *latency_ms) const
 Milliseconds from fetch start to fetch end.
bool GetTimeToFirstByte (int64 *latency_ms) const
bool GetTimeToStartParseMs (int64 *elapsed_ms) const
 Milliseconds from request start to parse start.
int64 init_ts_ms () const
int64 start_ts_ms () const

Detailed Description

RequestTimingInfo tracks various event timestamps over the lifetime of a request. The timeline looks (roughly) like the following, with the associated RequestTimingInfo calls.

Constructor & Destructor Documentation

net_instaweb::RequestTimingInfo::RequestTimingInfo ( Timer timer,
AbstractMutex mutex 

Initialize the TimingInfo with the specified Timer. Sets init_ts_ to Timer::NowMs, from which GetElapsedMs is based. NOTE: Timer and mutex are not owned by TimingInfo.

Member Function Documentation

void net_instaweb::RequestTimingInfo::FetchStarted ( )

Fetch related timing events. Note: Only the first call to FetchStarted will have an effect, subsequent calls are silent no-ops.

TODO(gee): Fetch and cache timing is busted for reconstructing resources with multiple inputs.
bool net_instaweb::RequestTimingInfo::GetProcessingElapsedMs ( int64 *  elapsed_ms) const

Milliseconds spent "processing": end time - start time - fetch time.

TODO(gee): This naming is somewhat misleading since it is from request start not processing start. Leaving as is for historical reasons, at least for the time being.
bool net_instaweb::RequestTimingInfo::GetTimeToFirstByte ( int64 *  latency_ms) const

Milliseconds from receiving the request (Init) to responding with the first byte of data.

void net_instaweb::RequestTimingInfo::ProcessingStarted ( )

This should be called once the options are available and PSOL can start doing meaningful work.

void net_instaweb::RequestTimingInfo::RequestFinished ( )

Called when the request is finished, i.e. the response has been sent to the client.

void net_instaweb::RequestTimingInfo::RequestStarted ( )

This should be called when the request "starts", potentially after queuing. It denotes the request "start time", which "elapsed" timing values are relative to.

void net_instaweb::RequestTimingInfo::SetHTTPCacheLatencyMs ( int64  latency_ms)
TODO(gee): I'd really prefer these to be start/end calls, but the WriteThroughCache design pattern will not allow for this.

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