Page Speed Optimization Libraries  1.7.30.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions
net_instaweb::RequestContext::TimingInfo Class Reference

#include "request_context.h"

List of all members.

Public Member Functions

 TimingInfo (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

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


Constructor & Destructor Documentation

net_instaweb::RequestContext::TimingInfo::TimingInfo ( 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

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

Todo:
TODO(gee): Fetch and cache timing is busted for reconstructing resources with multiple inputs.

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

Todo:
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.

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

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

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

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

Todo:
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:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines