Search in sources :

Example 1 with DetectionTaskInfo

use of com.linkedin.thirdeye.anomaly.detection.DetectionTaskInfo in project pinot by linkedin.

the class TaskGenerator method createDetectionTasks.

public List<DetectionTaskInfo> createDetectionTasks(DetectionJobContext detectionJobContext, List<DateTime> monitoringWindowStartTimes, List<DateTime> monitoringWindowEndTimes) throws Exception {
    List<DetectionTaskInfo> tasks = new ArrayList<>();
    AnomalyFunctionDTO anomalyFunctionSpec = detectionJobContext.getAnomalyFunctionSpec();
    long jobExecutionId = detectionJobContext.getJobExecutionId();
    // generate tasks
    String exploreDimensionsString = anomalyFunctionSpec.getExploreDimensions();
    if (StringUtils.isBlank(exploreDimensionsString)) {
        DetectionTaskInfo taskInfo = new DetectionTaskInfo(jobExecutionId, monitoringWindowStartTimes, monitoringWindowEndTimes, anomalyFunctionSpec, null);
        tasks.add(taskInfo);
    } else {
        DetectionTaskInfo taskInfo = new DetectionTaskInfo(jobExecutionId, monitoringWindowStartTimes, monitoringWindowEndTimes, anomalyFunctionSpec, exploreDimensionsString);
        tasks.add(taskInfo);
    }
    return tasks;
}
Also used : ArrayList(java.util.ArrayList) DetectionTaskInfo(com.linkedin.thirdeye.anomaly.detection.DetectionTaskInfo) AnomalyFunctionDTO(com.linkedin.thirdeye.datalayer.dto.AnomalyFunctionDTO)

Example 2 with DetectionTaskInfo

use of com.linkedin.thirdeye.anomaly.detection.DetectionTaskInfo in project pinot by linkedin.

the class TestAnomalyTaskManager method getTestDetectionTaskInfo.

static DetectionTaskInfo getTestDetectionTaskInfo() {
    DetectionTaskInfo taskInfo = new DetectionTaskInfo();
    taskInfo.setWindowStartTime(Lists.newArrayList(new DateTime(), new DateTime().minusHours(1)));
    taskInfo.setWindowEndTime(Lists.newArrayList(new DateTime(), new DateTime().minusHours(1)));
    return taskInfo;
}
Also used : DetectionTaskInfo(com.linkedin.thirdeye.anomaly.detection.DetectionTaskInfo) DateTime(org.joda.time.DateTime)

Aggregations

DetectionTaskInfo (com.linkedin.thirdeye.anomaly.detection.DetectionTaskInfo)2 AnomalyFunctionDTO (com.linkedin.thirdeye.datalayer.dto.AnomalyFunctionDTO)1 ArrayList (java.util.ArrayList)1 DateTime (org.joda.time.DateTime)1