summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/orbsvcs/Metrics.idl
blob: 00e87c7f87a823994fe075826cf6d2b7c5555a2d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
// $Id$

#ifndef METRICS_IDL
#define METRICS_IDL

#include "TimeBase.idl"
#include "RtecScheduler.idl"
#pragma prefix ""

module Metrics
{
  // Types

  enum TIMEPROBE_EVENT_TYPE
  {
    WORK_START,
    WORK_STOP,
    WORK_SUSPEND,
    WORK_RESUME
  };

  typedef TIMEPROBE_EVENT_TYPE TIMEPROBE_EVENT_TYPE_t;

  typedef TimeBase::TimeT Time;  // time type
  typedef sequence<RtecScheduler::handle_t> Handle_Set_t;  // handle sequence

  struct QoSParameter_t
    // = TITLE
    //   Describes the monitored QoS for an "RT_Operation".
    //
    // = DESCRIPTION
    //   The deadline success and failure counts for an operation.
  {
    RtecScheduler::handle_t handle;
    // The handle of the operation for which the information is stored

    string entry_point;
    // The name of the operation for which the information is stored

    unsigned long deadlines_made;
    // The number of deadlines successfully met.

    unsigned long deadlines_missed;
    // The number of deadlines missed.

    unsigned long operations_cancelled;
    // The number of operations cancelled.

    short is_hrt;
    // Indicates whether or not the operation is hard real-time.
  };

  typedef sequence<QoSParameter_t> QoSParameter_Set;


  struct QoSData
    // = TITLE
    //   Describes the monitored QoS for the visualization browser.
    //
    // = DESCRIPTION
    //   Aggregate success, failure, and cancellation counts the operations.
  {
    long hrt_deadlines_made;
    // The number of hard real-time deadlines successfully met.

    long hrt_deadlines_missed;
    // The number of hard real-time deadlines missed.

    long hrt_operations_cancelled;
    // The number of hard real-time operations that were cancelled.

    long srt_deadlines_made;
    // The number of soft real-time deadlines successfully met.

    long srt_deadlines_missed;
    // The number of soft real-time deadlines missed.

    long srt_operations_cancelled;
    // The number of soft real-time operations that were cancelled.
  };

  struct UtilData
    // = TITLE
    //   Describes the monitored QoS for the visualization browser.
    //
    // = DESCRIPTION
    //   Aggregate success, failure, and cancellation counts the operations.
  {
    double hrt_op_utilization;
    // The percentage of the time spent in hard real-time operations.

    double srt_op_utilization;
    // The percentage of the time spent in soft real-time operations.

    double queue_utilization;
    // The percentage of the time spent managing queues.
  };

  struct ProbeIdentity_t
    // = TITLE
    //   Describes the identity of a timeprobe.
    //
    // = DESCRIPTION
    //   The name and identifier for a timeprobe.
  {
    unsigned long probe_id;
    // The unique identifier for the timeprobe.

    string probe_name;
    // The name of the timeprobe.
  };

  typedef sequence<ProbeIdentity_t> ProbeIdentity_Set;

  struct TimeprobeParameter_t
    // = TITLE
    //   Describes the monitored data for a timeprobe.
    //
    // = DESCRIPTION
    //   The duration of an interval for a timeprobe.
  {
    unsigned long probe_id;
    // The name of the timeprobe that collected the data.

    short is_operation;
    // Indicates whether or not the data are for an operation.

    short is_hrt;
    // Indicates whether or not an operation is hard real-time.

    short is_full_interval;
    // Indicates whether or not the time reported is for the entire
    // interval measured by the time probe.

    short cross_thread_probe;
    // Indicates whether or not the time reported is for the entire
    // interval measured by the time probe.

    Time start_event_time;
    // The start of the event for sorting purposes.

    Time stop_event_time;
    // The start of the event for sorting purposes.

    Time interval;
    // The elapsed time within the timeprobe.
  };

  typedef sequence<TimeprobeParameter_t> TimeprobeParameter_Set;


  // Exceptions

  exception SYNCHRONIZATION {};
  // A synchronization error occurred in a method.

  exception INTERNAL {};
  // An error occurred in an internal data structure.

  exception INTERNAL_0 {};
  exception INTERNAL_1 {};
  exception INTERNAL_2 {};
  exception INTERNAL_3 {};
  exception INTERNAL_4 {};
  exception INTERNAL_5 {};
  exception INTERNAL_6 {};
  exception INTERNAL_7 {};
  exception INTERNAL_8 {};
  // These are to track down an infrequently reproducible
  // error, and should be removed eventually.

  exception NIL_LOGGER {};
  // An operation was passed a nil logger pointer.

  // Interfaces

