use of org.opensearch.ad.model.InitProgressProfile in project anomaly-detection by opensearch-project.
the class EntityProfileRunner method sendInitState.
private void sendInitState(Set<EntityProfileName> profilesToCollect, Entity entityValue, AnomalyDetector detector, long updates, MultiResponsesDelegateActionListener<EntityProfile> delegateListener) {
EntityProfile.Builder builder = new EntityProfile.Builder();
if (profilesToCollect.contains(EntityProfileName.STATE)) {
builder.state(EntityState.INIT);
}
if (profilesToCollect.contains(EntityProfileName.INIT_PROGRESS)) {
long intervalMins = ((IntervalTimeConfiguration) detector.getDetectionInterval()).toDuration().toMinutes();
InitProgressProfile initProgress = computeInitProgressProfile(updates, intervalMins);
builder.initProgress(initProgress);
}
delegateListener.onResponse(builder.build());
}
Aggregations