Skip to main content
Version: 9.2605.x.x RR

RequestStatistics

The RequestStatistics class provides various statistical information about a request. For more information on how you can use the class, check the example in monitoring/simulate_navajo_op_via_lua.example delivered with the package.

The default use case is to use the RequestStatistics class instead of the NavajoOp trace group, to customize tracing.

Class function

RequestStatistics:new(req)

Instantiates a new RequestStatistics object.

  • req: The incoming request.

Sample:

local statistic = RequestStatistics:new(req)

Object methods

RequestStatistics:getFilterChain()

Returns the filter chain that was called for the current request.

Sample:

local invS = statistic:getFilterChain()

RequestStatistics:getTimeSpentInFrontend()

Returns the time spent reading/writing data from/to the frontend.

Sample:

local dTFrs = statistic:getTimeSpentInFrontend()

RequestStatistics:getSessionId()

Returns the session ID, or "<NULL>" if no session was obtained or created.

Sample:

local clID = statistic:getSessionId()

RequestStatistics:getTransferId()

Returns the transfer ID — a unique ID that identifies the request.

Sample:

local trID = statistic:getTransferId()

RequestStatistics:getThreadCounter()

Returns the number of concurrent threads.

Sample:

local cR = statistic:getThreadCounter()

RequestStatistics:getTimeSpentInTotalSoFar()

Returns the total time spent in the proxy up to now.

Sample:

local timeSpent = statistic:getTimeSpentInTotalSoFar()

RequestStatistics:getRequestPath()

Returns the parsed request path and, if it differs, the unparsed request URI as a second return value.

The parsed request path is the "translated" path used to find which filters and servlets are mapped to it. The unparsed URI is the URI as received from the frontend (for example an encrypted URI if an UrlEncryptionFilter was involved).

Sample:

local path, unparsedUri = statistic:getRequestPath()

RequestStatistics:getEvents()

Returns a comma-separated list of events that have been set, or nil if no events have been set.

Sample:

local event = statistic:getEvents()