Search in sources :

Example 1 with InvalidName

use of gov.sandia.CosNotification.NotificationServiceMonitorControlPackage.InvalidName in project ACS by ACS-Community.

the class ChannelStats method setData.

public void setData(ChannelData channel) {
    NotificationServiceMonitorControl nsm = channel.getParent().getMc();
    String[] statsNames = nsm.get_statistic_names();
    String channelName = "Channel " + channel.getName() + " - ";
    long oldestEvent = -1;
    for (int i = 0; i < statsNames.length; ++i) {
        try {
            if (statsNames[i].contains("ConsumerCount")) {
                Monitor.Numeric n = nsm.get_statistic(statsNames[i]).data_union.num();
                setValue(N_CONSUMERS, (long) n.last);
            } else if (statsNames[i].contains("SupplierCount")) {
                Monitor.Numeric n = nsm.get_statistic(statsNames[i]).data_union.num();
                setValue(N_SUPPLIERS, (long) n.last);
            } else if (statsNames[i].contains("QueueSize")) {
                // n.count, n.maximum, n.last, n.average, n.dlist[0].value, n.dlist[0].timestamp
                Monitor.Numeric n = nsm.get_statistic(statsNames[i]).data_union.num();
                setQueueSize(statsNames[i], (long) n.maximum, n.average);
            } else if (statsNames[i].contains("QueueElementCount")) {
                Monitor.Numeric n = nsm.get_statistic(statsNames[i]).data_union.num();
                setQueueElementCount(statsNames[i], (long) n.maximum);
            } else if (statsNames[i].contains("OldestEvent")) {
                Monitor.Numeric n = nsm.get_statistic(statsNames[i]).data_union.num();
                this.oldestEvent = (long) n.last;
            } else if (statsNames[i].contains("SlowestConsumers")) {
                String[] slowestConsumers = nsm.get_statistic(statsNames[i]).data_union.list();
                setArrayValues(CURR_SLOWEST_CONSUMERS, currStringLists, slowestConsumers);
                addArrayValues(ALL_SLOWEST_CONSUMERS, allStringLists, slowestConsumers);
                setValue(N_SLOWEST_CONSUMERS, slowestConsumers.length);
            } else if (statsNames[i].contains("SupplierNames")) {
                String[] supplierNames = nsm.get_statistic(statsNames[i]).data_union.list();
                setArrayValues(CURR_SUPPLIERS, currStringLists, supplierNames);
                addArrayValues(ALL_SUPPLIERS, allStringLists, supplierNames);
            } else if (statsNames[i].contains("ConsumerNames")) {
                String[] consumerNames = nsm.get_statistic(statsNames[i]).data_union.list();
                setArrayValues(CURR_CONSUMERS, currStringLists, consumerNames);
                addArrayValues(ALL_CONSUMERS, allStringLists, consumerNames);
            } else if (statsNames[i].contains("SupplierAdminNames")) {
                String[] supplierAdminNames = nsm.get_statistic(statsNames[i]).data_union.list();
                setArrayValues(CURR_SUPPLIERS_ADMIN, currStringLists, supplierAdminNames);
                addArrayValues(ALL_SUPPLIERS_ADMIN, allStringLists, supplierAdminNames);
                setValue(N_SUPPLIERS_ADMIN, supplierAdminNames.length);
            } else if (statsNames[i].contains("ConsumerAdminNames")) {
                String[] consumerAdminNames = nsm.get_statistic(statsNames[i]).data_union.list();
                setArrayValues(CURR_CONSUMERS_ADMIN, currStringLists, consumerAdminNames);
                addArrayValues(ALL_CONSUMERS_ADMIN, allStringLists, consumerAdminNames);
                setValue(N_CONSUMERS_ADMIN, consumerAdminNames.length);
            }
        } catch (InvalidName ex) {
        //logger.log(AcsLogLevel.ERROR, "Invalid name in ncStatisticsService::logMCStats", ex);
        // TODO 
        }
    }
    iterationDone();
}
Also used : InvalidName(gov.sandia.CosNotification.NotificationServiceMonitorControlPackage.InvalidName) NotificationServiceMonitorControl(gov.sandia.CosNotification.NotificationServiceMonitorControl)

Aggregations

NotificationServiceMonitorControl (gov.sandia.CosNotification.NotificationServiceMonitorControl)1 InvalidName (gov.sandia.CosNotification.NotificationServiceMonitorControlPackage.InvalidName)1