Loading...
Searching...
No Matches
aerospike
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
22
extern
"C"
{
23
#endif
24
25
//---------------------------------
26
// Types
27
//---------------------------------
28
29
typedef
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
*/
42
typedef
struct
as_latency_buckets_s {
43
uint64_t*
buckets
;
44
uint32_t
latency_shift
;
45
uint32_t
latency_columns
;
46
}
as_latency_buckets
;
47
48
//---------------------------------
49
// Functions
50
//---------------------------------
51
52
static
inline
uint64_t
53
as_latency_get_bucket
(
as_latency_buckets
* buckets, uint32_t i)
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
*/
61
AS_EXTERN
char
*
62
as_latency_type_to_string
(
as_latency_type
type
);
63
64
#ifdef __cplusplus
65
}
// end extern "C"
66
#endif
as_atomic.h
as_load_uint64
#define as_load_uint64(_target)
Definition
as_atomic_win.h:50
as_latency_type_to_string
AS_EXTERN char * as_latency_type_to_string(as_latency_type type)
as_latency_type
uint8_t as_latency_type
Definition
as_latency.h:29
as_latency_get_bucket
static uint64_t as_latency_get_bucket(as_latency_buckets *buckets, uint32_t i)
Definition
as_latency.h:53
type
uint8_t type
Definition
as_proto.h:1
AS_EXTERN
#define AS_EXTERN
Definition
as_std.h:25
as_latency_buckets
Definition
as_latency.h:42
as_latency_buckets::buckets
uint64_t * buckets
Definition
as_latency.h:43
as_latency_buckets::latency_shift
uint32_t latency_shift
Definition
as_latency.h:44
as_latency_buckets::latency_columns
uint32_t latency_columns
Definition
as_latency.h:45