CirrusSearch
Elasticsearch-powered search for MediaWiki
Loading...
Searching...
No Matches
CirrusSearch\RequestLog Interface Reference

Represents logging information for a single network operation made between php and elasticsearch. More...

+ Inheritance diagram for CirrusSearch\RequestLog:

Public Member Functions

 start ()
 Called when the network request is started.
 
 finish ()
 Called when the network request has finished.
 
 getQueryType ()
 
 getDescription ()
 
 formatDescription ()
 
 getTookMs ()
 
 getElasticTookMs ()
 
 isCachedResponse ()
 
 getLogVariables ()
 
 getRequests ()
 

Detailed Description

Represents logging information for a single network operation made between php and elasticsearch.

Information returned from here goes through the RequestLogger class and gets logged to the cirrussearch-request channel for later processing in analytics platforms.

Member Function Documentation

◆ finish()

CirrusSearch\RequestLog::finish ( )

Called when the network request has finished.

Implemented in CirrusSearch\BaseRequestLog, CirrusSearch\BulkUpdateRequestLog, and CirrusSearch\SearchRequestLog.

◆ formatDescription()

CirrusSearch\RequestLog::formatDescription ( )
Returns
string Get the request description, formatted as per psr-3 guidelines with self::getLogVariables()

Implemented in CirrusSearch\BaseRequestLog.

◆ getDescription()

CirrusSearch\RequestLog::getDescription ( )
Returns
string Get the raw psr-3 compliant request description

Implemented in CirrusSearch\BaseRequestLog.

◆ getElasticTookMs()

CirrusSearch\RequestLog::getElasticTookMs ( )
Returns
int The number of ms elasticsearch reported spending on the request, or -1 if no request was made (such as cached responses).

Implemented in CirrusSearch\BulkUpdateRequestLog, CirrusSearch\CompletionRequestLog, and CirrusSearch\SearchRequestLog.

◆ getLogVariables()

CirrusSearch\RequestLog::getLogVariables ( )
Returns
array Various information about the request(s). The exact set of returned keys can vary, but should generally conform to what is expected in RequestLogger::buildRequestSetLog(). This must return a single map of k/v pairs regardless of the number of requests represented here. This is utilized primarily for error reporting purposes.

Implemented in CirrusSearch\BulkUpdateRequestLog, CirrusSearch\CompletionRequestLog, CirrusSearch\MultiSearchRequestLog, and CirrusSearch\SearchRequestLog.

◆ getQueryType()

CirrusSearch\RequestLog::getQueryType ( )
Returns
string The type of query that was performed

Implemented in CirrusSearch\BaseRequestLog.

◆ getRequests()

CirrusSearch\RequestLog::getRequests ( )
Returns
array[] array of arrays containing various information about the request(s). The exact returned keys can vary, but should generally conform to what is expected in RequestLogger::buildRequestSetLog(). This must return one map per request represented by this log. This is primarily used for structured logging of request data to be analyzed in analytics platforms.

Implemented in CirrusSearch\BulkUpdateRequestLog, CirrusSearch\CompletionRequestLog, CirrusSearch\MultiSearchRequestLog, and CirrusSearch\SearchRequestLog.

◆ getTookMs()

CirrusSearch\RequestLog::getTookMs ( )
Returns
int|null The number of ms php spend waiting for the request, or null if the request has not finished yet.

Implemented in CirrusSearch\BaseRequestLog.

◆ isCachedResponse()

CirrusSearch\RequestLog::isCachedResponse ( )
Returns
bool Was this query answered without talking to elasticsearch?

Implemented in CirrusSearch\BulkUpdateRequestLog, CirrusSearch\CompletionRequestLog, and CirrusSearch\SearchRequestLog.

◆ start()

CirrusSearch\RequestLog::start ( )

Called when the network request is started.

Implemented in CirrusSearch\BaseRequestLog.


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