Search in sources :

Example 1 with NotificationsStatisticsType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.NotificationsStatisticsType in project midpoint by Evolveum.

the class NotificationsLineDto method extractFromOperationalInformation.

public static List<NotificationsLineDto> extractFromOperationalInformation(EnvironmentalPerformanceInformation environmentalPerformanceInformation) {
    EnvironmentalPerformanceInformationType environmentalPerformanceInformationType = environmentalPerformanceInformation.getAggregatedValue();
    NotificationsStatisticsType notificationsStatisticsType = environmentalPerformanceInformationType.getNotificationsStatistics();
    return extractFromOperationalInformation(notificationsStatisticsType);
}
Also used : NotificationsStatisticsType(com.evolveum.midpoint.xml.ns._public.common.common_3.NotificationsStatisticsType) EnvironmentalPerformanceInformationType(com.evolveum.midpoint.xml.ns._public.common.common_3.EnvironmentalPerformanceInformationType)

Example 2 with NotificationsStatisticsType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.NotificationsStatisticsType in project midpoint by Evolveum.

the class EnvironmentalPerformanceInformation method toNotificationsStatisticsType.

private NotificationsStatisticsType toNotificationsStatisticsType() {
    NotificationsStatisticsType rv = new NotificationsStatisticsType();
    if (notificationsData == null) {
        return rv;
    }
    for (Map.Entry<NotificationsStatisticsKey, GenericStatisticsData> entry : notificationsData.entrySet()) {
        NotificationsStatisticsKey key = entry.getKey();
        String transport = key.getTransport();
        NotificationsStatisticsEntryType entryType = findNotificationsEntryType(rv.getEntry(), transport);
        if (entryType == null) {
            entryType = new NotificationsStatisticsEntryType();
            entryType.setTransport(transport);
            rv.getEntry().add(entryType);
        }
        setValueNotifications(entryType, key.isSuccess(), entry.getValue().getCount(), entry.getValue().getMinDuration(), entry.getValue().getMaxDuration(), entry.getValue().getTotalDuration());
    }
    return rv;
}
Also used : NotificationsStatisticsEntryType(com.evolveum.midpoint.xml.ns._public.common.common_3.NotificationsStatisticsEntryType) NotificationsStatisticsType(com.evolveum.midpoint.xml.ns._public.common.common_3.NotificationsStatisticsType) HashMap(java.util.HashMap) Map(java.util.Map)

Example 3 with NotificationsStatisticsType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.NotificationsStatisticsType in project midpoint by Evolveum.

the class EnvironmentalPerformanceInformation method addNotificationsTo.

private static void addNotificationsTo(EnvironmentalPerformanceInformationType rv, NotificationsStatisticsType delta) {
    if (delta == null) {
        return;
    }
    if (rv.getNotificationsStatistics() == null) {
        rv.setNotificationsStatistics(delta.clone());
        return;
    }
    NotificationsStatisticsType rvNST = rv.getNotificationsStatistics();
    for (NotificationsStatisticsEntryType de : delta.getEntry()) {
        String transport = de.getTransport();
        NotificationsStatisticsEntryType e = findNotificationsEntryType(rvNST.getEntry(), transport);
        if (e == null) {
            e = new NotificationsStatisticsEntryType();
            e.setTransport(transport);
            rvNST.getEntry().add(e);
        }
        e.setCountSuccess(e.getCountSuccess() + de.getCountSuccess());
        e.setCountFailure(e.getCountFailure() + de.getCountFailure());
        int count = e.getCountSuccess() + e.getCountFailure();
        e.setMinTime(min(e.getMinTime(), de.getMinTime()));
        e.setMaxTime(max(e.getMaxTime(), de.getMaxTime()));
        e.setTotalTime(e.getTotalTime() + de.getTotalTime());
        if (count > 0) {
            e.setAverageTime(e.getTotalTime() / count);
        } else {
            e.setAverageTime(null);
        }
    }
}
Also used : NotificationsStatisticsEntryType(com.evolveum.midpoint.xml.ns._public.common.common_3.NotificationsStatisticsEntryType) NotificationsStatisticsType(com.evolveum.midpoint.xml.ns._public.common.common_3.NotificationsStatisticsType)

Aggregations

NotificationsStatisticsType (com.evolveum.midpoint.xml.ns._public.common.common_3.NotificationsStatisticsType)3 NotificationsStatisticsEntryType (com.evolveum.midpoint.xml.ns._public.common.common_3.NotificationsStatisticsEntryType)2 EnvironmentalPerformanceInformationType (com.evolveum.midpoint.xml.ns._public.common.common_3.EnvironmentalPerformanceInformationType)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1