Loading...
Searching...
No Matches
as_latency.h
Go to the documentation of this file.
1/*
2 * Copyright 2008-2024 Aerospike, Inc.
3 *
4 * Portions may be licensed to Aerospike, Inc. under one or more contributor
5 * license agreements.
6 *
7 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
8 * use this file except in compliance with the License. You may obtain a copy of
9 * the License at http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14 * License for the specific language governing permissions and limitations under
15 * the License.
16 */
17#pragma once
18
19#include <aerospike/as_atomic.h>
20
21#ifdef __cplusplus
22extern "C" {
23#endif
24
25//---------------------------------
26// Types
27//---------------------------------
28
29typedef uint8_t as_latency_type;
30
31#define AS_LATENCY_TYPE_CONN 0
32#define AS_LATENCY_TYPE_WRITE 1
33#define AS_LATENCY_TYPE_READ 2
34#define AS_LATENCY_TYPE_BATCH 3
35#define AS_LATENCY_TYPE_QUERY 4
36#define AS_LATENCY_TYPE_NONE 5
37
38/**
39 * Latency buckets for a transaction group.
40 * Latency bucket counts are cumulative and not reset on each metrics snapshot interval
41 */
42typedef struct as_latency_buckets_s {
43 uint64_t* buckets;
44 uint32_t latency_shift;
47
48//---------------------------------
49// Functions
50//---------------------------------
51
52static inline uint64_t
54{
55 return as_load_uint64(&buckets->buckets[i]);
56}
57
58/**
59 * Convert latency_type to string version for printing to the output file
60 */
61AS_EXTERN char*
63
64#ifdef __cplusplus
65} // end extern "C"
66#endif
#define as_load_uint64(_target)
AS_EXTERN char * as_latency_type_to_string(as_latency_type type)
uint8_t as_latency_type
Definition as_latency.h:29
static uint64_t as_latency_get_bucket(as_latency_buckets *buckets, uint32_t i)
Definition as_latency.h:53
uint8_t type
Definition as_proto.h:1
#define AS_EXTERN
Definition as_std.h:25
uint64_t * buckets
Definition as_latency.h:43
uint32_t latency_shift
Definition as_latency.h:44
uint32_t latency_columns
Definition as_latency.h:45