Skip to content
This repository was archived by the owner on Oct 22, 2019. It is now read-only.

Commit 1a08dae

Browse files
Tina UmlandtFabian Stehle
Tina Umlandt
authored and
Fabian Stehle
committed
rename client to registry
1 parent e56d3bb commit 1a08dae

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
*.iml
33
/.idea/
44
composer.lock
5+
composer.phar

src/Prometheus/Client.php renamed to src/Prometheus/Registry.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
namespace Prometheus;
55

66

7-
class Client
7+
class Registry
88
{
99
private $redisAdapter;
1010
/**

tests/Test/Prometheus/ClientTest.php renamed to tests/Test/Prometheus/RegistryTest.php

+9-9
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55

66

77
use PHPUnit_Framework_TestCase;
8-
use Prometheus\Client;
8+
use Prometheus\Registry;
99
use Prometheus\RedisAdapter;
1010

11-
class ClientTest extends PHPUnit_Framework_TestCase
11+
class RegistryTest extends PHPUnit_Framework_TestCase
1212
{
1313
public function setUp()
1414
{
@@ -28,13 +28,13 @@ public function itShouldRenderOnlyOneHelpForTheSameMetric()
2828
*/
2929
public function itShouldSaveGaugesInRedis()
3030
{
31-
$client = new Client($this->newRedisAdapter());
31+
$client = new Registry($this->newRedisAdapter());
3232
$metric = $client->registerGauge('test', 'some_metric', 'this is for testing', array('foo', 'bar'));
3333
$metric->set(14, array('foo' => 'lalal', 'bar' => 'lululu'));
3434
$client->getGauge('test', 'some_metric')->set(34, array('foo' => 'lalal', 'bar' => 'lululu'));
3535
$client->flush();
3636

37-
$client = new Client($this->newRedisAdapter());
37+
$client = new Registry($this->newRedisAdapter());
3838
$this->assertThat(
3939
$client->toText(),
4040
$this->equalTo(<<<EOF
@@ -52,13 +52,13 @@ public function itShouldSaveGaugesInRedis()
5252
*/
5353
public function itShouldSaveCountersInRedis()
5454
{
55-
$client = new Client($this->newRedisAdapter());
55+
$client = new Registry($this->newRedisAdapter());
5656
$metric = $client->registerCounter('test', 'some_metric', 'this is for testing', array('foo', 'bar'));
5757
$metric->increaseBy(2, array('foo' => 'lalal', 'bar' => 'lululu'));
5858
$client->getCounter('test', 'some_metric')->increase(array('foo' => 'lalal', 'bar' => 'lululu'));
5959
$client->flush();
6060

61-
$client = new Client($this->newRedisAdapter());
61+
$client = new Registry($this->newRedisAdapter());
6262
$this->assertThat(
6363
$client->toText(),
6464
$this->equalTo(<<<EOF
@@ -76,14 +76,14 @@ public function itShouldSaveCountersInRedis()
7676
*/
7777
public function itShouldSaveHistogramsInRedis()
7878
{
79-
$client = new Client($this->newRedisAdapter());
79+
$client = new Registry($this->newRedisAdapter());
8080
$metric = $client->registerHistogram('test', 'some_metric', 'this is for testing', array('foo', 'bar'), array(0.1, 1, 5, 10));
8181
$metric->observe(2, array('foo' => 'lalal', 'bar' => 'lululu'));
8282
$client->getHistogram('test', 'some_metric')->observe(13, array('foo' => 'lalal', 'bar' => 'lululu'));
8383
$client->getHistogram('test', 'some_metric')->observe(7, array('foo' => 'lalal', 'bar' => 'lululu'));
8484
$client->flush();
8585

86-
$client = new Client($this->newRedisAdapter());
86+
$client = new Registry($this->newRedisAdapter());
8787
$this->assertThat(
8888
$client->toText(),
8989
$this->equalTo(<<<EOF
@@ -104,6 +104,6 @@ public function itShouldSaveHistogramsInRedis()
104104

105105
private function newRedisAdapter()
106106
{
107-
return new RedisAdapter('127.0.0.1');
107+
return new RedisAdapter('192.168.59.100');
108108
}
109109
}

0 commit comments

Comments
 (0)