use of com.efficios.jabberwocky.views.timegraph.model.render.StateDefinition in project lttng-scope by lttng.
the class StubModelStateProvider method getStateRender.
@Override
public TimeGraphStateRender getStateRender(TimeGraphTreeElement treeElement, TimeRange timeRange, long resolution, @Nullable FutureTask<?> task) {
if (treeElement == StubModelProvider.ROOT_ELEMENT) {
return TimeGraphStateRender.EMPTY_RENDER;
}
int entryIndex = Integer.valueOf(treeElement.getName().substring(StubModelProvider.ENTRY_NAME_PREFIX.length()));
long stateLength = entryIndex * DURATION_FACTOR;
List<TimeGraphStateInterval> intervals = LongStream.iterate(timeRange.getStartTime(), i -> i + stateLength).limit((timeRange.getDuration() / stateLength) + 1).mapToObj(startTime -> {
long endTime = startTime + stateLength - 1;
StateDefinition stateDef = getNextStateDef();
return new BasicTimeGraphStateInterval(startTime, endTime, treeElement, stateDef, stateDef.getName(), Collections.emptyMap());
}).collect(Collectors.toList());
return new TimeGraphStateRender(timeRange, treeElement, intervals);
}
Aggregations