Ice 3.8
Slice API Reference
Loading...
Searching...
No Matches
Metrics.ice
1// Copyright (c) ZeroC, Inc.
2
3#pragma once
4
5[["cpp:dll-export:ICE_API"]]
6[["cpp:doxygen:include:Ice/Ice.h"]]
7[["cpp:header-ext:h"]]
8
9[["js:module:@zeroc/ice"]]
10
11#include "BuiltinSequences.ice"
12
13/// The Ice Management eXtension facility.
14["java:identifier:com.zeroc.IceMX"]
15["swift:identifier:Ice"]
16module IceMX
17{
18 /// A dictionary of strings to integers.
19 dictionary<string, int> StringIntDict;
20
21 /// The base class for metrics. A metrics object represents a collection of measurements associated to a given a
22 /// system.
23 class Metrics
24 {
25 /// The metrics identifier.
26 string id;
27
28 /// The total number of objects observed by this metrics. This includes the number of currently observed objects
29 /// and the number of objects observed in the past.
30 long total = 0;
31
32 /// The number of objects currently observed by this metrics.
33 int current = 0;
34
35 /// The sum of the lifetime of each observed objects. This does not include the lifetime of objects which are
36 /// currently observed, only the objects observed in the past.
37 long totalLifetime = 0;
38
39 /// The number of failures observed.
40 int failures = 0;
41 }
42
43 /// Keeps track of metrics failures.
45 {
46 /// The identifier of the metrics object associated to the failures.
47 string id;
48
49 /// The failures observed for this metrics.
51 }
52
53 /// A sequence of {@link MetricsFailures}.
54 sequence<MetricsFailures> MetricsFailuresSeq;
55
56 /// A sequence of metrics.
57 /// @remark We use a sequence here instead of a map because the ID of the metrics is already included in the Metrics
58 /// class and using sequences of metrics objects is more efficient than using dictionaries since lookups are not
59 /// necessary.
60 sequence<Metrics> MetricsMap;
61
62 /// A metrics view is a dictionary of metrics maps. The key of the dictionary is the name of the metrics map.
63 dictionary<string, MetricsMap> MetricsView;
64
65 /// The exception that is thrown when a metrics view cannot be found.
67 {
68 }
69
70 /// The metrics administrative facet interface. This interface allows remote administrative clients to access the
71 /// metrics of an application that enabled the Ice administrative facility and configured one or more metrics views.
72 interface MetricsAdmin
73 {
74 /// Gets the names of enabled and disabled metrics.
75 /// @param disabledViews The names of the disabled views.
76 /// @return The names of the enabled views.
78
79 /// Enables a metrics view.
80 /// @param name The metrics view name.
81 /// @throws UnknownMetricsView Thrown when the metrics view cannot be found.
82 void enableMetricsView(string name)
83 throws UnknownMetricsView;
84
85 /// Disables a metrics view.
86 /// @param name The metrics view name.
87 /// @throws UnknownMetricsView Thrown when the metrics view cannot be found.
88 void disableMetricsView(string name)
89 throws UnknownMetricsView;
90
91 /// Gets the metrics objects for the given metrics view.
92 /// @param view The name of the metrics view.
93 /// @param timestamp The local time of the process when the metrics objects were retrieved.
94 /// @return The metrics view data, a dictionary of metric maps for each metrics class configured with the view.
95 /// The @p timestamp allows the client to compute averages which are not dependent of the invocation latency for
96 /// this operation.
97 /// @throws UnknownMetricsView Thrown when the metrics view cannot be found.
98 ["format:sliced"]
99 MetricsView getMetricsView(string view, out long timestamp)
100 throws UnknownMetricsView;
101
102 /// Gets the metrics failures associated with the given @p view and @p map.
103 /// @param view The name of the metrics view.
104 /// @param map The name of the metrics map.
105 /// @return The metrics failures associated with the map.
106 /// @throws UnknownMetricsView Thrown when the metrics view cannot be found.
108 throws UnknownMetricsView;
109
110 /// Gets the metrics failure associated for the given metrics.
111 /// @param view The name of the metrics view.
112 /// @param map The name of the metrics map.
113 /// @param id The ID of the metrics.
114 /// @return The metrics failures associated with the metrics.
115 /// @throws UnknownMetricsView Thrown when the metrics view cannot be found.
116 MetricsFailures getMetricsFailures(string view, string map, string id)
117 throws UnknownMetricsView;
118 }
119
120 /// Provides information on the number of threads currently in use and their activity.
121 class ThreadMetrics extends Metrics
122 {
123 /// The number of threads which are currently performing socket reads or writes.
124 int inUseForIO = 0;
125
126 /// The number of threads which are currently calling user code (servant dispatch, AMI callbacks, etc).
128
129 /// The number of threads which are currently performing other activities such as DNS lookups, garbage
130 /// collection, etc. These are all the other threads created by the Ice runtime that are not counted in
131 /// {@link #inUseForUser} or {@link #inUseForIO}.
133 }
134
135 /// Provides information on servant dispatches.
137 {
138 /// The number of dispatches that failed with a user exception.
140
141 /// The size of the incoming requests. This corresponds to the size of the marshaled input parameters.
142 long size = 0;
143
144 /// The size of the replies. This corresponds to the size of the marshaled output and return parameters.
145 long replySize = 0;
146 }
147
148 /// Provides information on child invocations. A child invocation is either remote (sent over an Ice connection) or
149 /// collocated. An invocation can have multiple child invocations if it is retried. Child invocation metrics are
150 /// embedded within {@link InvocationMetrics}.
152 {
153 /// The size of the invocation. This corresponds to the size of the marshaled input parameters.
154 long size = 0;
155
156 /// The size of the invocation reply. This corresponds to the size of the marshaled output and return
157 /// parameters.
158 long replySize = 0;
159 }
160
161 /// Provides information on invocations that are collocated. Collocated metrics are embedded within
162 /// {@link InvocationMetrics}.
164 {
165 }
166
167 /// Provides information on invocations that are specifically sent over Ice connections. Remote metrics are embedded
168 /// within {@link InvocationMetrics}.
170 {
171 }
172
173 /// Provide measurements for proxy invocations. Proxy invocations can either be sent over the wire or be collocated.
175 {
176 /// The number of retries for the invocations.
177 ["ruby:identifier:retryCount"]
178 int retry = 0;
179
180 /// The number of invocations that failed with a user exception.
182
183 /// The remote invocation metrics map.
184 /// @see RemoteMetrics
186
187 /// The collocated invocation metrics map.
188 /// @see CollocatedMetrics
190 }
191
192 /// Provides information on the data sent and received over Ice connections.
194 {
195 /// The number of bytes received by the connection.
197
198 /// The number of bytes sent by the connection.
199 long sentBytes = 0;
200 }
201}
long size
The size of the invocation. This corresponds to the size of the marshaled input parameters.
Definition Metrics.ice:154
long replySize
The size of the invocation reply.
Definition Metrics.ice:158
Provides information on child invocations.
Definition Metrics.ice:152
Provides information on invocations that are collocated.
Definition Metrics.ice:164
long receivedBytes
The number of bytes received by the connection.
Definition Metrics.ice:196
long sentBytes
The number of bytes sent by the connection.
Definition Metrics.ice:199
Provides information on the data sent and received over Ice connections.
Definition Metrics.ice:194
long size
The size of the incoming requests. This corresponds to the size of the marshaled input parameters.
Definition Metrics.ice:142
long replySize
The size of the replies. This corresponds to the size of the marshaled output and return parameters.
Definition Metrics.ice:145
int userException
The number of dispatches that failed with a user exception.
Definition Metrics.ice:139
Provides information on servant dispatches.
Definition Metrics.ice:137
MetricsMap remotes
The remote invocation metrics map.
Definition Metrics.ice:185
int retry
The number of retries for the invocations.
Definition Metrics.ice:178
MetricsMap collocated
The collocated invocation metrics map.
Definition Metrics.ice:189
int userException
The number of invocations that failed with a user exception.
Definition Metrics.ice:181
Provide measurements for proxy invocations. Proxy invocations can either be sent over the wire or be ...
Definition Metrics.ice:175
long total
The total number of objects observed by this metrics.
Definition Metrics.ice:30
int failures
The number of failures observed.
Definition Metrics.ice:40
int current
The number of objects currently observed by this metrics.
Definition Metrics.ice:33
long totalLifetime
The sum of the lifetime of each observed objects.
Definition Metrics.ice:37
string id
The metrics identifier.
Definition Metrics.ice:26
The base class for metrics.
Definition Metrics.ice:24
Provides information on invocations that are specifically sent over Ice connections.
Definition Metrics.ice:170
int inUseForUser
The number of threads which are currently calling user code (servant dispatch, AMI callbacks,...
Definition Metrics.ice:127
int inUseForOther
The number of threads which are currently performing other activities such as DNS lookups,...
Definition Metrics.ice:132
int inUseForIO
The number of threads which are currently performing socket reads or writes.
Definition Metrics.ice:124
Provides information on the number of threads currently in use and their activity.
Definition Metrics.ice:122
The exception that is thrown when a metrics view cannot be found.
Definition Metrics.ice:67
void enableMetricsView(string name)
Enables a metrics view.
MetricsFailuresSeq getMapMetricsFailures(string view, string map)
Gets the metrics failures associated with the given view and map.
MetricsView getMetricsView(string view, out long timestamp)
Gets the metrics objects for the given metrics view.
void disableMetricsView(string name)
Disables a metrics view.
Ice::StringSeq getMetricsViewNames(out Ice::StringSeq disabledViews)
Gets the names of enabled and disabled metrics.
MetricsFailures getMetricsFailures(string view, string map, string id)
Gets the metrics failure associated for the given metrics.
The metrics administrative facet interface.
Definition Metrics.ice:73
dictionary< 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.ice:63
sequence< Metrics > MetricsMap
A sequence of metrics.
Definition Metrics.ice:60
dictionary< string, int > StringIntDict
A dictionary of strings to integers.
Definition Metrics.ice:19
sequence< MetricsFailures > MetricsFailuresSeq
A sequence of MetricsFailures.
Definition Metrics.ice:54
The Ice Management eXtension facility.
Definition Metrics.ice:18
sequence< string > StringSeq
A sequence of strings.
string id
The identifier of the metrics object associated to the failures.
Definition Metrics.ice:47
StringIntDict failures
The failures observed for this metrics.
Definition Metrics.ice:50
Keeps track of metrics failures.
Definition Metrics.ice:45