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