From 082a088882ceece8b0460ef875b48624e58dc6f0 Mon Sep 17 00:00:00 2001 From: Brian Nichols Date: Mon, 26 Feb 2024 15:56:49 -0500 Subject: [PATCH] Calculate latency on AEROSPIKE_ERR_RECORD_NOT_FOUND too. --- src/main/aerospike/as_command.c | 5 +++++ src/main/aerospike/as_event.c | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/src/main/aerospike/as_command.c b/src/main/aerospike/as_command.c index 31095d2e0..81111976d 100644 --- a/src/main/aerospike/as_command.c +++ b/src/main/aerospike/as_command.c @@ -715,6 +715,11 @@ as_command_execute(as_command* cmd, as_error* err) case AEROSPIKE_ERR_RECORD_NOT_FOUND: // Do not increment error count on record not found. + // Add latency metrics instead. + if (latency_type != AS_LATENCY_TYPE_NONE) { + uint64_t elapsed = cf_getns() - begin; + as_node_add_latency(node, latency_type, elapsed); + } as_error_set_in_doubt(err, cmd->flags & AS_COMMAND_FLAGS_READ, cmd->sent); break; diff --git a/src/main/aerospike/as_event.c b/src/main/aerospike/as_event.c index 78308ea61..2d569fa8b 100644 --- a/src/main/aerospike/as_event.c +++ b/src/main/aerospike/as_event.c @@ -1317,6 +1317,11 @@ as_event_response_error(as_event_command* cmd, as_error* err) case AEROSPIKE_ERR_RECORD_NOT_FOUND: // Do not increment error count on record not found. + // Add latency metrics instead. + if (cmd->latency_type != AS_LATENCY_TYPE_NONE) { + uint64_t elapsed = cf_getns() - cmd->begin; + as_node_add_latency(cmd->node, cmd->latency_type, elapsed); + } as_event_put_connection(cmd, pool); break;