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