Exemple #1
0
    def __init__(self, logger, seuid, parent=None, *args):
        """
        Initializes the TItem.
        
        :param seuid: the seuid of the item
        :type seuid: str
        :param logger: a logger where to log when special events occur
        :type logger: ModelLogger
        :param parent: the parent-item
        :type parent: QObject
        :param args:
        :type args: str
        """
        AbstractItem.__init__(self, logger, "root", parent)
        self._attributes = []
        self._attributes.extend(["cpu_usage_mean", "cpu_temp_mean", "cpu_usage_max", "cpu_temp_max",
                                        "ram_usage_mean", "ram_usage_max", "total_traffic", "connected_hosts",
                                        "connected_nodes", "topic_counter", "connection_counter"])
        self._type = "root"
        
        for item in self._attributes:
            self._add_data_list(item)

        self.__rated_attributes = []
        for item in self._attributes:
            self.__rated_attributes.append(item + ".actual_value")
            self.__rated_attributes.append(item + ".expected_value")
            self.__rated_attributes.append(item + ".state")

        for item in self.__rated_attributes:
            self._add_rated_data_list(item)
Exemple #2
0
    def __init__(self, logger, seuid, first_message, parent=None):
        """Initializes the TopicItem.
        
        :param seuid: the seuid of the item
        :type seuid: str
        :param logger: a logger where to log when special events occur
        :type logger: ModelLogger
        :param parent: the parent-item
        :type parent: AbstractItem
        """
        AbstractItem.__init__(self, logger, seuid, parent)
        self.__parent = parent
        self._type = "topic"

        self.add_keys=["dropped_msgs", "traffic", "bandwidth", "frequency"]
        self.avg_keys=["period_mean", "period_stddev", "stamp_age_mean", "stamp_age_stddev"]
        self.max_keys=["period_max", "stamp_age_max"]

        self._attributes = []
        self._attributes.extend(["dropped_msgs", "traffic",
                                 "period_mean", "period_stddev", "period_max", "stamp_age_mean",
                                 "stamp_age_stddev", "stamp_age_max", "bandwidth", "frequency"])

        for item in self._attributes:
            self._add_data_list(item)

        self.__calculated_data = {}
        for key in self._attributes:
            self.__calculated_data[key] = []

        self.__calculated_data["window_stop"] = []
        self.__calculated_data["window_start"] = []

        for item in self._attributes:
            self._rated_attributes.append(item + ".actual_value")
            self._rated_attributes.append(item + ".expected_value")
            self._rated_attributes.append(item + ".state")

        for item in self._rated_attributes:
            self._add_rated_data_list(item)

        self._logger.log("info", Time.now(), seuid, "Created a new TopicItem")

        self.__timer = Timer(Duration(nsecs=TOPIC_AGGREGATION_FREQUENCY), self.__aggregate_topic_data)

        self.tree_items = []
        self.__aggregation_window = rospy.get_param("~aggregation_window", 5)
Exemple #3
0
    def __init__(self, logger, seuid, parent=None):
        """
        Initializes the NodeItem.
        
        :param seuid: the seuid of the item
        :type seuid: str
        :param logger: a logger where to log when special events occur
        :type logger: ModelLogger
        :param parent: the parent-item
        :type parent: AbstractItem
        """
        AbstractItem.__init__(self, logger, seuid, parent)
        self._type = "node"
        self.__parent = parent

        self._type = "node"

        self._attributes = []
        self._attributes.extend([
            "node_cpu_usage_mean", "node_cpu_usage_stddev",
            "node_cpu_usage_max", "node_cpu_usage_core_mean",
            "node_cpu_usage_core_stddev", "node_cpu_usage_core_max",
            "node_gpu_usage_mean", "node_gpu_usage_stddev",
            "node_gpu_usage_max", "node_ramusage_mean", "node_ramusage_stddev",
            "node_ramusage_max", "node_message_frequency_mean",
            "node_message_frequency_stddev", "node_message_frequency_max",
            "node_bandwidth_mean", "node_bandwidth_stddev",
            "node_bandwidth_max", "node_write_mean", "node_write_stddev",
            "node_write_max", "node_read_mean", "node_read_stddev",
            "node_read_max"
        ])

        for item in self._attributes:
            self._add_data_list(item)

        for item in self._attributes:
            self._rated_attributes.append(item + ".actual_value")
            self._rated_attributes.append(item + ".expected_value")
            self._rated_attributes.append(item + ".state")

        for item in self._rated_attributes:
            self._add_rated_data_list(item)

        self._logger.log("info", Time.now(), seuid, "Created a new NodeItem")
    def __init__(self, logger, seuid, first_message, parent=None):
        """
        Initializes the ConnectionItem.
        
        :param seuid: the seuid of the item
        :type seuid: str
        :param logger: a logger where to log when special events occur
        :type logger: ModelLogger
        :param type: the type of the item
        :type type: str
        :param parent: the parent-item
        :type parent: AbstractItem
        """
        AbstractItem.__init__(self, logger, seuid, parent)
        self.__parent = parent
        self._type = "connection"

        self.add_keys=["dropped_msgs", "traffic"]
        self.avg_keys=["period_mean", "period_stddev", "stamp_age_mean", "stamp_age_stddev", "bandwidth", "frequency"]
        self.max_keys=["period_max", "stamp_age_max"]

        self._attributes = []
        self._attributes.extend(["dropped_msgs", "traffic",
                                 "period_mean", "period_stddev", "period_max", "stamp_age_mean",
                                 "stamp_age_stddev", "stamp_age_max", "bandwidth", "frequency"])

        for item in self._attributes:
            self._add_data_list(item)

        for item in self._attributes:
            self._rated_attributes.append(item + ".actual_value")
            self._rated_attributes.append(item + ".expected_value")
            self._rated_attributes.append(item + ".state")


        for item in self._rated_attributes:
            self._add_rated_data_list(item)

        self._logger.log("info", Time.now(), seuid, "Created a new ConnectionItem")

        self.show_as_subscriber = False
        self.tree_item1 = None
        self.tree_item2 = None
