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.

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.

// 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
}

Last update: April 2, 2024

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