TimeMachine timeMachine = new TimeMachine() timeMachine.clock = Clock.fixed(Instant.parse("2010-01-01T${time}Z"), UTC) def result = timeMachine.isInInterval() assert result == expected
public int getColumnIndex(String metricKey) { TimeMachineColumn col = getColumn(metricKey); return col!=null ? col.getIndex() : -1; } }
@Override protected TimeMachine parse(Object json) { WSUtils utils = WSUtils.getINSTANCE(); Object cols = utils.getField(json, "cols"); if (cols == null) { throw new IllegalArgumentException("cols must be set"); } Object cells = utils.getField(json, "cells"); if (cells == null) { throw new IllegalArgumentException("cells must be set"); } return new TimeMachine(toColumns(cols), toCells(cells)); }