Ice 3.9
C++ API Reference
Loading...
Searching...
No Matches
Metrics.h
1// Copyright (c) ZeroC, Inc.
2
3// slice2cpp version 3.9.0-alpha.0
4// <auto-generated>Generated from Slice file 'Metrics.ice'.</auto-generated>
5// clang-format off
6
7#ifndef Ice_Metrics_h_
8#define Ice_Metrics_h_
9
11#include <Ice/Ice.h>
12#include "BuiltinSequences.h"
13
14#ifndef ICE_DISABLE_VERSION
15# if ICE_INT_VERSION != 30950
16# error Ice version mismatch: an exact match is required for beta generated code
17# endif
18#endif
19
20// NOLINTBEGIN(modernize-concat-nested-namespaces)
21
22/// The Ice Management eXtension facility.
23namespace IceMX
24{
25 /// A dictionary of strings to integers.
26 using StringIntDict = std::map<std::string, std::int32_t>;
27
28 class Metrics;
29
30 /// A shared pointer to a Metrics.
31 using MetricsPtr = std::shared_ptr<Metrics>;
32
33 struct MetricsFailures;
34
35 /// A sequence of MetricsFailures.
36 using MetricsFailuresSeq = std::vector<MetricsFailures>;
37
38 /// A sequence of metrics.
39 /// @remarks We use a sequence here instead of a map because the ID of the metrics is already included in the Metrics
40 /// class and using sequences of metrics objects is more efficient than using dictionaries since lookups are not
41 /// necessary.
42 using MetricsMap = std::vector<MetricsPtr>;
43
44 /// A metrics view is a dictionary of metrics maps. The key of the dictionary is the name of the metrics map.
45 using MetricsView = std::map<std::string, MetricsMap>;
46
47 class MetricsAdminPrx;
48
49 class ThreadMetrics;
50
51 /// A shared pointer to a ThreadMetrics.
52 using ThreadMetricsPtr = std::shared_ptr<ThreadMetrics>;
53
54 class DispatchMetrics;
55
56 /// A shared pointer to a DispatchMetrics.
57 using DispatchMetricsPtr = std::shared_ptr<DispatchMetrics>;
58
60
61 /// A shared pointer to a ChildInvocationMetrics.
62 using ChildInvocationMetricsPtr = std::shared_ptr<ChildInvocationMetrics>;
63
65
66 /// A shared pointer to a CollocatedMetrics.
67 using CollocatedMetricsPtr = std::shared_ptr<CollocatedMetrics>;
68
69 class RemoteMetrics;
70
71 /// A shared pointer to a RemoteMetrics.
72 using RemoteMetricsPtr = std::shared_ptr<RemoteMetrics>;
73
75
76 /// A shared pointer to an InvocationMetrics.
77 using InvocationMetricsPtr = std::shared_ptr<InvocationMetrics>;
78
80
81 /// A shared pointer to a ConnectionMetrics.
82 using ConnectionMetricsPtr = std::shared_ptr<ConnectionMetrics>;
83}
84
85namespace IceMX
86{
87 /// The metrics administrative facet interface. This interface allows remote administrative clients to access the
88 /// metrics of an application that enabled the Ice administrative facility and configured one or more metrics views.
89 /// @remarks The Slice compiler generated this proxy class from Slice interface `::IceMX::MetricsAdmin`.
90 /// @headerfile Ice/Ice.h
91 class ICE_API MetricsAdminPrx : public Ice::Proxy<MetricsAdminPrx, Ice::ObjectPrx>
92 {
93 public:
94 /// Constructs a proxy from a Communicator and a proxy string.
95 /// @param communicator The communicator of the new proxy.
96 /// @param proxyString The proxy string to parse.
97 MetricsAdminPrx(const Ice::CommunicatorPtr& communicator, std::string_view proxyString) : Ice::ObjectPrx{communicator, proxyString} {} // NOLINT(modernize-use-equals-default)
98
99 /// Copy constructor. Constructs with a copy of the contents of @p other.
100 /// @param other The proxy to copy from.
101 MetricsAdminPrx(const MetricsAdminPrx& other) noexcept : Ice::ObjectPrx{other} {} // NOLINT(modernize-use-equals-default)
102
103 /// Move constructor. Constructs a proxy with the contents of @p other using move semantics.
104 /// @param other The proxy to move from.
105 MetricsAdminPrx(MetricsAdminPrx&& other) noexcept : Ice::ObjectPrx{std::move(other)} {} // NOLINT(modernize-use-equals-default)
106
107 ~MetricsAdminPrx() override;
108
109 /// Copy assignment operator. Replaces the contents of this proxy with a copy of the contents of @p rhs.
110 /// @param rhs The proxy to copy from.
111 /// @return A reference to this proxy.
113 {
114 if (this != &rhs)
115 {
117 }
118 return *this;
119 }
120
121 /// Move assignment operator. Replaces the contents of this proxy with the contents of @p rhs using move semantics.
122 /// @param rhs The proxy to move from.
124 {
125 if (this != &rhs)
126 {
127 Ice::ObjectPrx::operator=(std::move(rhs));
128 }
129 return *this;
130 }
131
132 /// Gets the names of the enabled and disabled metrics views.
133 /// @param[out] disabledViews The names of the disabled views.
134 /// @param context The request context.
135 /// @return The names of the enabled views.
137
138 /// Gets the names of the enabled and disabled metrics views.
139 /// @param context The request context.
140 /// @return A future that becomes available when the invocation completes. This future holds:
141 /// - `returnValue` The names of the enabled views.
142 /// - `disabledViews` The names of the disabled views.
143 [[nodiscard]] std::future<std::tuple<::Ice::StringSeq, ::Ice::StringSeq>> getMetricsViewNamesAsync(const Ice::Context& context = Ice::noExplicitContext) const;
144
145 /// Gets the names of the enabled and disabled metrics views.
146 /// @param response The response callback. The Ice runtime calls this function from an Ice thread pool
147 /// thread. If you set Ice::InitializationData::executor, the executor determines the thread that executes this
148 /// function. It accepts:
149 /// - `returnValue` The names of the enabled views.
150 /// - `disabledViews` The names of the disabled views.
151 /// @param exception The exception callback. The Ice runtime calls this function from an Ice thread pool
152 /// thread. If you set Ice::InitializationData::executor, the executor determines the thread that executes this
153 /// function.
154 /// @param sent The sent callback. The Ice runtime calls this function when the request is accepted by the
155 /// transport. When the request is accepted synchronously, the Ice runtime calls this function from the current
156 /// thread and passes `true` as argument. When the request is accepted asynchronously, the Ice runtime calls
157 /// this function from an Ice thread pool thread and passes `false` as argument. If you set
158 /// Ice::InitializationData::executor, the executor determines the thread that executes this function in the
159 /// asynchronous case.
160 /// @param context The request context.
161 /// @return A function that can be called to cancel the invocation locally.
162 // NOLINTNEXTLINE(modernize-use-nodiscard)
163 std::function<void()> getMetricsViewNamesAsync(std::function<void(::Ice::StringSeq, ::Ice::StringSeq)> response, std::function<void(std::exception_ptr)> exception = nullptr, std::function<void(bool)> sent = nullptr, const Ice::Context& context = Ice::noExplicitContext) const;
164
165 /// @private
166 void _iceI_getMetricsViewNames(const std::shared_ptr<IceInternal::OutgoingAsyncT<std::tuple<::Ice::StringSeq, ::Ice::StringSeq>>>&, const Ice::Context&) const;
167
168 /// Enables a metrics view.
169 /// @param name The metrics view name.
170 /// @param context The request context.
171 /// @throws IceMX::UnknownMetricsView Thrown when the metrics view cannot be found.
172 void enableMetricsView(std::string_view name, const Ice::Context& context = Ice::noExplicitContext) const;
173
174 /// Enables a metrics view.
175 /// @param name The metrics view name.
176 /// @param context The request context.
177 /// @return A future that becomes available when the invocation completes.
178 [[nodiscard]] std::future<void> enableMetricsViewAsync(std::string_view name, const Ice::Context& context = Ice::noExplicitContext) const;
179
180 /// Enables a metrics view.
181 /// @param name The metrics view name.
182 /// @param response The response callback. The Ice runtime calls this function from an Ice thread pool
183 /// thread. If you set Ice::InitializationData::executor, the executor determines the thread that executes this
184 /// function.
185 /// @param exception The exception callback. The Ice runtime calls this function from an Ice thread pool
186 /// thread. If you set Ice::InitializationData::executor, the executor determines the thread that executes this
187 /// function.
188 /// @param sent The sent callback. The Ice runtime calls this function when the request is accepted by the
189 /// transport. When the request is accepted synchronously, the Ice runtime calls this function from the current
190 /// thread and passes `true` as argument. When the request is accepted asynchronously, the Ice runtime calls
191 /// this function from an Ice thread pool thread and passes `false` as argument. If you set
192 /// Ice::InitializationData::executor, the executor determines the thread that executes this function in the
193 /// asynchronous case.
194 /// @param context The request context.
195 /// @return A function that can be called to cancel the invocation locally.
196 // NOLINTNEXTLINE(modernize-use-nodiscard)
197 std::function<void()> enableMetricsViewAsync(std::string_view name, std::function<void()> response, std::function<void(std::exception_ptr)> exception = nullptr, std::function<void(bool)> sent = nullptr, const Ice::Context& context = Ice::noExplicitContext) const;
198
199 /// @private
200 void _iceI_enableMetricsView(const std::shared_ptr<IceInternal::OutgoingAsyncT<void>>&, std::string_view, const Ice::Context&) const;
201
202 /// Disables a metrics view.
203 /// @param name The metrics view name.
204 /// @param context The request context.
205 /// @throws IceMX::UnknownMetricsView Thrown when the metrics view cannot be found.
206 void disableMetricsView(std::string_view name, const Ice::Context& context = Ice::noExplicitContext) const;
207
208 /// Disables a metrics view.
209 /// @param name The metrics view name.
210 /// @param context The request context.
211 /// @return A future that becomes available when the invocation completes.
212 [[nodiscard]] std::future<void> disableMetricsViewAsync(std::string_view name, const Ice::Context& context = Ice::noExplicitContext) const;
213
214 /// Disables a metrics view.
215 /// @param name The metrics view name.
216 /// @param response The response callback. The Ice runtime calls this function from an Ice thread pool
217 /// thread. If you set Ice::InitializationData::executor, the executor determines the thread that executes this
218 /// function.
219 /// @param exception The exception callback. The Ice runtime calls this function from an Ice thread pool
220 /// thread. If you set Ice::InitializationData::executor, the executor determines the thread that executes this
221 /// function.
222 /// @param sent The sent callback. The Ice runtime calls this function when the request is accepted by the
223 /// transport. When the request is accepted synchronously, the Ice runtime calls this function from the current
224 /// thread and passes `true` as argument. When the request is accepted asynchronously, the Ice runtime calls
225 /// this function from an Ice thread pool thread and passes `false` as argument. If you set
226 /// Ice::InitializationData::executor, the executor determines the thread that executes this function in the
227 /// asynchronous case.
228 /// @param context The request context.
229 /// @return A function that can be called to cancel the invocation locally.
230 // NOLINTNEXTLINE(modernize-use-nodiscard)
231 std::function<void()> disableMetricsViewAsync(std::string_view name, std::function<void()> response, std::function<void(std::exception_ptr)> exception = nullptr, std::function<void(bool)> sent = nullptr, const Ice::Context& context = Ice::noExplicitContext) const;
232
233 /// @private
234 void _iceI_disableMetricsView(const std::shared_ptr<IceInternal::OutgoingAsyncT<void>>&, std::string_view, const Ice::Context&) const;
235
236 /// Gets the metrics objects for the given metrics view.
237 /// @param view The name of the metrics view.
238 /// @param[out] timestamp The local time of the process when the metrics objects were retrieved.
239 /// @param context The request context.
240 /// @return The metrics view data, a dictionary of metric maps for each metrics class configured with the view.
241 /// The `timestamp` allows the client to compute averages which are not dependent on the invocation latency for
242 /// this operation.
243 /// @throws IceMX::UnknownMetricsView Thrown when the metrics view cannot be found.
244 MetricsView getMetricsView(std::string_view view, std::int64_t& timestamp, const Ice::Context& context = Ice::noExplicitContext) const;
245
246 /// Gets the metrics objects for the given metrics view.
247 /// @param view The name of the metrics view.
248 /// @param context The request context.
249 /// @return A future that becomes available when the invocation completes. This future holds:
250 /// - `returnValue` The metrics view data, a dictionary of metric maps for each metrics class configured with the view.
251 /// The `timestamp` allows the client to compute averages which are not dependent on the invocation latency for
252 /// this operation.
253 /// - `timestamp` The local time of the process when the metrics objects were retrieved.
254 [[nodiscard]] std::future<std::tuple<MetricsView, std::int64_t>> getMetricsViewAsync(std::string_view view, const Ice::Context& context = Ice::noExplicitContext) const;
255
256 /// Gets the metrics objects for the given metrics view.
257 /// @param view The name of the metrics view.
258 /// @param response The response callback. The Ice runtime calls this function from an Ice thread pool
259 /// thread. If you set Ice::InitializationData::executor, the executor determines the thread that executes this
260 /// function. It accepts:
261 /// - `returnValue` The metrics view data, a dictionary of metric maps for each metrics class configured with the view.
262 /// The `timestamp` allows the client to compute averages which are not dependent on the invocation latency for
263 /// this operation.
264 /// - `timestamp` The local time of the process when the metrics objects were retrieved.
265 /// @param exception The exception callback. The Ice runtime calls this function from an Ice thread pool
266 /// thread. If you set Ice::InitializationData::executor, the executor determines the thread that executes this
267 /// function.
268 /// @param sent The sent callback. The Ice runtime calls this function when the request is accepted by the
269 /// transport. When the request is accepted synchronously, the Ice runtime calls this function from the current
270 /// thread and passes `true` as argument. When the request is accepted asynchronously, the Ice runtime calls
271 /// this function from an Ice thread pool thread and passes `false` as argument. If you set
272 /// Ice::InitializationData::executor, the executor determines the thread that executes this function in the
273 /// asynchronous case.
274 /// @param context The request context.
275 /// @return A function that can be called to cancel the invocation locally.
276 // NOLINTNEXTLINE(modernize-use-nodiscard)
277 std::function<void()> getMetricsViewAsync(std::string_view view, std::function<void(::IceMX::MetricsView, std::int64_t)> response, std::function<void(std::exception_ptr)> exception = nullptr, std::function<void(bool)> sent = nullptr, const Ice::Context& context = Ice::noExplicitContext) const;
278
279 /// @private
280 void _iceI_getMetricsView(const std::shared_ptr<IceInternal::OutgoingAsyncT<std::tuple<MetricsView, std::int64_t>>>&, std::string_view, const Ice::Context&) const;
281
282 /// Gets the metrics failures associated with the given @p view and @p map.
283 /// @param view The name of the metrics view.
284 /// @param map The name of the metrics map.
285 /// @param context The request context.
286 /// @return The metrics failures associated with the map.
287 /// @throws IceMX::UnknownMetricsView Thrown when the metrics view cannot be found.
288 MetricsFailuresSeq getMapMetricsFailures(std::string_view view, std::string_view map, const Ice::Context& context = Ice::noExplicitContext) const; // NOLINT(modernize-use-nodiscard)
289
290 /// Gets the metrics failures associated with the given @p view and @p map.
291 /// @param view The name of the metrics view.
292 /// @param map The name of the metrics map.
293 /// @param context The request context.
294 /// @return A future that becomes available when the invocation completes. This future holds:
295 /// - The metrics failures associated with the map.
296 [[nodiscard]] std::future<MetricsFailuresSeq> getMapMetricsFailuresAsync(std::string_view view, std::string_view map, const Ice::Context& context = Ice::noExplicitContext) const;
297
298 /// Gets the metrics failures associated with the given @p view and @p map.
299 /// @param view The name of the metrics view.
300 /// @param map The name of the metrics map.
301 /// @param response The response callback. The Ice runtime calls this function from an Ice thread pool
302 /// thread. If you set Ice::InitializationData::executor, the executor determines the thread that executes this
303 /// function. It accepts:
304 /// - The metrics failures associated with the map.
305 /// @param exception The exception callback. The Ice runtime calls this function from an Ice thread pool
306 /// thread. If you set Ice::InitializationData::executor, the executor determines the thread that executes this
307 /// function.
308 /// @param sent The sent callback. The Ice runtime calls this function when the request is accepted by the
309 /// transport. When the request is accepted synchronously, the Ice runtime calls this function from the current
310 /// thread and passes `true` as argument. When the request is accepted asynchronously, the Ice runtime calls
311 /// this function from an Ice thread pool thread and passes `false` as argument. If you set
312 /// Ice::InitializationData::executor, the executor determines the thread that executes this function in the
313 /// asynchronous case.
314 /// @param context The request context.
315 /// @return A function that can be called to cancel the invocation locally.
316 // NOLINTNEXTLINE(modernize-use-nodiscard)
317 std::function<void()> getMapMetricsFailuresAsync(std::string_view view, std::string_view map, std::function<void(::IceMX::MetricsFailuresSeq)> response, std::function<void(std::exception_ptr)> exception = nullptr, std::function<void(bool)> sent = nullptr, const Ice::Context& context = Ice::noExplicitContext) const;
318
319 /// @private
320 void _iceI_getMapMetricsFailures(const std::shared_ptr<IceInternal::OutgoingAsyncT<MetricsFailuresSeq>>&, std::string_view, std::string_view, const Ice::Context&) const;
321
322 /// Gets the metrics failures associated with the given metrics.
323 /// @param view The name of the metrics view.
324 /// @param map The name of the metrics map.
325 /// @param id The ID of the metrics.
326 /// @param context The request context.
327 /// @return The metrics failures associated with the metrics.
328 /// @throws IceMX::UnknownMetricsView Thrown when the metrics view cannot be found.
329 MetricsFailures getMetricsFailures(std::string_view view, std::string_view map, std::string_view id, const Ice::Context& context = Ice::noExplicitContext) const; // NOLINT(modernize-use-nodiscard)
330
331 /// Gets the metrics failures associated with the given metrics.
332 /// @param view The name of the metrics view.
333 /// @param map The name of the metrics map.
334 /// @param id The ID of the metrics.
335 /// @param context The request context.
336 /// @return A future that becomes available when the invocation completes. This future holds:
337 /// - The metrics failures associated with the metrics.
338 [[nodiscard]] std::future<MetricsFailures> getMetricsFailuresAsync(std::string_view view, std::string_view map, std::string_view id, const Ice::Context& context = Ice::noExplicitContext) const;
339
340 /// Gets the metrics failures associated with the given metrics.
341 /// @param view The name of the metrics view.
342 /// @param map The name of the metrics map.
343 /// @param id The ID of the metrics.
344 /// @param response The response callback. The Ice runtime calls this function from an Ice thread pool
345 /// thread. If you set Ice::InitializationData::executor, the executor determines the thread that executes this
346 /// function. It accepts:
347 /// - The metrics failures associated with the metrics.
348 /// @param exception The exception callback. The Ice runtime calls this function from an Ice thread pool
349 /// thread. If you set Ice::InitializationData::executor, the executor determines the thread that executes this
350 /// function.
351 /// @param sent The sent callback. The Ice runtime calls this function when the request is accepted by the
352 /// transport. When the request is accepted synchronously, the Ice runtime calls this function from the current
353 /// thread and passes `true` as argument. When the request is accepted asynchronously, the Ice runtime calls
354 /// this function from an Ice thread pool thread and passes `false` as argument. If you set
355 /// Ice::InitializationData::executor, the executor determines the thread that executes this function in the
356 /// asynchronous case.
357 /// @param context The request context.
358 /// @return A function that can be called to cancel the invocation locally.
359 // NOLINTNEXTLINE(modernize-use-nodiscard)
360 std::function<void()> getMetricsFailuresAsync(std::string_view view, std::string_view map, std::string_view id, std::function<void(::IceMX::MetricsFailures)> response, std::function<void(std::exception_ptr)> exception = nullptr, std::function<void(bool)> sent = nullptr, const Ice::Context& context = Ice::noExplicitContext) const;
361
362 /// @private
363 void _iceI_getMetricsFailures(const std::shared_ptr<IceInternal::OutgoingAsyncT<MetricsFailures>>&, std::string_view, std::string_view, std::string_view, const Ice::Context&) const;
364
365 /// Gets the type ID of the associated Slice interface.
366 /// @return The string `"::IceMX::MetricsAdmin"`.
367 static const char* ice_staticId() noexcept;
368
369 /// @private
370 static MetricsAdminPrx _fromReference(IceInternal::ReferencePtr ref) { return MetricsAdminPrx{std::move(ref)}; }
371
372 protected:
373 /// @private
374 MetricsAdminPrx() = default;
375
376 /// @private
377 explicit MetricsAdminPrx(IceInternal::ReferencePtr&& ref) : Ice::ObjectPrx{std::move(ref)}
378 {
379 }
380 };
381}
382
383namespace IceMX
384{
385 /// The base class for metrics. A metrics object represents a collection of measurements associated with a given
386 /// system.
387 /// @remarks The Slice compiler generated this class from Slice class `::IceMX::Metrics`.
388 /// @headerfile Ice/Ice.h
389 class ICE_API Metrics : public Ice::Value
390 {
391 public:
392 /// Default constructor.
393 Metrics() noexcept = default;
394
395 /// One-shot constructor to initialize all data members.
396 /// @param id The metrics identifier.
397 /// @param total The total number of objects observed by this metrics.
398 /// @param current The number of objects currently observed by this metrics.
399 /// @param totalLifetime The sum of the lifetimes of each observed object.
400 /// @param failures The number of failures observed.
401 Metrics(std::string id, std::int64_t total, std::int32_t current, std::int64_t totalLifetime, std::int32_t failures) noexcept :
402 id(std::move(id)),
403 total(total),
407 {
408 }
409
410 /// Gets the type ID of the associated Slice class.
411 /// @return The string `"::IceMX::Metrics"`.
412 static const char* ice_staticId() noexcept;
413
414 [[nodiscard]] const char* ice_id() const noexcept override;
415
416 /// Creates a tuple with all the fields of this class.
417 /// @return A tuple with all the fields of this class.
418 [[nodiscard]] std::tuple<const std::string&, const std::int64_t&, const std::int32_t&, const std::int64_t&, const std::int32_t&> ice_tuple() const
419 {
420 return std::tie(id, total, current, totalLifetime, failures);
421 }
422
423 /// Creates a shallow polymorphic copy of this instance.
424 /// @return The cloned value.
425 [[nodiscard]] MetricsPtr ice_clone() const { return std::static_pointer_cast<Metrics>(_iceCloneImpl()); }
426
427 void ice_printFields(std::ostream& os) const override;
428
429 /// The metrics identifier.
430 std::string id;
431
432 /// The total number of objects observed by this metrics. This includes the number of currently observed objects
433 /// and the number of objects observed in the past.
434 std::int64_t total{INT64_C(0)};
435
436 /// The number of objects currently observed by this metrics.
437 std::int32_t current{0};
438
439 /// The sum of the lifetimes of each observed object. This does not include the lifetimes of objects which are
440 /// currently observed, only the objects observed in the past.
441 std::int64_t totalLifetime{INT64_C(0)};
442
443 /// The number of failures observed.
444 std::int32_t failures{0};
445
446 protected:
447 /// Copy constructor.
448 Metrics(const Metrics&) = default;
449
450 /// @private
451 [[nodiscard]] Ice::ValuePtr _iceCloneImpl() const override;
452
453 /// @private
454 void _iceWriteImpl(Ice::OutputStream*) const override;
455
456 /// @private
457 void _iceReadImpl(Ice::InputStream*) override;
458 };
459
460 /// Keeps track of metrics failures.
461 /// @remarks The Slice compiler generated this struct from Slice struct `::IceMX::MetricsFailures`.
462 /// @headerfile Ice/Ice.h
464 {
465 /// The identifier of the metrics object associated to the failures.
466 std::string id;
467
468 /// The failures observed for this metrics.
470
471 /// Creates a tuple with all the fields of this struct.
472 /// @return A tuple with all the fields of this struct.
473 [[nodiscard]] std::tuple<const std::string&, const ::IceMX::StringIntDict&> ice_tuple() const
474 {
475 return std::tie(id, failures);
476 }
477
478 /// Outputs the name and value of each field of this instance to the stream.
479 /// @param os The output stream.
480 ICE_API void ice_printFields(std::ostream& os) const;
481 };
482
483 /// Outputs the description of a MetricsFailures to a stream, including all its fields.
484 /// @param os The output stream.
485 /// @param value The instance to output.
486 /// @return The output stream.
487 ICE_API std::ostream& operator<<(std::ostream& os, const MetricsFailures& value);
488
489 /// The exception that is thrown when a metrics view cannot be found.
490 /// @remarks The Slice compiler generated this exception class from Slice exception `::IceMX::UnknownMetricsView`.
491 /// @headerfile Ice/Ice.h
493 {
494 public:
495 /// Gets the type ID of the associated Slice exception.
496 /// @return The string `"::IceMX::UnknownMetricsView"`.
497 static const char* ice_staticId() noexcept;
498
499 [[nodiscard]] const char* ice_id() const noexcept override;
500
501 void ice_throw() const override;
502
503 protected:
504 /// @private
505 void _writeImpl(Ice::OutputStream*) const override;
506
507 /// @private
508 void _readImpl(Ice::InputStream*) override;
509 };
510
511 /// Provides information on the number of threads currently in use and their activity.
512 /// @remarks The Slice compiler generated this class from Slice class `::IceMX::ThreadMetrics`.
513 /// @headerfile Ice/Ice.h
514 class ICE_API ThreadMetrics : public Metrics
515 {
516 public:
517 /// Default constructor.
518 ThreadMetrics() noexcept = default;
519
520 /// One-shot constructor to initialize all data members.
521 /// @param id The metrics identifier.
522 /// @param total The total number of objects observed by this metrics.
523 /// @param current The number of objects currently observed by this metrics.
524 /// @param totalLifetime The sum of the lifetimes of each observed object.
525 /// @param failures The number of failures observed.
526 /// @param inUseForIO The number of threads which are currently performing socket reads or writes.
527 /// @param inUseForUser The number of threads which are currently calling user code (servant dispatch, AMI callbacks, etc).
528 /// @param inUseForOther The number of threads which are currently performing other activities such as DNS lookups, garbage collection, etc.
529 ThreadMetrics(std::string id, std::int64_t total, std::int32_t current, std::int64_t totalLifetime, std::int32_t failures, std::int32_t inUseForIO, std::int32_t inUseForUser, std::int32_t inUseForOther) noexcept :
530 Metrics(std::move(id), total, current, totalLifetime, failures),
534 {
535 }
536
537 /// Gets the type ID of the associated Slice class.
538 /// @return The string `"::IceMX::ThreadMetrics"`.
539 static const char* ice_staticId() noexcept;
540
541 [[nodiscard]] const char* ice_id() const noexcept override;
542
543 /// Creates a tuple with all the fields of this class.
544 /// @return A tuple with all the fields of this class.
545 [[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::int32_t&> ice_tuple() const
546 {
548 }
549
550 /// Creates a shallow polymorphic copy of this instance.
551 /// @return The cloned value.
552 [[nodiscard]] ThreadMetricsPtr ice_clone() const { return std::static_pointer_cast<ThreadMetrics>(_iceCloneImpl()); }
553
554 void ice_printFields(std::ostream& os) const override;
555
556 /// The number of threads which are currently performing socket reads or writes.
557 std::int32_t inUseForIO{0};
558
559 /// The number of threads which are currently calling user code (servant dispatch, AMI callbacks, etc).
560 std::int32_t inUseForUser{0};
561
562 /// The number of threads which are currently performing other activities such as DNS lookups, garbage
563 /// collection, etc. These are all the other threads created by the Ice runtime that are not counted in
564 /// ::IceMX::ThreadMetrics#inUseForUser or ::IceMX::ThreadMetrics#inUseForIO.
565 std::int32_t inUseForOther{0};
566
567 protected:
568 /// Copy constructor.
569 ThreadMetrics(const ThreadMetrics&) = default;
570
571 /// @private
572 [[nodiscard]] Ice::ValuePtr _iceCloneImpl() const override;
573
574 /// @private
575 void _iceWriteImpl(Ice::OutputStream*) const override;
576
577 /// @private
578 void _iceReadImpl(Ice::InputStream*) override;
579 };
580
581 /// Provides information on servant dispatches.
582 /// @remarks The Slice compiler generated this class from Slice class `::IceMX::DispatchMetrics`.
583 /// @headerfile Ice/Ice.h
584 class ICE_API DispatchMetrics : public Metrics
585 {
586 public:
587 /// Default constructor.
588 DispatchMetrics() noexcept = default;
589
590 /// One-shot constructor to initialize all data members.
591 /// @param id The metrics identifier.
592 /// @param total The total number of objects observed by this metrics.
593 /// @param current The number of objects currently observed by this metrics.
594 /// @param totalLifetime The sum of the lifetimes of each observed object.
595 /// @param failures The number of failures observed.
596 /// @param userException The number of dispatches that failed with a user exception.
597 /// @param size The size of the incoming requests.
598 /// @param replySize The size of the replies.
599 DispatchMetrics(std::string id, std::int64_t total, std::int32_t current, std::int64_t totalLifetime, std::int32_t failures, std::int32_t userException, std::int64_t size, std::int64_t replySize) noexcept :
600 Metrics(std::move(id), total, current, totalLifetime, failures),
602 size(size),
604 {
605 }
606
607 /// Gets the type ID of the associated Slice class.
608 /// @return The string `"::IceMX::DispatchMetrics"`.
609 static const char* ice_staticId() noexcept;
610
611 [[nodiscard]] const char* ice_id() const noexcept override;
612
613 /// Creates a tuple with all the fields of this class.
614 /// @return A tuple with all the fields of this class.
615 [[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::int64_t&, const std::int64_t&> ice_tuple() const
616 {
618 }
619
620 /// Creates a shallow polymorphic copy of this instance.
621 /// @return The cloned value.
622 [[nodiscard]] DispatchMetricsPtr ice_clone() const { return std::static_pointer_cast<DispatchMetrics>(_iceCloneImpl()); }
623
624 void ice_printFields(std::ostream& os) const override;
625
626 /// The number of dispatches that failed with a user exception.
627 std::int32_t userException{0};
628
629 /// The size of the incoming requests. This corresponds to the size of the marshaled input parameters.
630 std::int64_t size{INT64_C(0)};
631
632 /// The size of the replies. This corresponds to the size of the marshaled output and return parameters.
633 std::int64_t replySize{INT64_C(0)};
634
635 protected:
636 /// Copy constructor.
638
639 /// @private
640 [[nodiscard]] Ice::ValuePtr _iceCloneImpl() const override;
641
642 /// @private
643 void _iceWriteImpl(Ice::OutputStream*) const override;
644
645 /// @private
646 void _iceReadImpl(Ice::InputStream*) override;
647 };
648
649 /// Provides information on child invocations. A child invocation is either remote (sent over an Ice connection) or
650 /// collocated. An invocation can have multiple child invocations if it is retried. Child invocation metrics are
651 /// embedded within InvocationMetrics.
652 /// @remarks The Slice compiler generated this class from Slice class `::IceMX::ChildInvocationMetrics`.
653 /// @headerfile Ice/Ice.h
654 class ICE_API ChildInvocationMetrics : public Metrics
655 {
656 public:
657 /// Default constructor.
658 ChildInvocationMetrics() noexcept = default;
659
660 /// One-shot constructor to initialize all data members.
661 /// @param id The metrics identifier.
662 /// @param total The total number of objects observed by this metrics.
663 /// @param current The number of objects currently observed by this metrics.
664 /// @param totalLifetime The sum of the lifetimes of each observed object.
665 /// @param failures The number of failures observed.
666 /// @param size The size of the invocation.
667 /// @param replySize The size of the invocation reply.
668 ChildInvocationMetrics(std::string id, std::int64_t total, std::int32_t current, std::int64_t totalLifetime, std::int32_t failures, std::int64_t size, std::int64_t replySize) noexcept :
669 Metrics(std::move(id), total, current, totalLifetime, failures),
670 size(size),
672 {
673 }
674
675 /// Gets the type ID of the associated Slice class.
676 /// @return The string `"::IceMX::ChildInvocationMetrics"`.
677 static const char* ice_staticId() noexcept;
678
679 [[nodiscard]] const char* ice_id() const noexcept override;
680
681 /// Creates a tuple with all the fields of this class.
682 /// @return A tuple with all the fields of this class.
683 [[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
684 {
685 return std::tie(id, total, current, totalLifetime, failures, size, replySize);
686 }
687
688 /// Creates a shallow polymorphic copy of this instance.
689 /// @return The cloned value.
690 [[nodiscard]] ChildInvocationMetricsPtr ice_clone() const { return std::static_pointer_cast<ChildInvocationMetrics>(_iceCloneImpl()); }
691
692 void ice_printFields(std::ostream& os) const override;
693
694 /// The size of the invocation. This corresponds to the size of the marshaled input parameters.
695 std::int64_t size{INT64_C(0)};
696
697 /// The size of the invocation reply. This corresponds to the size of the marshaled output and return
698 /// parameters.
699 std::int64_t replySize{INT64_C(0)};
700
701 protected:
702 /// Copy constructor.
704
705 /// @private
706 [[nodiscard]] Ice::ValuePtr _iceCloneImpl() const override;
707
708 /// @private
709 void _iceWriteImpl(Ice::OutputStream*) const override;
710
711 /// @private
712 void _iceReadImpl(Ice::InputStream*) override;
713 };
714
715 /// Provides information on invocations that are collocated. Collocated metrics are embedded within
716 /// InvocationMetrics.
717 /// @remarks The Slice compiler generated this class from Slice class `::IceMX::CollocatedMetrics`.
718 /// @headerfile Ice/Ice.h
720 {
722
723 /// Gets the type ID of the associated Slice class.
724 /// @return The string `"::IceMX::CollocatedMetrics"`.
725 static const char* ice_staticId() noexcept;
726
727 [[nodiscard]] const char* ice_id() const noexcept override;
728
729 /// Creates a shallow polymorphic copy of this instance.
730 /// @return The cloned value.
731 [[nodiscard]] CollocatedMetricsPtr ice_clone() const { return std::static_pointer_cast<CollocatedMetrics>(_iceCloneImpl()); }
732
733 protected:
734 /// Copy constructor.
736
737 /// @private
738 [[nodiscard]] Ice::ValuePtr _iceCloneImpl() const override;
739
740 /// @private
741 void _iceWriteImpl(Ice::OutputStream*) const override;
742
743 /// @private
744 void _iceReadImpl(Ice::InputStream*) override;
745 };
746
747 /// Provides information on invocations that are specifically sent over Ice connections. Remote metrics are embedded
748 /// within InvocationMetrics.
749 /// @remarks The Slice compiler generated this class from Slice class `::IceMX::RemoteMetrics`.
750 /// @headerfile Ice/Ice.h
752 {
754
755 /// Gets the type ID of the associated Slice class.
756 /// @return The string `"::IceMX::RemoteMetrics"`.
757 static const char* ice_staticId() noexcept;
758
759 [[nodiscard]] const char* ice_id() const noexcept override;
760
761 /// Creates a shallow polymorphic copy of this instance.
762 /// @return The cloned value.
763 [[nodiscard]] RemoteMetricsPtr ice_clone() const { return std::static_pointer_cast<RemoteMetrics>(_iceCloneImpl()); }
764
765 protected:
766 /// Copy constructor.
767 RemoteMetrics(const RemoteMetrics&) = default;
768
769 /// @private
770 [[nodiscard]] Ice::ValuePtr _iceCloneImpl() const override;
771
772 /// @private
773 void _iceWriteImpl(Ice::OutputStream*) const override;
774
775 /// @private
776 void _iceReadImpl(Ice::InputStream*) override;
777 };
778
779 /// Provides measurements for proxy invocations. Proxy invocations can either be sent over the wire or be
780 /// collocated.
781 /// @remarks The Slice compiler generated this class from Slice class `::IceMX::InvocationMetrics`.
782 /// @headerfile Ice/Ice.h
783 class ICE_API InvocationMetrics : public Metrics
784 {
785 public:
786 /// Default constructor.
787 InvocationMetrics() noexcept = default;
788
789 /// One-shot constructor to initialize all data members.
790 /// @param id The metrics identifier.
791 /// @param total The total number of objects observed by this metrics.
792 /// @param current The number of objects currently observed by this metrics.
793 /// @param totalLifetime The sum of the lifetimes of each observed object.
794 /// @param failures The number of failures observed.
795 /// @param retry The number of retries for the invocations.
796 /// @param userException The number of invocations that failed with a user exception.
797 /// @param remotes The remote invocation metrics map.
798 /// @param collocated The collocated invocation metrics map.
799 InvocationMetrics(std::string id, std::int64_t total, std::int32_t current, std::int64_t totalLifetime, std::int32_t failures, std::int32_t retry, std::int32_t userException, ::IceMX::MetricsMap remotes, ::IceMX::MetricsMap collocated) noexcept :
800 Metrics(std::move(id), total, current, totalLifetime, failures),
801 retry(retry),
803 remotes(std::move(remotes)),
804 collocated(std::move(collocated))
805 {
806 }
807
808 /// Gets the type ID of the associated Slice class.
809 /// @return The string `"::IceMX::InvocationMetrics"`.
810 static const char* ice_staticId() noexcept;
811
812 [[nodiscard]] const char* ice_id() const noexcept override;
813
814 /// Creates a tuple with all the fields of this class.
815 /// @return A tuple with all the fields of this class.
816 [[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 ::IceMX::MetricsMap&, const ::IceMX::MetricsMap&> ice_tuple() const
817 {
819 }
820
821 /// Creates a shallow polymorphic copy of this instance.
822 /// @return The cloned value.
823 [[nodiscard]] InvocationMetricsPtr ice_clone() const { return std::static_pointer_cast<InvocationMetrics>(_iceCloneImpl()); }
824
825 void ice_printFields(std::ostream& os) const override;
826
827 /// The number of retries for the invocations.
828 std::int32_t retry{0};
829
830 /// The number of invocations that failed with a user exception.
831 std::int32_t userException{0};
832
833 /// The remote invocation metrics map.
834 /// @see ::IceMX::RemoteMetrics
836
837 /// The collocated invocation metrics map.
838 /// @see ::IceMX::CollocatedMetrics
840
841 protected:
842 /// Copy constructor.
844
845 /// @private
846 [[nodiscard]] Ice::ValuePtr _iceCloneImpl() const override;
847
848 /// @private
849 void _iceWriteImpl(Ice::OutputStream*) const override;
850
851 /// @private
852 void _iceReadImpl(Ice::InputStream*) override;
853 };
854
855 /// Provides information on the data sent and received over Ice connections.
856 /// @remarks The Slice compiler generated this class from Slice class `::IceMX::ConnectionMetrics`.
857 /// @headerfile Ice/Ice.h
858 class ICE_API ConnectionMetrics : public Metrics
859 {
860 public:
861 /// Default constructor.
862 ConnectionMetrics() noexcept = default;
863
864 /// One-shot constructor to initialize all data members.
865 /// @param id The metrics identifier.
866 /// @param total The total number of objects observed by this metrics.
867 /// @param current The number of objects currently observed by this metrics.
868 /// @param totalLifetime The sum of the lifetimes of each observed object.
869 /// @param failures The number of failures observed.
870 /// @param receivedBytes The number of bytes received by the connection.
871 /// @param sentBytes The number of bytes sent by the connection.
872 ConnectionMetrics(std::string id, std::int64_t total, std::int32_t current, std::int64_t totalLifetime, std::int32_t failures, std::int64_t receivedBytes, std::int64_t sentBytes) noexcept :
873 Metrics(std::move(id), total, current, totalLifetime, failures),
876 {
877 }
878
879 /// Gets the type ID of the associated Slice class.
880 /// @return The string `"::IceMX::ConnectionMetrics"`.
881 static const char* ice_staticId() noexcept;
882
883 [[nodiscard]] const char* ice_id() const noexcept override;
884
885 /// Creates a tuple with all the fields of this class.
886 /// @return A tuple with all the fields of this class.
887 [[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
888 {
889 return std::tie(id, total, current, totalLifetime, failures, receivedBytes, sentBytes);
890 }
891
892 /// Creates a shallow polymorphic copy of this instance.
893 /// @return The cloned value.
894 [[nodiscard]] ConnectionMetricsPtr ice_clone() const { return std::static_pointer_cast<ConnectionMetrics>(_iceCloneImpl()); }
895
896 void ice_printFields(std::ostream& os) const override;
897
898 /// The number of bytes received by the connection.
899 std::int64_t receivedBytes{INT64_C(0)};
900
901 /// The number of bytes sent by the connection.
902 std::int64_t sentBytes{INT64_C(0)};
903
904 protected:
905 /// Copy constructor.
907
908 /// @private
909 [[nodiscard]] Ice::ValuePtr _iceCloneImpl() const override;
910
911 /// @private
912 void _iceWriteImpl(Ice::OutputStream*) const override;
913
914 /// @private
915 void _iceReadImpl(Ice::InputStream*) override;
916 };
917
918 /// @cond INTERNAL
919 using Ice::Tuple::operator<;
920 using Ice::Tuple::operator<=;
921 using Ice::Tuple::operator>;
922 using Ice::Tuple::operator>=;
923 using Ice::Tuple::operator==;
924 using Ice::Tuple::operator!=;
925 /// @endcond
926}
927
928namespace IceMX
929{
930 /// The metrics administrative facet interface. This interface allows remote administrative clients to access the
931 /// metrics of an application that enabled the Ice administrative facility and configured one or more metrics views.
932 /// @remarks The Slice compiler generated this skeleton class from Slice interface `::IceMX::MetricsAdmin`.
933 /// @headerfile Ice/Ice.h
934 class ICE_API MetricsAdmin : public virtual Ice::Object
935 {
936 public:
937 /// The associated proxy type.
938 using ProxyType = MetricsAdminPrx;
939
940 /// Dispatches an incoming request to one of the member functions of this generated class, based on the operation name carried by the request.
941 /// @param request The incoming request.
942 /// @param sendResponse The callback to send the response.
943 void dispatch(Ice::IncomingRequest& request, std::function<void(Ice::OutgoingResponse)> sendResponse) override;
944
945 [[nodiscard]] std::vector<std::string> ice_ids(const Ice::Current& current) const override;
946
947 [[nodiscard]] std::string ice_id(const Ice::Current& current) const override;
948
949 /// Gets the names of the enabled and disabled metrics views.
950 /// @param[out] disabledViews The names of the disabled views.
951 /// @param current The Current object of the incoming request.
952 /// @return The names of the enabled views.
953 virtual ::Ice::StringSeq getMetricsViewNames(::Ice::StringSeq& disabledViews, const Ice::Current& current) = 0;
954
955 /// @private
956 void _iceD_getMetricsViewNames(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
957
958 /// Enables a metrics view.
959 /// @param name The metrics view name.
960 /// @param current The Current object of the incoming request.
961 /// @throws IceMX::UnknownMetricsView Thrown when the metrics view cannot be found.
962 virtual void enableMetricsView(std::string name, const Ice::Current& current) = 0;
963
964 /// @private
965 void _iceD_enableMetricsView(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
966
967 /// Disables a metrics view.
968 /// @param name The metrics view name.
969 /// @param current The Current object of the incoming request.
970 /// @throws IceMX::UnknownMetricsView Thrown when the metrics view cannot be found.
971 virtual void disableMetricsView(std::string name, const Ice::Current& current) = 0;
972
973 /// @private
974 void _iceD_disableMetricsView(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
975
976 /// Gets the metrics objects for the given metrics view.
977 /// @param view The name of the metrics view.
978 /// @param[out] timestamp The local time of the process when the metrics objects were retrieved.
979 /// @param current The Current object of the incoming request.
980 /// @return The metrics view data, a dictionary of metric maps for each metrics class configured with the view.
981 /// The `timestamp` allows the client to compute averages which are not dependent on the invocation latency for
982 /// this operation.
983 /// @throws IceMX::UnknownMetricsView Thrown when the metrics view cannot be found.
984 virtual MetricsView getMetricsView(std::string view, std::int64_t& timestamp, const Ice::Current& current) = 0;
985
986 /// @private
987 void _iceD_getMetricsView(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
988
989 /// Gets the metrics failures associated with the given @p view and @p map.
990 /// @param view The name of the metrics view.
991 /// @param map The name of the metrics map.
992 /// @param current The Current object of the incoming request.
993 /// @return The metrics failures associated with the map.
994 /// @throws IceMX::UnknownMetricsView Thrown when the metrics view cannot be found.
995 virtual MetricsFailuresSeq getMapMetricsFailures(std::string view, std::string map, const Ice::Current& current) = 0;
996
997 /// @private
998 void _iceD_getMapMetricsFailures(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
999
1000 /// Gets the metrics failures associated with the given metrics.
1001 /// @param view The name of the metrics view.
1002 /// @param map The name of the metrics map.
1003 /// @param id The ID of the metrics.
1004 /// @param current The Current object of the incoming request.
1005 /// @return The metrics failures associated with the metrics.
1006 /// @throws IceMX::UnknownMetricsView Thrown when the metrics view cannot be found.
1007 virtual MetricsFailures getMetricsFailures(std::string view, std::string map, std::string id, const Ice::Current& current) = 0;
1008
1009 /// @private
1010 void _iceD_getMetricsFailures(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
1011
1012 /// Gets the type ID of the associated Slice interface.
1013 /// @return The string `"::IceMX::MetricsAdmin"`.
1014 static const char* ice_staticId() noexcept;
1015 };
1016
1017 /// A shared pointer to a MetricsAdmin.
1018 using MetricsAdminPtr = std::shared_ptr<MetricsAdmin>;
1019}
1020
1021namespace IceMX
1022{
1023 /// The metrics administrative facet interface. This interface allows remote administrative clients to access the
1024 /// metrics of an application that enabled the Ice administrative facility and configured one or more metrics views.
1025 /// @remarks The Slice compiler generated this skeleton class from Slice interface `::IceMX::MetricsAdmin`.
1026 /// @headerfile Ice/Ice.h
1027 class ICE_API AsyncMetricsAdmin : public virtual Ice::Object
1028 {
1029 public:
1030 /// The associated proxy type.
1032
1033 /// Dispatches an incoming request to one of the member functions of this generated class, based on the operation name carried by the request.
1034 /// @param request The incoming request.
1035 /// @param sendResponse The callback to send the response.
1036 void dispatch(Ice::IncomingRequest& request, std::function<void(Ice::OutgoingResponse)> sendResponse) override;
1037
1038 [[nodiscard]] std::vector<std::string> ice_ids(const Ice::Current& current) const override;
1039
1040 [[nodiscard]] std::string ice_id(const Ice::Current& current) const override;
1041
1042 /// Gets the names of the enabled and disabled metrics views.
1043 /// @param response The response callback. It accepts:
1044 /// - `returnValue` The names of the enabled views.
1045 /// - `disabledViews` The names of the disabled views.
1046 /// @param exception The exception callback.
1047 /// @param current The Current object of the incoming request.
1048 virtual void getMetricsViewNamesAsync(std::function<void(const ::Ice::StringSeq& returnValue, const ::Ice::StringSeq& disabledViews)> response, std::function<void(std::exception_ptr)> exception, const Ice::Current& current) = 0;
1049
1050 /// @private
1051 void _iceD_getMetricsViewNames(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
1052
1053 /// Enables a metrics view.
1054 /// @param name The metrics view name.
1055 /// @param response The response callback.
1056 /// @param exception The exception callback.
1057 /// @param current The Current object of the incoming request.
1058 /// @throws IceMX::UnknownMetricsView Thrown when the metrics view cannot be found.
1059 virtual void enableMetricsViewAsync(std::string name, std::function<void()> response, std::function<void(std::exception_ptr)> exception, const Ice::Current& current) = 0;
1060
1061 /// @private
1062 void _iceD_enableMetricsView(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
1063
1064 /// Disables a metrics view.
1065 /// @param name The metrics view name.
1066 /// @param response The response callback.
1067 /// @param exception The exception callback.
1068 /// @param current The Current object of the incoming request.
1069 /// @throws IceMX::UnknownMetricsView Thrown when the metrics view cannot be found.
1070 virtual void disableMetricsViewAsync(std::string name, std::function<void()> response, std::function<void(std::exception_ptr)> exception, const Ice::Current& current) = 0;
1071
1072 /// @private
1073 void _iceD_disableMetricsView(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
1074
1075 /// Gets the metrics objects for the given metrics view.
1076 /// @param view The name of the metrics view.
1077 /// @param response The response callback. It accepts:
1078 /// - `returnValue` The metrics view data, a dictionary of metric maps for each metrics class configured with the view.
1079 /// The `timestamp` allows the client to compute averages which are not dependent on the invocation latency for
1080 /// this operation.
1081 /// - `timestamp` The local time of the process when the metrics objects were retrieved.
1082 /// @param exception The exception callback.
1083 /// @param current The Current object of the incoming request.
1084 /// @throws IceMX::UnknownMetricsView Thrown when the metrics view cannot be found.
1085 virtual void getMetricsViewAsync(std::string view, std::function<void(const MetricsView& returnValue, std::int64_t timestamp)> response, std::function<void(std::exception_ptr)> exception, const Ice::Current& current) = 0;
1086
1087 /// @private
1088 void _iceD_getMetricsView(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
1089
1090 /// Gets the metrics failures associated with the given @p view and @p map.
1091 /// @param view The name of the metrics view.
1092 /// @param map The name of the metrics map.
1093 /// @param response The response callback. It accepts:
1094 /// - The metrics failures associated with the map.
1095 /// @param exception The exception callback.
1096 /// @param current The Current object of the incoming request.
1097 /// @throws IceMX::UnknownMetricsView Thrown when the metrics view cannot be found.
1098 virtual void getMapMetricsFailuresAsync(std::string view, std::string map, std::function<void(const MetricsFailuresSeq& returnValue)> response, std::function<void(std::exception_ptr)> exception, const Ice::Current& current) = 0;
1099
1100 /// @private
1101 void _iceD_getMapMetricsFailures(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
1102
1103 /// Gets the metrics failures associated with the given metrics.
1104 /// @param view The name of the metrics view.
1105 /// @param map The name of the metrics map.
1106 /// @param id The ID of the metrics.
1107 /// @param response The response callback. It accepts:
1108 /// - The metrics failures associated with the metrics.
1109 /// @param exception The exception callback.
1110 /// @param current The Current object of the incoming request.
1111 /// @throws IceMX::UnknownMetricsView Thrown when the metrics view cannot be found.
1112 virtual void getMetricsFailuresAsync(std::string view, std::string map, std::string id, std::function<void(const MetricsFailures& returnValue)> response, std::function<void(std::exception_ptr)> exception, const Ice::Current& current) = 0;
1113
1114 /// @private
1115 void _iceD_getMetricsFailures(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
1116
1117 /// Gets the type ID of the associated Slice interface.
1118 /// @return The string `"::IceMX::MetricsAdmin"`.
1119 static const char* ice_staticId() noexcept;
1120 };
1121
1122 /// A shared pointer to an AsyncMetricsAdmin.
1123 using AsyncMetricsAdminPtr = std::shared_ptr<AsyncMetricsAdmin>;
1124}
1125
1126namespace Ice
1127{
1128 /// @cond INTERNAL
1129 template<>
1130 struct StreamableTraits<::IceMX::MetricsFailures>
1131 {
1132 static constexpr StreamHelperCategory helper = StreamHelperCategoryStruct;
1133 static constexpr int minWireSize = 2;
1134 static constexpr bool fixedLength = false;
1135 };
1136
1137 template<>
1138 struct StreamReader<::IceMX::MetricsFailures>
1139 {
1140 /// Unmarshals a ::IceMX::MetricsFailures from the input stream.
1141 static void read(InputStream* istr, ::IceMX::MetricsFailures& v)
1142 {
1143 istr->readAll(v.id, v.failures);
1144 }
1145 };
1146 /// @endcond
1147}
1148
1149// NOLINTEND(modernize-concat-nested-namespaces)
1150
1151#include <Ice/PopDisableWarnings.h>
1152#endif
virtual void disableMetricsViewAsync(std::string name, std::function< void()> response, std::function< void(std::exception_ptr)> exception, const Ice::Current &current)=0
Disables a metrics view.
static const char * ice_staticId() noexcept
Gets the type ID of the associated Slice interface.
MetricsAdminPrx ProxyType
The associated proxy type.
Definition Metrics.h:1031
std::vector< std::string > ice_ids(const Ice::Current &current) const override
Gets the Slice interfaces supported by this object as a list of Slice type IDs.
std::string ice_id(const Ice::Current &current) const override
Gets the type ID of the most-derived Slice interface supported by this object.
virtual void enableMetricsViewAsync(std::string name, std::function< void()> response, std::function< void(std::exception_ptr)> exception, const Ice::Current &current)=0
Enables a metrics view.
virtual void getMetricsViewNamesAsync(std::function< void(const ::Ice::StringSeq &returnValue, const ::Ice::StringSeq &disabledViews)> response, std::function< void(std::exception_ptr)> exception, const Ice::Current &current)=0
Gets the names of the enabled and disabled metrics views.
virtual void getMetricsFailuresAsync(std::string view, std::string map, std::string id, std::function< void(const MetricsFailures &returnValue)> response, std::function< void(std::exception_ptr)> exception, const Ice::Current &current)=0
Gets the metrics failures associated with the given metrics.
virtual void getMapMetricsFailuresAsync(std::string view, std::string map, std::function< void(const MetricsFailuresSeq &returnValue)> response, std::function< void(std::exception_ptr)> exception, const Ice::Current &current)=0
Gets the metrics failures associated with the given view and map.
void dispatch(Ice::IncomingRequest &request, std::function< void(Ice::OutgoingResponse)> sendResponse) override
Dispatches an incoming request to one of the member functions of this generated class,...
virtual void getMetricsViewAsync(std::string view, std::function< void(const MetricsView &returnValue, std::int64_t timestamp)> response, std::function< void(std::exception_ptr)> exception, const Ice::Current &current)=0
Gets the metrics objects for the given metrics view.
The metrics administrative facet interface.
Definition Metrics.h:1028
ChildInvocationMetricsPtr ice_clone() const
Creates a shallow polymorphic copy of this instance.
Definition Metrics.h:690
const char * ice_id() const noexcept override
Gets the Slice type ID of the most-derived class supported by this object.
static const char * ice_staticId() noexcept
Gets the type ID of the associated Slice class.
ChildInvocationMetrics(const ChildInvocationMetrics &)=default
Copy constructor.
std::int64_t size
The size of the invocation. This corresponds to the size of the marshaled input parameters.
Definition Metrics.h:695
void ice_printFields(std::ostream &os) const override
Outputs the name and value of each field of this instance, including inherited fields,...
ChildInvocationMetrics() noexcept=default
Default constructor.
std::int64_t replySize
The size of the invocation reply.
Definition Metrics.h:699
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:683
Provides information on child invocations.
Definition Metrics.h:655
CollocatedMetrics(const CollocatedMetrics &)=default
Copy constructor.
CollocatedMetricsPtr ice_clone() const
Creates a shallow polymorphic copy of this instance.
Definition Metrics.h:731
static const char * ice_staticId() noexcept
Gets the type ID of the associated Slice class.
const char * ice_id() const noexcept override
Gets the Slice type ID of the most-derived class supported by this object.
ChildInvocationMetrics() noexcept=default
Default constructor.
Provides information on invocations that are collocated.
Definition Metrics.h:720
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:887
ConnectionMetricsPtr ice_clone() const
Creates a shallow polymorphic copy of this instance.
Definition Metrics.h:894
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,...
ConnectionMetrics() noexcept=default
Default constructor.
static const char * ice_staticId() noexcept
Gets the type ID of the associated Slice class.
ConnectionMetrics(const ConnectionMetrics &)=default
Copy constructor.
std::int64_t receivedBytes
The number of bytes received by the connection.
Definition Metrics.h:899
std::int64_t sentBytes
The number of bytes sent by the connection.
Definition Metrics.h:902
Provides information on the data sent and received over Ice connections.
Definition Metrics.h:859
std::int32_t userException
The number of dispatches that failed with a user exception.
Definition Metrics.h:627
const char * ice_id() const noexcept override
Gets the Slice type ID of the most-derived class supported by this object.
DispatchMetricsPtr ice_clone() const
Creates a shallow polymorphic copy of this instance.
Definition Metrics.h:622
void ice_printFields(std::ostream &os) const override
Outputs the name and value of each field of this instance, including inherited fields,...
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::int64_t &, const std::int64_t & > ice_tuple() const
Creates a tuple with all the fields of this class.
Definition Metrics.h:615
std::int64_t size
The size of the incoming requests. This corresponds to the size of the marshaled input parameters.
Definition Metrics.h:630
std::int64_t replySize
The size of the replies. This corresponds to the size of the marshaled output and return parameters.
Definition Metrics.h:633
static const char * ice_staticId() noexcept
Gets the type ID of the associated Slice class.
DispatchMetrics(const DispatchMetrics &)=default
Copy constructor.
DispatchMetrics() noexcept=default
Default constructor.
Provides information on servant dispatches.
Definition Metrics.h:585
std::int32_t retry
The number of retries for the invocations.
Definition Metrics.h:828
::IceMX::MetricsMap collocated
The collocated invocation metrics map.
Definition Metrics.h:839
InvocationMetrics(const InvocationMetrics &)=default
Copy constructor.
InvocationMetrics() 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::int32_t &, const std::int32_t &, const ::IceMX::MetricsMap &, const ::IceMX::MetricsMap & > ice_tuple() const
Creates a tuple with all the fields of this class.
Definition Metrics.h:816
::IceMX::MetricsMap remotes
The remote invocation metrics map.
Definition Metrics.h:835
std::int32_t userException
The number of invocations that failed with a user exception.
Definition Metrics.h:831
const char * ice_id() const noexcept override
Gets the Slice type ID of the most-derived class supported by this object.
InvocationMetricsPtr ice_clone() const
Creates a shallow polymorphic copy of this instance.
Definition Metrics.h:823
void ice_printFields(std::ostream &os) const override
Outputs the name and value of each field of this instance, including inherited fields,...
static const char * ice_staticId() noexcept
Gets the type ID of the associated Slice class.
Provides measurements for proxy invocations.
Definition Metrics.h:784
std::function< void()> enableMetricsViewAsync(std::string_view name, std::function< void()> response, std::function< void(std::exception_ptr)> exception=nullptr, std::function< void(bool)> sent=nullptr, const Ice::Context &context=Ice::noExplicitContext) const
Enables a metrics view.
std::function< void()> getMetricsViewNamesAsync(std::function< void(::Ice::StringSeq, ::Ice::StringSeq)> response, std::function< void(std::exception_ptr)> exception=nullptr, std::function< void(bool)> sent=nullptr, const Ice::Context &context=Ice::noExplicitContext) const
Gets the names of the enabled and disabled metrics views.
MetricsAdminPrx(MetricsAdminPrx &&other) noexcept
Move constructor.
Definition Metrics.h:105
std::future< void > enableMetricsViewAsync(std::string_view name, const Ice::Context &context=Ice::noExplicitContext) const
Enables a metrics view.
void enableMetricsView(std::string_view name, const Ice::Context &context=Ice::noExplicitContext) const
Enables a metrics view.
MetricsAdminPrx(const MetricsAdminPrx &other) noexcept
Copy constructor.
Definition Metrics.h:101
static const char * ice_staticId() noexcept
Gets the type ID of the associated Slice interface.
MetricsFailures getMetricsFailures(std::string_view view, std::string_view map, std::string_view id, const Ice::Context &context=Ice::noExplicitContext) const
Gets the metrics failures associated with the given metrics.
std::function< void()> getMapMetricsFailuresAsync(std::string_view view, std::string_view map, std::function< void(::IceMX::MetricsFailuresSeq)> response, std::function< void(std::exception_ptr)> exception=nullptr, std::function< void(bool)> sent=nullptr, const Ice::Context &context=Ice::noExplicitContext) const
Gets the metrics failures associated with the given view and map.
MetricsAdminPrx & operator=(const MetricsAdminPrx &rhs) noexcept
Copy assignment operator.
Definition Metrics.h:112
std::future< std::tuple<::Ice::StringSeq, ::Ice::StringSeq > > getMetricsViewNamesAsync(const Ice::Context &context=Ice::noExplicitContext) const
Gets the names of the enabled and disabled metrics views.
MetricsAdminPrx(const Ice::CommunicatorPtr &communicator, std::string_view proxyString)
Constructs a proxy from a Communicator and a proxy string.
Definition Metrics.h:97
std::function< void()> getMetricsFailuresAsync(std::string_view view, std::string_view map, std::string_view id, std::function< void(::IceMX::MetricsFailures)> response, std::function< void(std::exception_ptr)> exception=nullptr, std::function< void(bool)> sent=nullptr, const Ice::Context &context=Ice::noExplicitContext) const
Gets the metrics failures associated with the given metrics.
std::future< MetricsFailuresSeq > getMapMetricsFailuresAsync(std::string_view view, std::string_view map, const Ice::Context &context=Ice::noExplicitContext) const
Gets the metrics failures associated with the given view and map.
MetricsView getMetricsView(std::string_view view, std::int64_t &timestamp, const Ice::Context &context=Ice::noExplicitContext) const
Gets the metrics objects for the given metrics view.
MetricsFailuresSeq getMapMetricsFailures(std::string_view view, std::string_view map, const Ice::Context &context=Ice::noExplicitContext) const
Gets the metrics failures associated with the given view and map.
MetricsAdminPrx & operator=(MetricsAdminPrx &&rhs) noexcept
Move assignment operator.
Definition Metrics.h:123
std::future< MetricsFailures > getMetricsFailuresAsync(std::string_view view, std::string_view map, std::string_view id, const Ice::Context &context=Ice::noExplicitContext) const
Gets the metrics failures associated with the given metrics.
std::future< void > disableMetricsViewAsync(std::string_view name, const Ice::Context &context=Ice::noExplicitContext) const
Disables a metrics view.
std::function< void()> disableMetricsViewAsync(std::string_view name, std::function< void()> response, std::function< void(std::exception_ptr)> exception=nullptr, std::function< void(bool)> sent=nullptr, const Ice::Context &context=Ice::noExplicitContext) const
Disables a metrics view.
std::function< void()> getMetricsViewAsync(std::string_view view, std::function< void(::IceMX::MetricsView, std::int64_t)> response, std::function< void(std::exception_ptr)> exception=nullptr, std::function< void(bool)> sent=nullptr, const Ice::Context &context=Ice::noExplicitContext) const
Gets the metrics objects for the given metrics view.
::Ice::StringSeq getMetricsViewNames(::Ice::StringSeq &disabledViews, const Ice::Context &context=Ice::noExplicitContext) const
Gets the names of the enabled and disabled metrics views.
void disableMetricsView(std::string_view name, const Ice::Context &context=Ice::noExplicitContext) const
Disables a metrics view.
std::future< std::tuple< MetricsView, std::int64_t > > getMetricsViewAsync(std::string_view view, const Ice::Context &context=Ice::noExplicitContext) const
Gets the metrics objects for the given metrics view.
The metrics administrative facet interface.
Definition Metrics.h:92
Metrics() noexcept=default
Default constructor.
std::int32_t current
The number of objects currently observed by this metrics.
Definition Metrics.h:437
std::tuple< const std::string &, const std::int64_t &, const std::int32_t &, const std::int64_t &, const std::int32_t & > ice_tuple() const
Creates a tuple with all the fields of this class.
Definition Metrics.h:418
void ice_printFields(std::ostream &os) const override
Outputs the name and value of each field of this instance, including inherited fields,...
Metrics(const Metrics &)=default
Copy constructor.
MetricsPtr ice_clone() const
Creates a shallow polymorphic copy of this instance.
Definition Metrics.h:425
static const char * ice_staticId() noexcept
Gets the type ID of the associated Slice class.
std::string id
The metrics identifier.
Definition Metrics.h:430
std::int64_t totalLifetime
The sum of the lifetimes of each observed object.
Definition Metrics.h:441
const char * ice_id() const noexcept override
Gets the Slice type ID of the most-derived class supported by this object.
std::int32_t failures
The number of failures observed.
Definition Metrics.h:444
std::int64_t total
The total number of objects observed by this metrics.
Definition Metrics.h:434
The base class for metrics.
Definition Metrics.h:390
const char * ice_id() const noexcept override
Gets the Slice type ID of the most-derived class supported by this object.
RemoteMetricsPtr ice_clone() const
Creates a shallow polymorphic copy of this instance.
Definition Metrics.h:763
RemoteMetrics(const RemoteMetrics &)=default
Copy constructor.
ChildInvocationMetrics() noexcept=default
Default constructor.
static const char * ice_staticId() noexcept
Gets the type ID of the associated Slice class.
Provides information on invocations that are specifically sent over Ice connections.
Definition Metrics.h:752
ThreadMetrics() noexcept=default
Default constructor.
std::int32_t inUseForOther
The number of threads which are currently performing other activities such as DNS lookups,...
Definition Metrics.h:565
std::int32_t inUseForUser
The number of threads which are currently calling user code (servant dispatch, AMI callbacks,...
Definition Metrics.h:560
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::int32_t & > ice_tuple() const
Creates a tuple with all the fields of this class.
Definition Metrics.h:545
void ice_printFields(std::ostream &os) const override
Outputs the name and value of each field of this instance, including inherited fields,...
const char * ice_id() const noexcept override
Gets the Slice type ID of the most-derived class supported by this object.
ThreadMetricsPtr ice_clone() const
Creates a shallow polymorphic copy of this instance.
Definition Metrics.h:552
static const char * ice_staticId() noexcept
Gets the type ID of the associated Slice class.
std::int32_t inUseForIO
The number of threads which are currently performing socket reads or writes.
Definition Metrics.h:557
ThreadMetrics(const ThreadMetrics &)=default
Copy constructor.
Provides information on the number of threads currently in use and their activity.
Definition Metrics.h:515
void ice_throw() const override
Throws this exception.
static const char * ice_staticId() noexcept
Gets the type ID of the associated Slice exception.
const char * ice_id() const noexcept override
Returns the type ID of this exception.
The exception that is thrown when a metrics view cannot be found.
Definition Metrics.h:493
Represents a request received by a connection.
Represents a byte buffer used for unmarshaling data encoded using the Slice encoding.
Definition InputStream.h:50
ObjectPrx & operator=(const ObjectPrx &rhs) noexcept=default
Copy assignment operator.
The base class for all Ice proxies.
Definition Proxy.h:265
The base class for servants.
Definition Object.h:21
Represents the response to an incoming request.
Represents a byte buffer used for marshaling data using the Slice encoding.
Provides typed proxy functions.
Definition Proxy.h:48
Abstract base class for all exceptions defined in Slice.
The base class for instances of Slice-defined classes.
Definition Value.h:22
std::map< std::string, std::int32_t > StringIntDict
A dictionary of strings to integers.
Definition Metrics.h:26
std::vector< MetricsPtr > MetricsMap
A sequence of metrics.
Definition Metrics.h:42
std::shared_ptr< Metrics > MetricsPtr
A shared pointer to a Metrics.
Definition Metrics.h:31
std::shared_ptr< RemoteMetrics > RemoteMetricsPtr
A shared pointer to a RemoteMetrics.
Definition Metrics.h:72
std::shared_ptr< MetricsAdmin > MetricsAdminPtr
A shared pointer to a MetricsAdmin.
Definition Metrics.h:1018
std::shared_ptr< AsyncMetricsAdmin > AsyncMetricsAdminPtr
A shared pointer to an AsyncMetricsAdmin.
Definition Metrics.h:1123
std::shared_ptr< DispatchMetrics > DispatchMetricsPtr
A shared pointer to a DispatchMetrics.
Definition Metrics.h:57
std::map< std::string, MetricsMap > MetricsView
A metrics view is a dictionary of metrics maps. The key of the dictionary is the name of the metrics ...
Definition Metrics.h:45
std::ostream & operator<<(std::ostream &os, const MetricsFailures &value)
Outputs the description of a MetricsFailures to a stream, including all its fields.
std::shared_ptr< ChildInvocationMetrics > ChildInvocationMetricsPtr
A shared pointer to a ChildInvocationMetrics.
Definition Metrics.h:62
std::shared_ptr< ConnectionMetrics > ConnectionMetricsPtr
A shared pointer to a ConnectionMetrics.
Definition Metrics.h:82
std::shared_ptr< InvocationMetrics > InvocationMetricsPtr
A shared pointer to an InvocationMetrics.
Definition Metrics.h:77
std::vector< MetricsFailures > MetricsFailuresSeq
A sequence of MetricsFailures.
Definition Metrics.h:36
std::shared_ptr< CollocatedMetrics > CollocatedMetricsPtr
A shared pointer to a CollocatedMetrics.
Definition Metrics.h:67
std::shared_ptr< ThreadMetrics > ThreadMetricsPtr
A shared pointer to a ThreadMetrics.
Definition Metrics.h:52
The Ice Management eXtension facility.
Definition Metrics.h:32
std::shared_ptr< Communicator > CommunicatorPtr
A shared pointer to a Communicator.
const Context noExplicitContext
Marker value used to indicate that no explicit request context was passed to a proxy invocation.
std::vector< std::string > StringSeq
A sequence of strings.
std::shared_ptr< Value > ValuePtr
A shared pointer to a Value.
Definition ValueF.h:13
std::map< std::string, std::string, std::less<> > Context
Represents additional information carried by an Ice request.
Definition Context.h:28
The Ice RPC framework.
Definition SampleEvent.h:60
std::string id
The identifier of the metrics object associated to the failures.
Definition Metrics.h:466
std::tuple< const std::string &, const ::IceMX::StringIntDict & > ice_tuple() const
Creates a tuple with all the fields of this struct.
Definition Metrics.h:473
::IceMX::StringIntDict failures
The failures observed for this metrics.
Definition Metrics.h:469
void ice_printFields(std::ostream &os) const
Outputs the name and value of each field of this instance to the stream.
Keeps track of metrics failures.
Definition Metrics.h:464
Provides information about an incoming request being dispatched.
Definition Current.h:18