1 | /* |
2 | * skew_monitor.h |
3 | * |
4 | * Copyright (C) 2008-2016 Aerospike, Inc. |
5 | * |
6 | * Portions may be licensed to Aerospike, Inc. under one or more contributor |
7 | * license agreements. |
8 | * |
9 | * This program is free software: you can redistribute it and/or modify it under |
10 | * the terms of the GNU Affero General Public License as published by the Free |
11 | * Software Foundation, either version 3 of the License, or (at your option) any |
12 | * later version. |
13 | * |
14 | * This program is distributed in the hope that it will be useful, but WITHOUT |
15 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
16 | * FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more |
17 | * details. |
18 | * |
19 | * You should have received a copy of the GNU Affero General Public License |
20 | * along with this program. If not, see http://www.gnu.org/licenses/ |
21 | */ |
22 | |
23 | #pragma once |
24 | |
25 | #include <stdbool.h> |
26 | #include <stdint.h> |
27 | |
28 | #include "citrusleaf/cf_vector.h" |
29 | |
30 | #include "dynbuf.h" |
31 | |
32 | /** |
33 | * Initialize skew monitor. |
34 | */ |
35 | void |
36 | as_skew_monitor_init(); |
37 | |
38 | /** |
39 | * Return the current estimate of the clock skew in the cluster. |
40 | */ |
41 | uint64_t |
42 | as_skew_monitor_skew(); |
43 | |
44 | /** |
45 | * Return the currently estimated outliers from our cluster. |
46 | * Outliers should have space to hold at least AS_CLUSTER_SZ nodes. |
47 | */ |
48 | uint32_t |
49 | as_skew_monitor_outliers(cf_vector* outliers); |
50 | |
51 | /** |
52 | * Print skew outliers to a dynamic buffer. |
53 | */ |
54 | uint32_t |
55 | as_skew_monitor_outliers_append(cf_dyn_buf* db); |
56 | |
57 | /** |
58 | * Print skew monitor info to a dynamic buffer. |
59 | */ |
60 | void |
61 | as_skew_monitor_info(cf_dyn_buf* db); |
62 | |
63 | /** |
64 | * Dump some debugging information to the logs. |
65 | */ |
66 | void |
67 | as_skew_monitor_dump(); |
68 | |