Skip to content

Event Analytics Client for Java

Introduction

The Event Analytics Java client allows you to analyze 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. Refer to 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

This method finds the N most frequently occurring events and returns them sorted by the number of occurrences in descending order.

 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.