use of co.elastic.clients.elasticsearch._types.aggregations.StringTermsBucket in project core-ng-project by neowu.
the class ArchDiagram method load.
private void load(String app, List<StringTermsBucket> actions) {
if (excludeApps.contains(app))
return;
for (StringTermsBucket actionBucket : actions) {
String action = actionBucket.key();
long totalCount = actionBucket.docCount();
List<StringTermsBucket> clients = actionBucket.aggregations().get("client").sterms().buckets().array();
for (StringTermsBucket clientBucket : clients) {
String client = clientBucket.key();
long count = clientBucket.docCount();
loadAction(app, action, client, count);
}
long totalByClient = clients.stream().mapToLong(StringTermsBucket::docCount).sum();
if (totalCount > totalByClient) {
loadAction(app, action, "_direct_" + app, totalCount - totalByClient);
}
}
}
Aggregations