  interface QoSLogger
    // = TITLE
    //   This interface provides access to a QoS logger.
    //
    // = DESCRIPTION
    //   This interface allows clients log monitored QoS information.
  {
    oneway void send_banner (in string banner);
    // Sends a banner to the  logger, which is recorded in the
    // output log and communicated to the visualization browser.

    oneway void log_aggregate_QoS (in Metrics::QoSParameter_Set qos_set,
                                   in Time interval);
    // Reports the aggregate QoS information for all operations
    // to the passed QoS logger.

    oneway void set_identities (in Metrics::ProbeIdentity_Set identity_set);
    // Binds the names of various timeprobes to their identifiers so 
    // that ids alone can be used (for efficiency) in passing data.

    oneway void set_identity (in Metrics::ProbeIdentity_t identity);
    // Binds the names of various timeprobes to their identifiers so 
    // that ids alone can be used (for efficiency) in passing data.

    oneway void log_timeprobe_data (in Metrics::TimeprobeParameter_Set data_set,
                                    in Time interval);
    // Reports timeprobe data collected since last run.
  };


  interface QoSMonitor
    // = TITLE
    //   This interface provides access to a QoS data monitor.
    //
    // = DESCRIPTION
    //   This interface allows objects to store and query monitored
    //   QoS information.
  {
    void report_made_deadline (in RtecScheduler::handle_t handle)
      raises (INTERNAL_0);
    // Report a successful upcall.

    void report_missed_deadline (in RtecScheduler::handle_t handle)
      raises (INTERNAL_1);
    // Report an unsuccessful upcall.

    void reset_statistics (in RtecScheduler::handle_t handle)
      raises (INTERNAL_7, INTERNAL_8);
    // Resets the aggregate QoS information for the given
    // operation handle.

    void get_aggregate_QoS (in RtecScheduler::handle_t handle,
                            out Metrics::QoSParameter_t qos)
      raises (INTERNAL_2, INTERNAL_3);
    // Retrieves the aggregate QoS information for the given
    // operation handle.

    void get_aggregate_QoS_set (in Metrics::Handle_Set_t handle_set,
                                out Metrics::QoSParameter_Set qos_set)
      raises (INTERNAL_4, INTERNAL_5);
    // Retrieves the aggregate QoS information for all operations
    // in the passed handle set.
  };


  interface ReportingQoSMonitor : QoSMonitor
    // = TITLE
    //   This interface provides access to a QoS data monitor.
    //
    // = DESCRIPTION
    //   This interface allows objects to report monitored
    //   QoS information to a QoS logger.
  {
    void report_aggregate_QoS (in Metrics::QoSLogger logger,
                               in Metrics::Time interval)
      raises (NIL_LOGGER, INTERNAL_6);
    // Reports the aggregate QoS information for all operations
    // to the passed QoS logger.
  };

  interface FrameManager
    // = TITLE
    //   This interface provides access to a QoS data monitor.
    //
    // = DESCRIPTION
    //   This interface allows objects to query or report monitored
    //   QoS information that was collected by QoS monitoring adapters.
  {
    short register_period (in RtecScheduler::Period_t p)
      raises (INTERNAL, SYNCHRONIZATION);
    // Binds the period to the internal frame map, with a new frame data
    // structure.  Returns 0 if a new entry is bound successfully,
    // returns 1 if an attempt is made to bind an existing entry, and
    // returns -1 if failures occur.

    short update_all_frames_with_time (in Time tv)
      raises (SYNCHRONIZATION);
    // Updates time frames, based on the passed time value.

    short update_all_frames ()
      raises (SYNCHRONIZATION);
    // Updates time frames, based on the current time as of the call.

    short update_frame_with_time (in RtecScheduler::Period_t p, in Time tv)
      raises (INTERNAL, SYNCHRONIZATION);
    // Updates the passed period's time frame, based on the passed time
    // value.

    short update_frame (in RtecScheduler::Period_t p)
      raises (INTERNAL, SYNCHRONIZATION);
    // Updates the passed period's time frame, based on the current time
    // as of the call.

    short reset_all_frames_with_time (in Time tv)
      raises (SYNCHRONIZATION);
    // Resets time frames, based on the passed time value.

    short reset_all_frames ()
      raises (SYNCHRONIZATION);
    // Resets time frames, based on the current time as of the call.

    short reset_frame_with_time (in RtecScheduler::Period_t p, in Time tv)
      raises (INTERNAL, SYNCHRONIZATION);
    // Resets the passed period's start-of-frame, based on the passed time
    // value.

    short reset_frame (in RtecScheduler::Period_t p)
      raises (INTERNAL, SYNCHRONIZATION);
    // Resets the passed period's start-of-frame, based on the current time
    // as of the call.

    short get_start_time (in RtecScheduler::Period_t p, out Time start)
      raises (INTERNAL, SYNCHRONIZATION);
    // Gets the start time for the period's current frame.

    short get_end_time (in RtecScheduler::Period_t p, out Time end)
      raises (INTERNAL, SYNCHRONIZATION);
    // Gets the end time for the period's current frame.

    short get_frame_id (in RtecScheduler::Period_t p, out unsigned long id)
      raises (INTERNAL, SYNCHRONIZATION);
    // Gets the locally unique identifier for the period's current frame.

    short get_frame_data (in RtecScheduler::Period_t p, out Time start,
                          out Time end, out unsigned long id)
      raises (INTERNAL, SYNCHRONIZATION);
    // Gets the start time, end time, and id for the period's current frame.
  };

};

#endif /* METRICS_IDL */