Specifications

The Management Interface CHAPTER 8 163
The Query Object
In both the explicit and implicit development models, you create a query object. With that
object instantiated, you can use the Start() and Stop() methods. The Start() method instanti-
ates the adapters using the adapter factories, starts the event processing engine, and calls the
Start() methods for each adapter. The Stop() method sends a message to the adapters that
the query is stopping and then shuts down the query. Your application must include the fol-
lowing code to start and stop the query object:
query.Start();
// wait for signal to complete the query
query.Stop();
The Management Interface
StreamInsight includes the ManagementService API, which you can use to create diagnostic
views for monitoring the CEP server’s resources and the queries running on the server. An-
other option is to use Windows PowerShell to access diagnostic information.
Diagnostic Views
Your diagnostic application can retrieve static information, such as object property values,
and statistical information, such as a cumulative event count after a particular point in time or
an aggregate count of events from child objects. Objects include the server, input and output
adapters, query operators, schedulers, and event streams. You can retrieve the desired infor-
mation by using the GetDiagnosticView() method and passing the object’s URI as a method
argument.
If you are monitoring queries, you should understand the transition points at which the
server records metrics about events in a stream. The name of a query metric identies the
transition point to which the metric applies. For example, Total Outgoing Event Count pro-
vides the total number of events that the output adapter has dequeued from the engine. The
following four transition points relate to query metrics:
Incoming The event arrival at the input adapter
Consumed The point at which the input adapter enqueues the event into the engine
Produced The point at which the event leaves the last query operator in the engine
Outgoing The event departure from the output adapter