@Override public Map<String, List<String>> getExtraDimensions(String project) { Map<String, List<String>> builder = new HashMap<>(); for (TimestampTransformation transformation : timestampMapping.keySet()) { builder.computeIfAbsent(transformation.getCategory(), k -> new ArrayList<>()) .add(transformation.getPrettyName()); } return builder; }
public static Optional<TimestampTransformation> fromPrettyName(String name) { for (TimestampTransformation transformation : values()) { if (transformation.getPrettyName().equals(name)) { return Optional.of(transformation); } } return Optional.empty(); }
QueryResult test = getEventExplorer().analyze(new RequestContext(PROJECT_NAME, null), of("test"), new EventExplorer.Measure("teststr", AggregationType.APPROXIMATE_UNIQUE), new EventExplorer.Reference(EventExplorer.ReferenceType.REFERENCE, trans.get().getPrettyName()), null, null, LocalDate.ofEpochDay(0), LocalDate.ofEpochDay(SCALE_FACTOR), ZoneOffset.UTC).getResult().join();
@Override public Map<String, List<String>> getExtraDimensions(String project) { Map<String, List<String>> builder = new HashMap<>(); for (TimestampTransformation transformation : timestampMapping.keySet()) { builder.computeIfAbsent(transformation.getCategory(), k -> new ArrayList<>()) .add(transformation.getPrettyName()); } return builder; } }
@Test public void testMultipleReferenceGrouping() throws Exception { QueryResult test = getEventExplorer().analyze(new RequestContext(PROJECT_NAME, null), of("test"), new EventExplorer.Measure("teststr", AggregationType.APPROXIMATE_UNIQUE), new EventExplorer.Reference(EventExplorer.ReferenceType.REFERENCE, DAY_OF_MONTH.getPrettyName()), new EventExplorer.Reference(EventExplorer.ReferenceType.REFERENCE, DAY_OF_MONTH.getPrettyName()), null, LocalDate.ofEpochDay(0), LocalDate.ofEpochDay(SCALE_FACTOR), ZoneOffset.UTC).getResult().join(); assertFalse(test.isFailed()); assertEquals(copyOf(test.getResult()), ImmutableSet.of(of("1th day", "1th day", 100L))); } }