Ejemplo n.º 1
0
        {
            $my_string = shmop_read($this->{$shm_id}, 0, $shm_size);
            if (!$my_string) {
                debug("No se pudo leer el segmento de memoria compartida\n", "red");
            }
            return $my_string;
        }
        // Borrado y eliminacion del segmento de memoria compartida
        function MonClose()
        {
            if (!shmop_delete($this->{$shm_id})) {
                debug("No se pudo borrar el segmento de memoria compartida.", "red");
            }
            shmop_close($this->{$shm_id});
        }
        function MonAverageUpdate($time)
        {
            $this->SYSPERFOMANCE["pages"]++;
            $this->SYSPERFOMANCE["time"] += $time;
            $this->MonWrite(serialize($this->SYSPERFOMANCE));
        }
        function MonGetStat()
        {
            $this->SYSPERFOMANCE["avg"] = $this->SYSPERFOMANCE["time"] / $this->SYSPERFOMANCE["pages"];
            return $this->SYSPERFOMANCE;
        }
    }
    $monitor = new Monitor();
    $monitor->MonInit();
    $monitor->SYSPERFOMANCE = unserialize($monitor->MonRead());
}