return TimeMachineData.class;
}
- public static TimeMachineQuery create(String resourceKeyOrId) {
- return new TimeMachineQuery(resourceKeyOrId);
+ public static TimeMachineQuery createForMetrics(String resourceKeyOrId, String... metricKeys) {
+ return new TimeMachineQuery(resourceKeyOrId)
+ .setMetrics(metricKeys);
+ }
+
+ public static TimeMachineQuery createForResource(Resource resource, String... metricKeys) {
+ return new TimeMachineQuery(resource.getId().toString())
+ .setMetrics(metricKeys);
}
}
@Test
public void timemachine() {
- TimeMachineQuery query = TimeMachineQuery.create(PROJECT).setMetrics(
+ TimeMachineQuery query = TimeMachineQuery.createForMetrics(PROJECT,
CoreMetrics.BLOCKER_VIOLATIONS_KEY,
CoreMetrics.CRITICAL_VIOLATIONS_KEY,
CoreMetrics.MAJOR_VIOLATIONS_KEY,