Skip to content

Commit

Permalink
Calculate latency on AEROSPIKE_ERR_RECORD_NOT_FOUND too.
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianNichols committed Feb 26, 2024
1 parent f68b483 commit 082a088
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/aerospike/as_command.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
5 changes: 5 additions & 0 deletions src/main/aerospike/as_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 082a088

Please sign in to comment.