generated from renoki-co/laravel-package-skeleton
-
-
Notifications
You must be signed in to change notification settings - Fork 70
/
Copy pathResourceMetricTest.php
35 lines (27 loc) · 1.01 KB
/
ResourceMetricTest.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
<?php
namespace RenokiCo\PhpK8s\Test;
use RenokiCo\PhpK8s\K8s;
class ResourceMetricTest extends TestCase
{
public function test_cpu_resource_metric()
{
$metric = K8s::metric()->cpu()->averageUtilization(70);
$this->assertEquals('Utilization', $metric->getType());
$this->assertequals('cpu', $metric->getName());
$this->assertEquals(70, $metric->getAverageUtilization());
}
public function test_memory_resource_metric()
{
$metric = K8s::metric()->memory()->averageValue('3Gi');
$this->assertEquals('AverageValue', $metric->getType());
$this->assertEquals('memory', $metric->getName());
$this->assertEquals('3Gi', $metric->getAverageValue());
}
public function test_custom_metric()
{
$metric = K8s::metric()->setMetric('packets')->value(2048);
$this->assertEquals('Value', $metric->getType());
$this->assertEquals('packets', $metric->getName());
$this->assertEquals(2048, $metric->getvalue());
}
}