Exemple #5
0
    def __init__(self, logger, seuid, parent=None):
        """
        Initializes the NodeItem.
        
        :param seuid: the seuid of the item
        :type seuid: str
        :param logger: a logger where to log when special events occur
        :type logger: ModelLogger
        :param parent: the parent-item
        :type parent: AbstractItem
        """
        AbstractItem.__init__(self, logger, seuid, parent)
        self._type = "node"
        self.__parent = parent

        self._type = "node"

        self._attributes = []
        self._attributes.extend(["node_cpu_usage_mean", "node_cpu_usage_stddev", "node_cpu_usage_max",
                                 "node_cpu_usage_core_mean",
                                 "node_cpu_usage_core_stddev", "node_cpu_usage_core_max", "node_gpu_usage_mean",
                                 "node_gpu_usage_stddev",
                                 "node_gpu_usage_max", "node_ramusage_mean", "node_ramusage_stddev",
                                 "node_ramusage_max",
                                 "node_message_frequency_mean", "node_message_frequency_stddev",
                                 "node_message_frequency_max", "node_bandwidth_mean", "node_bandwidth_stddev",
                                 "node_bandwidth_max", "node_write_mean", "node_write_stddev", "node_write_max",
                                 "node_read_mean",
                                 "node_read_stddev", "node_read_max"])

        for item in self._attributes:
            self._add_data_list(item)

        for item in self._attributes:
            self._rated_attributes.append(item + ".actual_value")
            self._rated_attributes.append(item + ".expected_value")
            self._rated_attributes.append(item + ".state")

        for item in self._rated_attributes:
            self._add_rated_data_list(item)

        self._logger.log("info", Time.now(), seuid, "Created a new NodeItem")
Exemple #6
0
    def __init__(self, logger, seuid, parent=None):
        """
        Initializes the ConnectionItem.

        :param seuid: the seuid of the HostItem
        :type list: list
        :param logger: a logger where to log when special events occur
        :type logger: ModelLogger
        :param parent: the parent-item
        :type parent: AbstractItem
        """
        AbstractItem.__init__(self, logger, seuid, parent)
        self.__parent = parent
        self._type = "host"

        self._attributes = []
        self._attributes.extend([
            "cpu_temp_mean", "cpu_temp_stddev", "cpu_temp_max",
            "cpu_usage_mean", "cpu_usage_stddev", "cpu_usage_max",
            "cpu_usage_core_mean", "cpu_usage_core_stddev",
            "cpu_usage_core_max", "cpu_temp_core_mean", "cpu_temp_core_stddev",
            "cpu_temp_core_max", "gpu_temp_mean", "gpu_temp_stddev",
            "gpu_temp_max", "gpu_usage_mean", "gpu_usage_stddev",
            "gpu_usage_max", "ram_usage_mean", "ram_usage_stddev",
            "ram_usage_max", "interface_name", "message_frequency_mean",
            "message_frequency_stddev", "message_frequency_max",
            "bandwidth_mean", "bandwidth_stddev", "bandwidth_max",
            "drive_name", "drive_free_space", "drive_read", "drive_write"
        ])

        for item in self._attributes:
            self._add_data_list(item)

        for item in self._attributes:
            self._rated_attributes.append(item + ".actual_value")
            self._rated_attributes.append(item + ".expected_value")
            self._rated_attributes.append(item + ".state")

        for item in self._rated_attributes:
            self._add_rated_data_list(item)

        self._logger.log("info", Time.now(), seuid, "Created a new HostItem")
Exemple #7
0
    def __init__(self, logger, seuid, parent=None):
        """
        Initializes the ConnectionItem.

        :param seuid: the seuid of the HostItem
        :type list: list
        :param logger: a logger where to log when special events occur
        :type logger: ModelLogger
        :param parent: the parent-item
        :type parent: AbstractItem
        """
        AbstractItem.__init__(self, logger, seuid, parent)
        self.__parent = parent
        self._type = "host"

        self._attributes = []
        self._attributes.extend(["cpu_temp_mean", "cpu_temp_stddev", "cpu_temp_max", "cpu_usage_mean",
                                 "cpu_usage_stddev", "cpu_usage_max", "cpu_usage_core_mean", "cpu_usage_core_stddev",
                                 "cpu_usage_core_max", "cpu_temp_core_mean", "cpu_temp_core_stddev",
                                 "cpu_temp_core_max", "gpu_temp_mean", "gpu_temp_stddev", "gpu_temp_max",
                                 "gpu_usage_mean",
                                 "gpu_usage_stddev", "gpu_usage_max", "ram_usage_mean", "ram_usage_stddev",
                                 "ram_usage_max",
                                 "interface_name", "message_frequency_mean", "message_frequency_stddev",
                                 "message_frequency_max", "bandwidth_mean", "bandwidth_stddev", "bandwidth_max",
                                 "drive_name", "drive_free_space", "drive_read", "drive_write"])

        for item in self._attributes:
            self._add_data_list(item)
       
        for item in self._attributes:
            self._rated_attributes.append(item + ".actual_value")
            self._rated_attributes.append(item + ".expected_value")
            self._rated_attributes.append(item + ".state")

        for item in self._rated_attributes:
            self._add_rated_data_list(item)

        self._logger.log("info", Time.now(), seuid, "Created a new HostItem")