Search in sources :

Example 1 with SearchDecorationStats

use of org.graylog2.rest.resources.search.responses.SearchDecorationStats in project graylog2-server by Graylog2.

the class DecoratorProcessorImpl method getSearchDecoratorStats.

private SearchDecorationStats getSearchDecoratorStats(List<ResultMessageSummary> decoratedMessages) {
    final Set<String> addedFields = new HashSet<>();
    final Set<String> changedFields = new HashSet<>();
    final Set<String> removedFields = new HashSet<>();
    decoratedMessages.forEach(message -> {
        final DecorationStats decorationStats = message.decorationStats();
        if (decorationStats != null) {
            addedFields.addAll(decorationStats.addedFields().keySet());
            changedFields.addAll(decorationStats.changedFields().keySet());
            removedFields.addAll(decorationStats.removedFields().keySet());
        }
    });
    return SearchDecorationStats.create(addedFields, changedFields, removedFields);
}
Also used : SearchDecorationStats(org.graylog2.rest.resources.search.responses.SearchDecorationStats) DecorationStats(org.graylog2.rest.models.messages.responses.DecorationStats) HashSet(java.util.HashSet)

Aggregations

HashSet (java.util.HashSet)1 DecorationStats (org.graylog2.rest.models.messages.responses.DecorationStats)1 SearchDecorationStats (org.graylog2.rest.resources.search.responses.SearchDecorationStats)1