Ice 3.8
C++ API Reference
Loading...
Searching...
No Matches
Metrics.h
1// Copyright (c) ZeroC, Inc.
2
3// slice2cpp version 3.8.0
4// <auto-generated>Generated from Slice file 'Metrics.ice'.</auto-generated>
5// clang-format off
6
7#ifndef IceStorm_Metrics_h_
8#define IceStorm_Metrics_h_
9
11#include <Ice/Ice.h>
12#include <Ice/Metrics.h>
13#include <IceStorm/Config.h>
14
15#ifndef ICE_DISABLE_VERSION
16# if ICE_INT_VERSION / 100 != 308
17# error Ice version mismatch!
18# endif
19# if ICE_INT_VERSION % 100 >= 50
20# error Beta header file detected
21# endif
22# if ICE_INT_VERSION % 100 < 0
23# error Ice patch level mismatch!
24# endif
25#endif
26
27#ifndef ICESTORM_API
28# if defined(ICESTORM_API_EXPORTS)
29# define ICESTORM_API ICE_DECLSPEC_EXPORT
30# else
31# define ICESTORM_API ICE_DECLSPEC_IMPORT
32# endif
33#endif
34
35// NOLINTBEGIN(modernize-concat-nested-namespaces)
36
37namespace IceMX
38{
39 class TopicMetrics;
40
41 /// A shared pointer to a TopicMetrics.
42 using TopicMetricsPtr = std::shared_ptr<TopicMetrics>;
43
45
46 /// A shared pointer to a SubscriberMetrics.
47 using SubscriberMetricsPtr = std::shared_ptr<SubscriberMetrics>;
48}
49
50namespace IceMX
51{
52 /// Provides information about one or more IceStorm topics.
53 /// @remarks The Slice compiler generated this class from Slice class `::IceMX::TopicMetrics`.
54 /// @headerfile IceStorm/IceStorm.h
55 class ICESTORM_API TopicMetrics : public Metrics
56 {
57 public:
58 /// Default constructor.
59 TopicMetrics() noexcept = default;
60
61 /// One-shot constructor to initialize all data members.
62 /// @param id The metrics identifier.
63 /// @param total The total number of objects observed by this metrics.
64 /// @param current The number of objects currently observed by this metrics.
65 /// @param totalLifetime The sum of the lifetime of each observed objects.
66 /// @param failures The number of failures observed.
67 /// @param published The number of events published on the topic(s) by publishers.
68 /// @param forwarded The number of events forwarded on the topic(s) by IceStorm topic links.
69 TopicMetrics(std::string id, std::int64_t total, std::int32_t current, std::int64_t totalLifetime, std::int32_t failures, std::int64_t published, std::int64_t forwarded) noexcept :
70 Metrics(std::move(id), total, current, totalLifetime, failures),
73 {
74 }
75
76 /// Gets the type ID of the associated Slice class.
77 /// @return The string `"::IceMX::TopicMetrics"`.
78 static const char* ice_staticId() noexcept;
79
80 [[nodiscard]] const char* ice_id() const noexcept override;
81
82 /// Creates a tuple with all the fields of this class.
83 /// @return A tuple with all the fields of this class.
84 [[nodiscard]] std::tuple<const std::string&, const std::int64_t&, const std::int32_t&, const std::int64_t&, const std::int32_t&, const std::int64_t&, const std::int64_t&> ice_tuple() const
85 {
86 return std::tie(id, total, current, totalLifetime, failures, published, forwarded);
87 }
88
89 /// Creates a shallow polymorphic copy of this instance.
90 /// @return The cloned value.
91 [[nodiscard]] TopicMetricsPtr ice_clone() const { return std::static_pointer_cast<TopicMetrics>(_iceCloneImpl()); }
92
93 void ice_printFields(std::ostream& os) const override;
94
95 /// The number of events published on the topic(s) by publishers.
96 std::int64_t published{INT64_C(0)};
97
98 /// The number of events forwarded on the topic(s) by IceStorm topic links.
99 std::int64_t forwarded{INT64_C(0)};
100
101 protected:
102 /// Copy constructor.
103 TopicMetrics(const TopicMetrics&) = default;
104
105 /// @private
106 [[nodiscard]] Ice::ValuePtr _iceCloneImpl() const override;
107
108 /// @private
109 void _iceWriteImpl(Ice::OutputStream*) const override;
110
111 /// @private
112 void _iceReadImpl(Ice::InputStream*) override;
113 };
114
115 /// Provides information about IceStorm subscribers.
116 /// @remarks The Slice compiler generated this class from Slice class `::IceMX::SubscriberMetrics`.
117 /// @headerfile IceStorm/IceStorm.h
118 class ICESTORM_API SubscriberMetrics : public Metrics
119 {
120 public:
121 /// Default constructor.
122 SubscriberMetrics() noexcept = default;
123
124 /// One-shot constructor to initialize all data members.
125 /// @param id The metrics identifier.
126 /// @param total The total number of objects observed by this metrics.
127 /// @param current The number of objects currently observed by this metrics.
128 /// @param totalLifetime The sum of the lifetime of each observed objects.
129 /// @param failures The number of failures observed.
130 /// @param queued The number of queued events.
131 /// @param outstanding The number of outstanding events.
132 /// @param delivered The number of forwarded events.
133 SubscriberMetrics(std::string id, std::int64_t total, std::int32_t current, std::int64_t totalLifetime, std::int32_t failures, std::int32_t queued, std::int32_t outstanding, std::int64_t delivered) noexcept :
134 Metrics(std::move(id), total, current, totalLifetime, failures),
135 queued(queued),
138 {
139 }
140
141 /// Gets the type ID of the associated Slice class.
142 /// @return The string `"::IceMX::SubscriberMetrics"`.
143 static const char* ice_staticId() noexcept;
144
145 [[nodiscard]] const char* ice_id() const noexcept override;
146
147 /// Creates a tuple with all the fields of this class.
148 /// @return A tuple with all the fields of this class.
149 [[nodiscard]] std::tuple<const std::string&, const std::int64_t&, const std::int32_t&, const std::int64_t&, const std::int32_t&, const std::int32_t&, const std::int32_t&, const std::int64_t&> ice_tuple() const
150 {
152 }
153
154 /// Creates a shallow polymorphic copy of this instance.
155 /// @return The cloned value.
156 [[nodiscard]] SubscriberMetricsPtr ice_clone() const { return std::static_pointer_cast<SubscriberMetrics>(_iceCloneImpl()); }
157
158 void ice_printFields(std::ostream& os) const override;
159
160 /// The number of queued events.
161 std::int32_t queued{0};
162
163 /// The number of outstanding events.
164 std::int32_t outstanding{0};
165
166 /// The number of forwarded events.
167 std::int64_t delivered{INT64_C(0)};
168
169 protected:
170 /// Copy constructor.
172
173 /// @private
174 [[nodiscard]] Ice::ValuePtr _iceCloneImpl() const override;
175
176 /// @private
177 void _iceWriteImpl(Ice::OutputStream*) const override;
178
179 /// @private
180 void _iceReadImpl(Ice::InputStream*) override;
181 };
182}
183
184// NOLINTEND(modernize-concat-nested-namespaces)
185
187#endif
Metrics() noexcept=default
Default constructor.
std::int32_t current
The number of objects currently observed by this metrics.
Definition Metrics.h:389
std::int64_t totalLifetime
The sum of the lifetime of each observed objects.
Definition Metrics.h:393
std::int32_t failures
The number of failures observed.
Definition Metrics.h:396
std::int64_t total
The total number of objects observed by this metrics.
Definition Metrics.h:386
void ice_printFields(std::ostream &os) const override
Outputs the name and value of each field of this instance, including inherited fields,...
std::int32_t outstanding
The number of outstanding events.
Definition Metrics.h:164
static const char * ice_staticId() noexcept
Gets the type ID of the associated Slice class.
std::int64_t delivered
The number of forwarded events.
Definition Metrics.h:167
SubscriberMetrics() noexcept=default
Default constructor.
SubscriberMetricsPtr ice_clone() const
Creates a shallow polymorphic copy of this instance.
Definition Metrics.h:156
SubscriberMetrics(const SubscriberMetrics &)=default
Copy constructor.
std::int32_t queued
The number of queued events.
Definition Metrics.h:161
std::tuple< const std::string &, const std::int64_t &, const std::int32_t &, const std::int64_t &, const std::int32_t &, const std::int32_t &, const std::int32_t &, const std::int64_t & > ice_tuple() const
Creates a tuple with all the fields of this class.
Definition Metrics.h:149
const char * ice_id() const noexcept override
Gets the Slice type ID of the most-derived class supported by this object.
Provides information about IceStorm subscribers.
Definition Metrics.h:119
static const char * ice_staticId() noexcept
Gets the type ID of the associated Slice class.
TopicMetricsPtr ice_clone() const
Creates a shallow polymorphic copy of this instance.
Definition Metrics.h:91
TopicMetrics() noexcept=default
Default constructor.
std::tuple< const std::string &, const std::int64_t &, const std::int32_t &, const std::int64_t &, const std::int32_t &, const std::int64_t &, const std::int64_t & > ice_tuple() const
Creates a tuple with all the fields of this class.
Definition Metrics.h:84
std::int64_t forwarded
The number of events forwarded on the topic(s) by IceStorm topic links.
Definition Metrics.h:99
TopicMetrics(const TopicMetrics &)=default
Copy constructor.
const char * ice_id() const noexcept override
Gets the Slice type ID of the most-derived class supported by this object.
void ice_printFields(std::ostream &os) const override
Outputs the name and value of each field of this instance, including inherited fields,...
std::int64_t published
The number of events published on the topic(s) by publishers.
Definition Metrics.h:96
Provides information about one or more IceStorm topics.
Definition Metrics.h:56
Represents a byte buffer used for unmarshaling data encoded using the Slice encoding.
Definition InputStream.h:50
Represents a byte buffer used for marshaling data using the Slice encoding.
std::shared_ptr< TopicMetrics > TopicMetricsPtr
A shared pointer to a TopicMetrics.
Definition Metrics.h:42
std::shared_ptr< SubscriberMetrics > SubscriberMetricsPtr
A shared pointer to a SubscriberMetrics.
Definition Metrics.h:47
The Ice Management eXtension facility.
Definition Metrics.h:38
std::shared_ptr< Value > ValuePtr
A shared pointer to a Value.
Definition ValueF.h:13