MySQL 8.0.40
Source Code Documentation
gcs_xcom_statistics_interface.h
Go to the documentation of this file.
1/* Copyright (c) 2015, 2024, Oracle and/or its affiliates.
2
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License, version 2.0,
5 as published by the Free Software Foundation.
6
7 This program is designed to work with certain software (including
8 but not limited to OpenSSL) that is licensed under separate terms,
9 as designated in a particular file or component or in included license
10 documentation. The authors of MySQL hereby grant you an additional
11 permission to link the program and your derivative works with the
12 separately licensed software that they have either included with
13 the program or referenced in the documentation.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License, version 2.0, for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
23
24#ifndef GCS_XCOM_STATISTICS_INTERFACE_INCLUDED
25#define GCS_XCOM_STATISTICS_INTERFACE_INCLUDED
26
27#include <time.h>
28#include <algorithm>
29
31
32/**
33 @class Gcs_xcom_statistics_updater
34
35 This interface contains the public methods that the implementation
36 of the Gcs_statistics_interface will provide to the other interfaces that
37 update statistics.
38*/
40 public:
41 /**
42 Method called to register that a message has been sent.
43
44 This will update:
45 - Total Messages Sent;
46 - Total Bytes Sent.
47
48 @param[in] message_length the length of the message being sent
49 */
50
51 virtual void update_message_sent(unsigned long long message_length) = 0;
52
53 /**
54 Method called to register when a message is received.
55
56 This will update:
57 - Total Messages Received;
58 - Total Bytes Received;
59 - Min Message Length;
60 - Max Message Length;
61 - Last Message Timestamp.
62
63 @param[in] message_length the length of the message received
64 */
65
66 virtual void update_message_received(long message_length) = 0;
67
68 virtual ~Gcs_xcom_statistics_updater() = default;
69};
70
71/**
72 @class Gcs_xcom_statistics_interface
73
74 This class implements the Gcs_statistics_interface and updater.
75*/
78 public:
79 explicit Gcs_xcom_statistics();
81
82 // Implementation of Gcs_statistics_interface
83 long get_total_messages_sent() override;
84
85 long get_total_bytes_sent() override;
86
87 long get_total_messages_received() override;
88
89 long get_total_bytes_received() override;
90
91 long get_min_message_length() override;
92
93 long get_max_message_length() override;
94
95 long get_last_message_timestamp() override;
96
97 // Implementation of Gcs_xcom_statistics_updater
98 void update_message_sent(unsigned long long message_length) override;
99
100 void update_message_received(long message_length) override;
101
102 private:
110};
111
112#endif /* GCS_XCOM_STATISTICS_INTERFACE_INCLUDED */
This interface represents all statistics that a binding implementation should provide.
Definition: gcs_statistics_interface.h:33
This interface contains the public methods that the implementation of the Gcs_statistics_interface wi...
Definition: gcs_xcom_statistics_interface.h:39
virtual void update_message_received(long message_length)=0
Method called to register when a message is received.
virtual void update_message_sent(unsigned long long message_length)=0
Method called to register that a message has been sent.
virtual ~Gcs_xcom_statistics_updater()=default
Definition: gcs_xcom_statistics_interface.h:77
~Gcs_xcom_statistics() override
long get_total_bytes_received() override
Definition: gcs_xcom_statistics_interface.cc:51
void update_message_sent(unsigned long long message_length) override
Method called to register that a message has been sent.
Definition: gcs_xcom_statistics_interface.cc:68
long min_message_length
Definition: gcs_xcom_statistics_interface.h:107
long get_total_bytes_sent() override
Definition: gcs_xcom_statistics_interface.cc:45
long get_min_message_length() override
Definition: gcs_xcom_statistics_interface.cc:55
long get_max_message_length() override
Definition: gcs_xcom_statistics_interface.cc:59
long total_messages_sent
Definition: gcs_xcom_statistics_interface.h:103
long total_messages_received
Definition: gcs_xcom_statistics_interface.h:105
long get_total_messages_received() override
Definition: gcs_xcom_statistics_interface.cc:47
long last_message_timestamp
Definition: gcs_xcom_statistics_interface.h:109
Gcs_xcom_statistics()
Definition: gcs_xcom_statistics_interface.cc:30
long total_bytes_sent
Definition: gcs_xcom_statistics_interface.h:104
long get_total_messages_sent() override
Definition: gcs_xcom_statistics_interface.cc:41
long total_bytes_received
Definition: gcs_xcom_statistics_interface.h:106
long max_message_length
Definition: gcs_xcom_statistics_interface.h:108
long get_last_message_timestamp() override
Definition: gcs_xcom_statistics_interface.cc:63
void update_message_received(long message_length) override
Method called to register when a message is received.
Definition: gcs_xcom_statistics_interface.cc:74
Include file for Sun RPC to compile out of the box.