Ice 3.8
C++ API Reference
Loading...
Searching...
No Matches
Metrics.h
1// Copyright (c) ZeroC, Inc.
2
3// slice2cpp version 3.8.0-alpha.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 != 30850
17# error Ice version mismatch: an exact match is required for beta generated code
18# endif
19#endif
20
21#ifndef ICESTORM_API
22# if defined(ICESTORM_API_EXPORTS)
23# define ICESTORM_API ICE_DECLSPEC_EXPORT
24# else
25# define ICESTORM_API ICE_DECLSPEC_IMPORT
26# endif
27#endif
28
29// NOLINTBEGIN(modernize-concat-nested-namespaces)
30
31namespace IceMX
32{
33 class TopicMetrics;
34
35 /// A shared pointer to a TopicMetrics.
36 using TopicMetricsPtr = std::shared_ptr<TopicMetrics>;
37
39
40 /// A shared pointer to a SubscriberMetrics.
41 using SubscriberMetricsPtr = std::shared_ptr<SubscriberMetrics>;
42}
43
44namespace IceMX
45{
46 /// Provides information about one or more IceStorm topics.
47 /// @remarks The Slice compiler generated this class from Slice class `::IceMX::TopicMetrics`.
48 /// @headerfile IceStorm/IceStorm.h
49 class ICESTORM_API TopicMetrics : public Metrics
50 {
51 public:
52 /// Default constructor.
53 TopicMetrics() noexcept = default;
54
55 /// One-shot constructor to initialize all data members.
56 /// @param id The metrics identifier.
57 /// @param total The total number of objects observed by this metrics.
58 /// @param current The number of objects currently observed by this metrics.
59 /// @param totalLifetime The sum of the lifetime of each observed objects.
60 /// @param failures The number of failures observed.
61 /// @param published The number of events published on the topic(s) by publishers.
62 /// @param forwarded The number of events forwarded on the topic(s) by IceStorm topic links.
63 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 :
64 Metrics(std::move(id), total, current, totalLifetime, failures),
67 {
68 }
69
70 /// Gets the type ID of the associated Slice class.
71 /// @return The string `"::IceMX::TopicMetrics"`.
72 static const char* ice_staticId() noexcept;
73
74 [[nodiscard]] const char* ice_id() const noexcept override;
75
76 /// Creates a tuple with all the fields of this class.
77 /// @return A tuple with all the fields of this class.
78 [[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
79 {
80 return std::tie(id, total, current, totalLifetime, failures, published, forwarded);
81 }
82
83 /// Creates a shallow polymorphic copy of this instance.
84 /// @return The cloned value.
85 [[nodiscard]] TopicMetricsPtr ice_clone() const { return std::static_pointer_cast<TopicMetrics>(_iceCloneImpl()); }
86
87 void ice_printFields(std::ostream& os) const override;
88
89 /// The number of events published on the topic(s) by publishers.
90 std::int64_t published{INT64_C(0)};
91
92 /// The number of events forwarded on the topic(s) by IceStorm topic links.
93 std::int64_t forwarded{INT64_C(0)};
94
95 protected:
96 /// Copy constructor.
97 TopicMetrics(const TopicMetrics&) = default;
98
99 /// @private
100 [[nodiscard]] Ice::ValuePtr _iceCloneImpl() const override;
101
102 /// @private
103 void _iceWriteImpl(Ice::OutputStream*) const override;
104
105 /// @private
106 void _iceReadImpl(Ice::InputStream*) override;
107 };
108
109 /// Provides information about IceStorm subscribers.
110 /// @remarks The Slice compiler generated this class from Slice class `::IceMX::SubscriberMetrics`.
111 /// @headerfile IceStorm/IceStorm.h
112 class ICESTORM_API SubscriberMetrics : public Metrics
113 {
114 public:
115 /// Default constructor.
116 SubscriberMetrics() noexcept = default;
117
118 /// One-shot constructor to initialize all data members.
119 /// @param id The metrics identifier.
120 /// @param total The total number of objects observed by this metrics.
121 /// @param current The number of objects currently observed by this metrics.
122 /// @param totalLifetime The sum of the lifetime of each observed objects.
123 /// @param failures The number of failures observed.
124 /// @param queued The number of queued events.
125 /// @param outstanding The number of outstanding events.
126 /// @param delivered The number of forwarded events.
127 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 :
128 Metrics(std::move(id), total, current, totalLifetime, failures),
129 queued(queued),
132 {
133 }
134
135 /// Gets the type ID of the associated Slice class.
136 /// @return The string `"::IceMX::SubscriberMetrics"`.
137 static const char* ice_staticId() noexcept;
138
139 [[nodiscard]] const char* ice_id() const noexcept override;
140
141 /// Creates a tuple with all the fields of this class.
142 /// @return A tuple with all the fields of this class.
143 [[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
144 {
146 }
147
148 /// Creates a shallow polymorphic copy of this instance.
149 /// @return The cloned value.
150 [[nodiscard]] SubscriberMetricsPtr ice_clone() const { return std::static_pointer_cast<SubscriberMetrics>(_iceCloneImpl()); }
151
152 void ice_printFields(std::ostream& os) const override;
153
154 /// The number of queued events.
155 std::int32_t queued{0};
156
157 /// The number of outstanding events.
158 std::int32_t outstanding{0};
159
160 /// The number of forwarded events.
161 std::int64_t delivered{INT64_C(0)};
162
163 protected:
164 /// Copy constructor.
166
167 /// @private
168 [[nodiscard]] Ice::ValuePtr _iceCloneImpl() const override;
169
170 /// @private
171 void _iceWriteImpl(Ice::OutputStream*) const override;
172
173 /// @private
174 void _iceReadImpl(Ice::InputStream*) override;
175 };
176}
177
178// NOLINTEND(modernize-concat-nested-namespaces)
179
181#endif
Metrics() noexcept=default
Default constructor.
std::int32_t current
The number of objects currently observed by this metrics.
Definition Metrics.h:383
std::int64_t totalLifetime
The sum of the lifetime of each observed objects.
Definition Metrics.h:387
std::int32_t failures
The number of failures observed.
Definition Metrics.h:390
std::int64_t total
The total number of objects observed by this metrics.
Definition Metrics.h:380
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:158
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:161
SubscriberMetrics() noexcept=default
Default constructor.
SubscriberMetricsPtr ice_clone() const
Creates a shallow polymorphic copy of this instance.
Definition Metrics.h:150
SubscriberMetrics(const SubscriberMetrics &)=default
Copy constructor.
std::int32_t queued
The number of queued events.
Definition Metrics.h:155
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:143
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:113
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:85
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:78
std::int64_t forwarded
The number of events forwarded on the topic(s) by IceStorm topic links.
Definition Metrics.h:93
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:90
Provides information about one or more IceStorm topics.
Definition Metrics.h:50
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:36
std::shared_ptr< SubscriberMetrics > SubscriberMetricsPtr
A shared pointer to a SubscriberMetrics.
Definition Metrics.h:41
The Ice Management eXtension facility.
Definition Metrics.h:32
std::shared_ptr< Value > ValuePtr
A shared pointer to a Value.
Definition ValueF.h:13