Beispiel #1
0
    def _prepareEntity(self, name, data):
        cfg = ConfigParser.SafeConfigParser()
        cfg.add_section("__int__")
        cfg.set("__int__", "plot-subdir", "")

        ent = Entity(Monitor(cfg, name))
        ent.statistics.append(data)
        ent.monitor.fields = set(ent.statistics[-1].keys())
        ent.monitor.optional_fields = []
        ent._finalize()

        return ent
Beispiel #2
0
    def _prepareEntity(self, name, data):
        cfg = configparser.SafeConfigParser()
        cfg.add_section("__int__")
        cfg.set("__int__", "plot-subdir", "")

        ent = Entity(Monitor(cfg, name))
        ent.statistics.append(data)
        ent.monitor.fields = set(ent.statistics[-1].keys())
        ent.monitor.optional_fields = []
        ent._finalize()

        return ent
Beispiel #3
0
 def interrogate(self):
     """
     Take a snapshot of this Monitor object and return an Entity object which
     is useful for rules processing.
     Return: A new Entity object
     """
     if self.ready is not True:
         return None
     ret = Entity(monitor=self)
     self.data_sem.acquire()
     for prop in self.properties.keys():
         ret._set_property(prop, self.properties[prop])
     for var in self.variables.keys():
         ret._set_variable(var, self.variables[var])
     ret._set_statistics(self.statistics)
     self.data_sem.release()
     ret._finalize()
     return ret
Beispiel #4
0
 def interrogate(self):
     """
     Take a snapshot of this Monitor object and return an Entity object which
     is useful for rules processing.
     Return: A new Entity object
     """
     if self.ready is not True:
         return None
     ret = Entity(monitor=self)
     self.data_sem.acquire()
     for prop in self.properties.keys():
         ret._set_property(prop, self.properties[prop])
     for var in self.variables.keys():
         ret._set_variable(var, self.variables[var])
     ret._set_statistics(self.statistics)
     self.data_sem.release()
     ret._finalize()
     return ret