File tree Expand file tree Collapse file tree 9 files changed +229
-0
lines changed
tests/Test/Prometheus/Predis Expand file tree Collapse file tree 9 files changed +229
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ declare (strict_types=1 );
4
+
5
+ namespace Test \Prometheus \Predis ;
6
+
7
+ use Predis \Client ;
8
+ use Prometheus \Storage \Redis ;
9
+ use Test \Prometheus \AbstractCollectorRegistryTest ;
10
+
11
+ /**
12
+ * @requires extension redis
13
+ */
14
+ class CollectorRegistryTest extends AbstractCollectorRegistryTest
15
+ {
16
+ public function configureAdapter (): void
17
+ {
18
+ $ connection = new Client (['host ' => REDIS_HOST ]);
19
+
20
+ $ this ->adapter = Redis::fromExistingConnection ($ connection );
21
+ $ this ->adapter ->wipeStorage ();
22
+ }
23
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ declare (strict_types=1 );
4
+
5
+ namespace Test \Prometheus \Predis ;
6
+
7
+ use Predis \Client ;
8
+ use Prometheus \Storage \Redis ;
9
+ use Test \Prometheus \AbstractCounterTest ;
10
+
11
+ /**
12
+ * See https://prometheus.io/docs/instrumenting/exposition_formats/
13
+ *
14
+ * @requires extension redis
15
+ */
16
+ class CounterTest extends AbstractCounterTest
17
+ {
18
+ public function configureAdapter (): void
19
+ {
20
+ $ connection = new Client (['host ' => REDIS_HOST ]);
21
+
22
+ $ this ->adapter = Redis::fromExistingConnection ($ connection );
23
+ $ this ->adapter ->wipeStorage ();
24
+ }
25
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ declare (strict_types=1 );
4
+
5
+ namespace Test \Prometheus \Predis ;
6
+
7
+ use Predis \Client ;
8
+ use Prometheus \Storage \Redis ;
9
+ use Test \Prometheus \AbstractCounterTest ;
10
+
11
+ /**
12
+ * See https://prometheus.io/docs/instrumenting/exposition_formats/
13
+ *
14
+ * @requires extension redis
15
+ */
16
+ class CounterWithPrefixTest extends AbstractCounterTest
17
+ {
18
+ public function configureAdapter (): void
19
+ {
20
+ $ connection = new Client (['host ' => REDIS_HOST , 'prefix ' => 'prefix: ' ]);
21
+
22
+ $ this ->adapter = Redis::fromExistingConnection ($ connection );
23
+ $ this ->adapter ->wipeStorage ();
24
+ }
25
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ declare (strict_types=1 );
4
+
5
+ namespace Test \Prometheus \Predis ;
6
+
7
+ use Predis \Client ;
8
+ use Prometheus \Storage \Redis ;
9
+ use Test \Prometheus \AbstractGaugeTest ;
10
+
11
+ /**
12
+ * See https://prometheus.io/docs/instrumenting/exposition_formats/
13
+ *
14
+ * @requires extension redis
15
+ */
16
+ class GaugeTest extends AbstractGaugeTest
17
+ {
18
+ public function configureAdapter (): void
19
+ {
20
+ $ connection = new Client (['host ' => REDIS_HOST ]);
21
+
22
+ $ this ->adapter = Redis::fromExistingConnection ($ connection );
23
+ $ this ->adapter ->wipeStorage ();
24
+ }
25
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ declare (strict_types=1 );
4
+
5
+ namespace Test \Prometheus \Predis ;
6
+
7
+ use Predis \Client ;
8
+ use Prometheus \Storage \Redis ;
9
+ use Test \Prometheus \AbstractGaugeTest ;
10
+
11
+ /**
12
+ * See https://prometheus.io/docs/instrumenting/exposition_formats/
13
+ *
14
+ * @requires extension redis
15
+ */
16
+ class GaugeWithPrefixTest extends AbstractGaugeTest
17
+ {
18
+ public function configureAdapter (): void
19
+ {
20
+ $ connection = new Client (['host ' => REDIS_HOST , 'prefix ' => 'prefix: ' ]);
21
+
22
+ $ this ->adapter = Redis::fromExistingConnection ($ connection );
23
+ $ this ->adapter ->wipeStorage ();
24
+ }
25
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ declare (strict_types=1 );
4
+
5
+ namespace Test \Prometheus \Predis ;
6
+
7
+ use Predis \Client ;
8
+ use Prometheus \Storage \Redis ;
9
+ use Test \Prometheus \AbstractHistogramTest ;
10
+
11
+ /**
12
+ * See https://prometheus.io/docs/instrumenting/exposition_formats/
13
+ *
14
+ * @requires extension redis
15
+ */
16
+ class HistogramTest extends AbstractHistogramTest
17
+ {
18
+ public function configureAdapter (): void
19
+ {
20
+ $ connection = new Client (['host ' => REDIS_HOST ]);
21
+
22
+ $ this ->adapter = Redis::fromExistingConnection ($ connection );
23
+ $ this ->adapter ->wipeStorage ();
24
+ }
25
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ declare (strict_types=1 );
4
+
5
+ namespace Test \Prometheus \Predis ;
6
+
7
+ use Predis \Client ;
8
+ use Prometheus \Storage \Redis ;
9
+ use Test \Prometheus \AbstractHistogramTest ;
10
+
11
+ /**
12
+ * See https://prometheus.io/docs/instrumenting/exposition_formats/
13
+ *
14
+ * @requires extension redis
15
+ */
16
+ class HistogramWithPrefixTest extends AbstractHistogramTest
17
+ {
18
+ public function configureAdapter (): void
19
+ {
20
+ $ connection = new Client (['host ' => REDIS_HOST , 'prefix ' => 'prefix: ' ]);
21
+
22
+ $ this ->adapter = Redis::fromExistingConnection ($ connection );
23
+ $ this ->adapter ->wipeStorage ();
24
+ }
25
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ declare (strict_types=1 );
4
+
5
+ namespace Test \Prometheus \Predis ;
6
+
7
+ use Predis \Client ;
8
+ use Prometheus \Storage \Redis ;
9
+ use Test \Prometheus \AbstractSummaryTest ;
10
+
11
+ /**
12
+ * See https://prometheus.io/docs/instrumenting/exposition_formats/
13
+ *
14
+ * @requires extension redis
15
+ */
16
+ class SummaryTest extends AbstractSummaryTest
17
+ {
18
+ public function configureAdapter (): void
19
+ {
20
+ $ connection = new Client (['host ' => REDIS_HOST ]);
21
+
22
+ $ this ->adapter = Redis::fromExistingConnection ($ connection );
23
+ $ this ->adapter ->wipeStorage ();
24
+ }
25
+
26
+ /** @test */
27
+ public function it_should_observe_with_labels (): void
28
+ {
29
+ parent ::itShouldObserveWithLabels (); // TODO: Change the autogenerated stub
30
+ }
31
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ declare (strict_types=1 );
4
+
5
+ namespace Test \Prometheus \Predis ;
6
+
7
+ use Predis \Client ;
8
+ use Prometheus \Storage \Redis ;
9
+ use Test \Prometheus \AbstractSummaryTest ;
10
+
11
+ /**
12
+ * See https://prometheus.io/docs/instrumenting/exposition_formats/
13
+ *
14
+ * @requires extension redis
15
+ */
16
+ class SummaryWithPrefixTest extends AbstractSummaryTest
17
+ {
18
+ public function configureAdapter (): void
19
+ {
20
+ $ connection = new Client (['host ' => REDIS_HOST , 'prefix ' => 'prefix: ' ]);
21
+
22
+ $ this ->adapter = Redis::fromExistingConnection ($ connection );
23
+ $ this ->adapter ->wipeStorage ();
24
+ }
25
+ }
You can’t perform that action at this time.
0 commit comments