-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathperformanceMonitor.php
53 lines (37 loc) · 1.08 KB
/
performanceMonitor.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
session_start();
require_once 'CpuUsageController.php';
require_once 'DiskUsageController.php';
require 'FreeRamController.php';
require_once 'LoadAverageController.php';
require_once 'NetworkUsageController.php';
require_once 'UpdatesAvailableControler.php';
require_once 'UptimeController.php';
$_SESSION['previousIdle'] = -1; //in object attribute packen
$_SESSION['previousTotal'] = -1;
$cpu = new CpuUsageController();
$disk = new DiskUsageController();
$ram = new FreeRamController();
$load = new LoadAverageController();
$network = new NetworkUsageController();
$updates = new UpdatesAvailableController();
$uptime = new UptimeController();
while(true){
$cpu->crawlStats();
$disk->crawlStats();
$ram->crawlStats();
$load->crawlStats();
$network->crawlStats();
$updates->crawlStats();
$uptime->crawlStats();
//push it to the server
BaseController::push($cpu);
BaseController::push($disk);
BaseController::push($load);
BaseController::push($ram);
BaseController::push($network);
BaseController::push($updates);
BaseController::push($uptime);
sleep(1);
}
?>