Exemplo n.º 1
0
    def __init__(self,
                 process,
                 exitcode_score=0.50,
                 signal_score=1.0,
                 default_score=0.0,
                 timeout_score=1.0):
        self.process = weakref_ref(process)
        project = process.project()
        ProjectAgent.__init__(self, project, "watch:%s" % process.name)
        if RUNNING_LINUX:
            self.cpu = CpuProbe(project, "%s:cpu" % self.name)
        else:
            self.warning("CpuProbe is not available")
            self.cpu = None

        # Score if process exited normally
        self.default_score = default_score

        # Score if process exit code is not nul
        self.exitcode_score = exitcode_score

        # Score if process has been killed by signal
        self.signal_score = signal_score

        # Score if process timeout has been reached
        self.timeout_score = timeout_score
Exemplo n.º 2
0
    def __init__(self,
                 process,
                 exitcode_score=DEFAULT_EXITCODE_SCORE,
                 signal_score=DEFAULT_SIGNAL_SCORE,
                 default_score=0.0,
                 timeout_score=DEFAULT_TIMEOUT_SCORE):
        self.process = weakref_ref(process)
        project = process.project()
        ProjectAgent.__init__(self, project, "watch:%s" % process.name)
        if RUNNING_LINUX and project.config.use_cpu_probe:
            self.cpu = CpuProbe(project, "%s:cpu" % self.name)
        else:
            self.cpu = None

        # Score if process exited normally
        self.default_score = default_score

        # Score if process exit code is not nul
        self.exitcode_score = exitcode_score

        # Score if process has been killed by signal
        self.signal_score = signal_score

        # Score if process timeout has been reached
        self.timeout_score = timeout_score
Exemplo n.º 3
0
 def __init__(self, project, process_name):
     ProjectAgent.__init__(self, project,
                           "attach_process:%s" % process_name)
     self.process_name = process_name
     self.death_score = 1.0
     self.max_memory = 100 * 1024 * 1024
     self.memory_score = 1.0
     if RUNNING_LINUX:
         self.cpu = CpuProbe(project, "%s:cpu" % self.name)
     else:
         self.warning("CpuProbe is not available")
         self.cpu = None
Exemplo n.º 4
0
 def __init__(self, project, pid, name=None):
     if not name:
         name = "pid:%s" % pid
     ProjectAgent.__init__(self, project, name)
     if RUNNING_WINDOWS:
         raise NotImplementedError(
             "AttachProcessPID is not supported on Windows")
     self.death_score = 1.0
     self.show_exit = True   # needed by the debugger
     self.max_memory = 100*1024*1024
     self.memory_score = 1.0
     self.debugger = project.debugger
     self.dbg_process = None
     if HAS_PROC and project.config.use_cpu_probe:
         self.cpu = CpuProbe(project, "%s:cpu" % self.name)
     else:
         self.warning("CpuProbe is not available on your OS")
         self.cpu = None
     if pid:
         self.setPid(pid)
     else:
         self.pid = None