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 /// @headerfile IceStorm/IceStorm.h
48 class ICESTORM_API TopicMetrics : public Metrics
49 {
50 public:
51 /// Default constructor.
52 TopicMetrics() noexcept = default;
53
54 /// One-shot constructor to initialize all data members.
55 /// @param id The metrics identifier.
56 /// @param total The total number of objects observed by this metrics.
57 /// @param current The number of objects currently observed by this metrics.
58 /// @param totalLifetime The sum of the lifetime of each observed objects.
59 /// @param failures The number of failures observed.
60 /// @param published The number of events published on the topic(s) by publishers.
61 /// @param forwarded The number of events forwarded on the topic(s) by IceStorm topic links.
62 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 :
63 Metrics(std::move(id), total, current, totalLifetime, failures),
66 {
67 }
68
69 /// Gets the type ID of the associated Slice class.
70 /// @return The string `"::IceMX::TopicMetrics"`.
71 static const char* ice_staticId() noexcept;
72
73 [[nodiscard]] const char* ice_id() const noexcept override;
74
75 /// Creates a tuple with all the fields of this class.
76 /// @return A tuple with all the fields of this class.
77 [[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
78 {
79 return std::tie(id, total, current, totalLifetime, failures, published, forwarded);
80 }
81
82 /// Creates a shallow polymorphic copy of this instance.
83 /// @return The cloned value.
84 [[nodiscard]] TopicMetricsPtr ice_clone() const { return std::static_pointer_cast<TopicMetrics>(_iceCloneImpl()); }
85
86 void ice_printFields(std::ostream& os) const override;
87
88 /// The number of events published on the topic(s) by publishers.
89 std::int64_t published{INT64_C(0)};
90
91 /// The number of events forwarded on the topic(s) by IceStorm topic links.
92 std::int64_t forwarded{INT64_C(0)};
93
94 protected:
95 /// Copy constructor.
96 TopicMetrics(const TopicMetrics&) = default;
97
98 /// @private
99 [[nodiscard]] Ice::ValuePtr _iceCloneImpl() const override;
100
101 /// @private
102 void _iceWriteImpl(Ice::OutputStream*) const override;
103
104 /// @private
105 void _iceReadImpl(Ice::InputStream*) override;
106 };
107
108 /// Provides information about IceStorm subscribers.
109 /// @headerfile IceStorm/IceStorm.h
110 class ICESTORM_API SubscriberMetrics : public Metrics
111 {
112 public:
113 /// Default constructor.
114 SubscriberMetrics() noexcept = default;
115
116 /// One-shot constructor to initialize all data members.
117 /// @param id The metrics identifier.
118 /// @param total The total number of objects observed by this metrics.
119 /// @param current The number of objects currently observed by this metrics.
120 /// @param totalLifetime The sum of the lifetime of each observed objects.
121 /// @param failures The number of failures observed.
122 /// @param queued The number of queued events.
123 /// @param outstanding The number of outstanding events.
124 /// @param delivered The number of forwarded events.
125 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 :
126 Metrics(std::move(id), total, current, totalLifetime, failures),
127 queued(queued),
130 {
131 }
132
133 /// Gets the type ID of the associated Slice class.
134 /// @return The string `"::IceMX::SubscriberMetrics"`.
135 static const char* ice_staticId() noexcept;
136
137 [[nodiscard]] const char* ice_id() const noexcept override;
138
139 /// Creates a tuple with all the fields of this class.
140 /// @return A tuple with all the fields of this class.
141 [[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
142 {
144 }
145
146 /// Creates a shallow polymorphic copy of this instance.
147 /// @return The cloned value.
148 [[nodiscard]] SubscriberMetricsPtr ice_clone() const { return std::static_pointer_cast<SubscriberMetrics>(_iceCloneImpl()); }
149
150 void ice_printFields(std::ostream& os) const override;
151
152 /// The number of queued events.
153 std::int32_t queued{0};
154
155 /// The number of outstanding events.
156 std::int32_t outstanding{0};
157
158 /// The number of forwarded events.
159 std::int64_t delivered{INT64_C(0)};
160
161 protected:
162 /// Copy constructor.
164
165 /// @private
166 [[nodiscard]] Ice::ValuePtr _iceCloneImpl() const override;
167
168 /// @private
169 void _iceWriteImpl(Ice::OutputStream*) const override;
170
171 /// @private
172 void _iceReadImpl(Ice::InputStream*) override;
173 };
174}
175
176// NOLINTEND(modernize-concat-nested-namespaces)
177
179#endif
Metrics() noexcept=default
Default constructor.
std::int32_t current
The number of objects currently observed by this metrics.
Definition Metrics.h:381
std::int64_t totalLifetime
The sum of the lifetime of each observed objects.
Definition Metrics.h:385
std::int32_t failures
The number of failures observed.
Definition Metrics.h:388
std::int64_t total
The total number of objects observed by this metrics.
Definition Metrics.h:378
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:156
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:159
SubscriberMetrics() noexcept=default
Default constructor.
SubscriberMetricsPtr ice_clone() const
Creates a shallow polymorphic copy of this instance.
Definition Metrics.h:148
SubscriberMetrics(const SubscriberMetrics &)=default
Copy constructor.
std::int32_t queued
The number of queued events.
Definition Metrics.h:153
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:141
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:111
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:84
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:77
std::int64_t forwarded
The number of events forwarded on the topic(s) by IceStorm topic links.
Definition Metrics.h:92
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:89
Provides information about one or more IceStorm topics.
Definition Metrics.h:49
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