MCPcopy Create free account
hub / github.com/apache/cassandra-nodejs-driver / _trackResponse

Method _trackResponse

lib/request-execution.js:195–216  ·  view source on GitHub ↗
(latency, errorCode, err, length)

Source from the content-addressed store, hash-verified

193 }
194
195 _trackResponse(latency, errorCode, err, length) {
196 // Record metrics
197 RequestExecution._invokeMetricsHandler(errorCode, this._parent.client.metrics, err, latency);
198
199 // Request tracker
200 const tracker = this._parent.client.options.requestTracker;
201
202 if (tracker === null) {
203 return;
204 }
205
206 // Avoid using instanceof as property check is faster
207 const query = this._request.query || this._request.queries;
208 const parameters = this._request.params;
209 const requestLength = this._request.length;
210
211 if (err) {
212 tracker.onError(this._host, query, parameters, this._parent.executionOptions, requestLength, err, latency);
213 } else {
214 tracker.onSuccess(this._host, query, parameters, this._parent.executionOptions, requestLength, length, latency);
215 }
216 }
217
218 _getResultSet(response, agreement) {
219 const rs = new types.ResultSet(response, this._host.address, this._parent.triedHosts, this._parent.speculativeExecutions,

Callers 1

_sendOnConnectionMethod · 0.95

Calls 3

_invokeMetricsHandlerMethod · 0.80
onErrorMethod · 0.65
onSuccessMethod · 0.65

Tested by

no test coverage detected