corosync  3.0.1
totemstats.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017 Red Hat, Inc.
3  *
4  * Author: Christine Caulfield (ccaulfie@redhat.com)
5  *
6  * All rights reserved.
7  *
8  * This software licensed under BSD license, the text of which follows:
9  *
10  * Redistribution and use in source and binary forms, with or without
11  * modification, are permitted provided that the following conditions are met:
12  *
13  * - Redistributions of source code must retain the above copyright notice,
14  * this list of conditions and the following disclaimer.
15  * - Redistributions in binary form must reproduce the above copyright notice,
16  * this list of conditions and the following disclaimer in the documentation
17  * and/or other materials provided with the distribution.
18  * - Neither the name of the MontaVista Software, Inc. nor the names of its
19  * contributors may be used to endorse or promote products derived from this
20  * software without specific prior written permission.
21  *
22  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
26  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
32  * THE POSSIBILITY OF SUCH DAMAGE.
33  */
34 #ifndef TOTEMSTATS_H_DEFINED
35 #define TOTEMSTATS_H_DEFINED
36 
37 typedef struct {
38  int is_dirty;
39  time_t last_updated;
41 
42 typedef struct {
44  uint32_t iface_changes;
46 
47 typedef struct {
48  uint32_t rx;
49  uint32_t tx;
52 
53 typedef struct {
55  uint64_t orf_token_tx;
56  uint64_t orf_token_rx;
59  uint64_t memb_join_tx;
60  uint64_t memb_join_rx;
61  uint64_t mcast_tx;
62  uint64_t mcast_retx;
63  uint64_t mcast_rx;
70  uint64_t gather_entered;
72  uint64_t commit_entered;
74  uint64_t recovery_entered;
77  uint64_t rx_msg_dropped;
80  uint64_t time_since_token_last_received; // relative time
81 
83  uint32_t mtt_rx_token;
85  uint32_t avg_backlog_calc;
86 
89 #define TOTEM_TOKEN_STATS_MAX 100
91 
93 
94 typedef struct {
97  uint32_t msg_reserved;
98  uint32_t msg_queue_avail;
100 
101 
102 extern int totemknet_link_get_status (
103  knet_node_id_t node, uint8_t link,
104  struct knet_link_status *status);
105 
107  struct knet_handle_stats *stats);
108 
109 void stats_knet_add_member(knet_node_id_t nodeid, uint8_t link);
110 
111 void stats_knet_del_member(knet_node_id_t nodeid, uint8_t link);
112 
113 void stats_knet_add_handle(void);
114 
115 #define TOTEMPG_STATS_CLEAR_TOTEM 1
116 #define TOTEMPG_STATS_CLEAR_TRANSPORT 2
117 
118 extern void totempg_stats_clear (int flags);
119 
120 #endif /* TOTEMSTATS_H_DEFINED */
totemsrp_stats_t::rx_msg_dropped
uint64_t rx_msg_dropped
Definition: totemstats.h:77
totemsrp_stats_t::mtt_rx_token
uint32_t mtt_rx_token
Definition: totemstats.h:83
totemsrp_stats_t::continuous_sendmsg_failures
uint32_t continuous_sendmsg_failures
Definition: totemstats.h:79
totemsrp_stats_t::token_hold_cancel_tx
uint64_t token_hold_cancel_tx
Definition: totemstats.h:66
totemnet_stats_t::hdr
totem_stats_header_t hdr
Definition: totemstats.h:43
totempg_stats_t::srp
totemsrp_stats_t * srp
Definition: totemstats.h:96
totemsrp_stats_t::memb_commit_token_tx
uint64_t memb_commit_token_tx
Definition: totemstats.h:64
stats_knet_del_member
void stats_knet_del_member(knet_node_id_t nodeid, uint8_t link)
Definition: stats.c:624
totempg_stats_t::msg_queue_avail
uint32_t msg_queue_avail
Definition: totemstats.h:98
totemsrp_stats_t::commit_token_lost
uint64_t commit_token_lost
Definition: totemstats.h:73
TOTEM_TOKEN_STATS_MAX
#define TOTEM_TOKEN_STATS_MAX
Definition: totemstats.h:89
totemsrp_stats_t::latest_token
int latest_token
Definition: totemstats.h:88
totem_stats_header_t::last_updated
time_t last_updated
Definition: totemstats.h:39
totemsrp_stats_t::memb_join_rx
uint64_t memb_join_rx
Definition: totemstats.h:60
totemsrp_stats_t
Definition: totemstats.h:53
totemsrp_stats_t::earliest_token
int earliest_token
Definition: totemstats.h:87
totemnet_stats_t
Definition: totemstats.h:42
totemsrp_token_stats_t::rx
uint32_t rx
Definition: totemstats.h:48
totemsrp_token_stats_t::tx
uint32_t tx
Definition: totemstats.h:49
stats_knet_add_member
void stats_knet_add_member(knet_node_id_t nodeid, uint8_t link)
Definition: stats.c:614
totemnet_stats_t::iface_changes
uint32_t iface_changes
Definition: totemstats.h:44
totemsrp_stats_t::avg_token_workload
uint32_t avg_token_workload
Definition: totemstats.h:84
totemsrp_stats_t::mcast_tx
uint64_t mcast_tx
Definition: totemstats.h:61
totempg_stats_t
Definition: totemstats.h:94
totemsrp_stats_t::mcast_rx
uint64_t mcast_rx
Definition: totemstats.h:63
totemsrp_token_stats_t::backlog_calc
int backlog_calc
Definition: totemstats.h:50
totemsrp_token_stats_t
Definition: totemstats.h:47
totemsrp_stats_t::orf_token_rx
uint64_t orf_token_rx
Definition: totemstats.h:56
totemsrp_stats_t::memb_merge_detect_rx
uint64_t memb_merge_detect_rx
Definition: totemstats.h:58
totempg_stats_clear
void totempg_stats_clear(int flags)
Definition: totempg.c:1534
totemknet_link_get_status
int totemknet_link_get_status(knet_node_id_t node, uint8_t link, struct knet_link_status *status)
Definition: totemknet.c:1350
totemsrp_stats_t::gather_entered
uint64_t gather_entered
Definition: totemstats.h:70
totemsrp_stats_t::mcast_retx
uint64_t mcast_retx
Definition: totemstats.h:62
totem_stats_header_t::is_dirty
int is_dirty
Definition: totemstats.h:38
flags
uint32_t flags
Definition: exec/votequorum.c:4
totemsrp_stats_t::time_since_token_last_received
uint64_t time_since_token_last_received
Definition: totemstats.h:80
totemsrp_stats_t::token_hold_cancel_rx
uint64_t token_hold_cancel_rx
Definition: totemstats.h:67
totemsrp_stats_t::continuous_gather
uint32_t continuous_gather
Definition: totemstats.h:78
totempg_stats_t::hdr
totem_stats_header_t hdr
Definition: totemstats.h:95
totemsrp_stats_t::firewall_enabled_or_nic_failure
uint8_t firewall_enabled_or_nic_failure
Definition: totemstats.h:82
totemsrp_stats_t::gather_token_lost
uint64_t gather_token_lost
Definition: totemstats.h:71
totem_stats_header_t
Definition: totemstats.h:37
totemsrp_stats_t::memb_merge_detect_tx
uint64_t memb_merge_detect_tx
Definition: totemstats.h:57
totemsrp_stats_t::memb_commit_token_rx
uint64_t memb_commit_token_rx
Definition: totemstats.h:65
nodeid
unsigned int nodeid
Definition: coroapi.h:0
totemsrp_stats_t::hdr
totem_stats_header_t hdr
Definition: totemstats.h:54
totemsrp_stats_t::operational_entered
uint64_t operational_entered
Definition: totemstats.h:68
totemsrp_stats_t::memb_join_tx
uint64_t memb_join_tx
Definition: totemstats.h:59
totemsrp_stats_t::recovery_entered
uint64_t recovery_entered
Definition: totemstats.h:74
totemsrp_stats_t::consensus_timeouts
uint64_t consensus_timeouts
Definition: totemstats.h:76
totemsrp_stats_t::recovery_token_lost
uint64_t recovery_token_lost
Definition: totemstats.h:75
totemsrp_stats_t::commit_entered
uint64_t commit_entered
Definition: totemstats.h:72
totemknet_handle_get_stats
int totemknet_handle_get_stats(struct knet_handle_stats *stats)
Definition: totemknet.c:1387
totempg_stats_t::msg_reserved
uint32_t msg_reserved
Definition: totemstats.h:97
totemsrp_stats_t::avg_backlog_calc
uint32_t avg_backlog_calc
Definition: totemstats.h:85
stats_knet_add_handle
void stats_knet_add_handle(void)
Definition: stats.c:637
totemsrp_stats_t::orf_token_tx
uint64_t orf_token_tx
Definition: totemstats.h:55
totemsrp_stats_t::operational_token_lost
uint64_t operational_token_lost
Definition: totemstats.h:69