-
Notifications
You must be signed in to change notification settings - Fork 0
/
get.php
42 lines (32 loc) · 862 Bytes
/
get.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
<?php
/**
* Created by PhpStorm.
* User: coder
* Date: 2018/4/7
* Time: 下午4:53
*/
require_once 'bootstrap.php';
$client = new GuzzleHttp\Client();
if (isset($_GET['target'])) {
switch ($_GET['target']) {
case 'cpu':
$CPU = new \Coderzhang\DataGetter\CPUDataGetter(20);
print $CPU->getResult($client);
break;
case 'memory':
$memory = new \Coderzhang\DataGetter\MemoryDataGetter();
print $memory->getResult($client);
break;
case 'tcp':
$tcp = new \Coderzhang\DataGetter\TCPDataGetter();
print $tcp->getResult($client);
break;
case 'basic':
$basic = new \Coderzhang\DataGetter\BasicInfoDataGetter();
print $basic->getResult($client);
break;
}
}
//$res = $client->request('GET', $_ENV['API'], [
// 'query' => 'query=rate(http_requests_total[10m])'
//]);