5
5
6
6
7
7
use PHPUnit_Framework_TestCase ;
8
- use Prometheus \Client ;
8
+ use Prometheus \Registry ;
9
9
use Prometheus \RedisAdapter ;
10
10
11
- class ClientTest extends PHPUnit_Framework_TestCase
11
+ class RegistryTest extends PHPUnit_Framework_TestCase
12
12
{
13
13
public function setUp ()
14
14
{
@@ -28,13 +28,13 @@ public function itShouldRenderOnlyOneHelpForTheSameMetric()
28
28
*/
29
29
public function itShouldSaveGaugesInRedis ()
30
30
{
31
- $ client = new Client ($ this ->newRedisAdapter ());
31
+ $ client = new Registry ($ this ->newRedisAdapter ());
32
32
$ metric = $ client ->registerGauge ('test ' , 'some_metric ' , 'this is for testing ' , array ('foo ' , 'bar ' ));
33
33
$ metric ->set (14 , array ('foo ' => 'lalal ' , 'bar ' => 'lululu ' ));
34
34
$ client ->getGauge ('test ' , 'some_metric ' )->set (34 , array ('foo ' => 'lalal ' , 'bar ' => 'lululu ' ));
35
35
$ client ->flush ();
36
36
37
- $ client = new Client ($ this ->newRedisAdapter ());
37
+ $ client = new Registry ($ this ->newRedisAdapter ());
38
38
$ this ->assertThat (
39
39
$ client ->toText (),
40
40
$ this ->equalTo (<<<EOF
@@ -52,13 +52,13 @@ public function itShouldSaveGaugesInRedis()
52
52
*/
53
53
public function itShouldSaveCountersInRedis ()
54
54
{
55
- $ client = new Client ($ this ->newRedisAdapter ());
55
+ $ client = new Registry ($ this ->newRedisAdapter ());
56
56
$ metric = $ client ->registerCounter ('test ' , 'some_metric ' , 'this is for testing ' , array ('foo ' , 'bar ' ));
57
57
$ metric ->increaseBy (2 , array ('foo ' => 'lalal ' , 'bar ' => 'lululu ' ));
58
58
$ client ->getCounter ('test ' , 'some_metric ' )->increase (array ('foo ' => 'lalal ' , 'bar ' => 'lululu ' ));
59
59
$ client ->flush ();
60
60
61
- $ client = new Client ($ this ->newRedisAdapter ());
61
+ $ client = new Registry ($ this ->newRedisAdapter ());
62
62
$ this ->assertThat (
63
63
$ client ->toText (),
64
64
$ this ->equalTo (<<<EOF
@@ -76,14 +76,14 @@ public function itShouldSaveCountersInRedis()
76
76
*/
77
77
public function itShouldSaveHistogramsInRedis ()
78
78
{
79
- $ client = new Client ($ this ->newRedisAdapter ());
79
+ $ client = new Registry ($ this ->newRedisAdapter ());
80
80
$ metric = $ client ->registerHistogram ('test ' , 'some_metric ' , 'this is for testing ' , array ('foo ' , 'bar ' ), array (0.1 , 1 , 5 , 10 ));
81
81
$ metric ->observe (2 , array ('foo ' => 'lalal ' , 'bar ' => 'lululu ' ));
82
82
$ client ->getHistogram ('test ' , 'some_metric ' )->observe (13 , array ('foo ' => 'lalal ' , 'bar ' => 'lululu ' ));
83
83
$ client ->getHistogram ('test ' , 'some_metric ' )->observe (7 , array ('foo ' => 'lalal ' , 'bar ' => 'lululu ' ));
84
84
$ client ->flush ();
85
85
86
- $ client = new Client ($ this ->newRedisAdapter ());
86
+ $ client = new Registry ($ this ->newRedisAdapter ());
87
87
$ this ->assertThat (
88
88
$ client ->toText (),
89
89
$ this ->equalTo (<<<EOF
@@ -104,6 +104,6 @@ public function itShouldSaveHistogramsInRedis()
104
104
105
105
private function newRedisAdapter ()
106
106
{
107
- return new RedisAdapter ('127.0.0.1 ' );
107
+ return new RedisAdapter ('192.168.59.100 ' );
108
108
}
109
109
}
0 commit comments