Skip to content

Event Analytics Client for Java

Introduction

The Event Analytics Service is used for analyzing the event data. In addition to the identification of significant dependencies, statistical analysis also helps the user to get a better understanding of the system's internal processes.

See Event Analytics for more information about the service.

Event Analytics Operations

The Event Analytics statistically analyzes the event data to identify the most frequent events.

Client name: EventAnalyticsClient

Find Top Events

Find the most frequent events in the provided dataset. The events are sorted in descending order by the number of appearances in the dataset.

 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
// Creating the Event Analytics Input Metadata object
EventAnalyticsRequestMetadata inputMetadata = new EventAnalyticsRequestMetadata();
inputMetadata.setEventTextPropertyName("text");

// Creating a list of events to be analytically
Event firstEvent = new Event();
firstEvent.setText("INTRODUCING FUEL");
firstEvent.setTextQc(0);
firstEvent.setTime("2017-10-01T12:00:00.001Z");

Event secondEvent = new Event();
secondEvent.setText("Status@Flame On");
secondEvent.setTextQc(0);
secondEvent.setTime("2017-10-01T12:02:01.001Z");

List<Event> eventsList = new ArrayList<>();
eventsList.add(firstEvent);
eventsList.add(secondEvent);

// Creating the Event Analytics Input object that will be analyzed
EventAnalyticsRequest eventAnalyticsRequest = new EventAnalyticsRequest();
eventAnalyticsRequest.setNumberOfTopPositionsRequired(5);
eventAnalyticsRequest.setEventsMetadata(inputMetadata);
eventAnalyticsRequest.setEvents(eventsList);

List<EventAnalyticsResponse> eventAnalyticsResponse = null;
try {
    eventAnalyticsResponse = eventAnalyticsClient.findTopEvents(eventAnalyticsRequest);
} catch (MindsphereException e) {
    // Exception handling
}

Any questions left?

Ask the community


Except where otherwise noted, content on this site is licensed under the MindSphere Development License Agreement.