use of fish.payara.monitoring.adapt.GroupData in project Payara by payara.
the class MonitoringConsoleRuntimeImpl method selectAll.
@Override
public Collection<GroupData> selectAll(String source, String group) {
if (!"requesttracing".equals(source)) {
return emptyList();
}
List<GroupData> matches = new ArrayList<>();
for (RequestTrace trace : requestTracingService.getRequestTraceStore().getTraces()) {
if (RequestTracingService.metricGroupName(trace).equals(group)) {
GroupData data = new GroupData();
data.addField("id", trace.getTraceId()).addField("startTime", trace.getStartTime().toEpochMilli()).addField("endTime", trace.getEndTime().toEpochMilli()).addField("elapsedTime", trace.getElapsedTime());
for (RequestTraceSpan span : trace.getTraceSpans()) {
GroupData tags = data.addChild(span.getId().toString()).addField("id", span.getId()).addField("operation", RequestTracingService.stripPackageName(span.getEventName())).addField("startTime", span.getTimeOccured()).addField("endTime", span.getTraceEndTime().toEpochMilli()).addField("duration", span.getSpanDuration()).addChild("tags");
for (Entry<Object, String> tag : span.getSpanTags().entrySet()) {
if (tag.getKey() instanceof Tag) {
tags.addField(((Tag) tag.getKey()).getKey(), tag.getValue());
} else {
tags.addField(tag.getKey().toString(), tag.getValue());
}
}
}
matches.add(data);
}
}
return matches;
}
Aggregations