File tree Expand file tree Collapse file tree
HorizonPrometheusExporter Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Tests \HorizonPrometheusExporter ;
4+
5+ use LKDevelopment \HorizonPrometheusExporter \Repository \ExporterRepository ;
6+ use Prometheus \CollectorRegistry ;
7+ use Tests \TestCase ;
8+
9+ class ExporterRepositoryTest extends TestCase {
10+ public function testCanBeCreated () {
11+ // if nothing is passed to load(), exporters are read from the config at config/horizon-exporter.php
12+ ExporterRepository::load ();
13+ $ registry = ExporterRepository::getRegistry ();
14+ $ this ->assertInstanceOf (CollectorRegistry::class, $ registry );
15+ }
16+ }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Tests \Metrics ;
4+
5+ use App \Metrics \FailedQsBatches ;
6+ use LKDevelopment \HorizonPrometheusExporter \Repository \ExporterRepository ;
7+ use Tests \TestCase ;
8+
9+ class FailedQsBatchesTest extends TestCase {
10+ public function testCanBeCreated () {
11+ ExporterRepository::load ([FailedQsBatches::class]);
12+
13+ self ::assertNotNull (ExporterRepository::getRegistry ());
14+
15+ $ gauge = ExporterRepository::getRegistry ()->getGauge (config ('horizon-exporter.namespace ' ), 'qs_batches_failed_batches ' );
16+
17+ self ::assertNotNull ($ gauge );
18+
19+ }
20+ }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Tests \Metrics ;
4+
5+ use App \Metrics \PendingQsBatches ;
6+ use LKDevelopment \HorizonPrometheusExporter \Repository \ExporterRepository ;
7+ use Tests \TestCase ;
8+
9+ class PendingQsBatchesTest extends TestCase {
10+ public function testCanBeCreated () {
11+ ExporterRepository::load ([PendingQsBatches::class]);
12+
13+ self ::assertNotNull (ExporterRepository::getRegistry ());
14+
15+ $ gauge = ExporterRepository::getRegistry ()->getGauge (config ('horizon-exporter.namespace ' ), 'qs_batches_pending_batches ' );
16+
17+ self ::assertNotNull ($ gauge );
18+ }
19+ }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Tests \Metrics ;
4+
5+ use App \Metrics \WikiEntityImports ;
6+ use LKDevelopment \HorizonPrometheusExporter \Repository \ExporterRepository ;
7+ use Tests \TestCase ;
8+
9+ class WikiEntityImportsTest extends TestCase {
10+ public function testCanBeCreated () {
11+ ExporterRepository::load ([WikiEntityImports::class]);
12+
13+ self ::assertNotNull (ExporterRepository::getRegistry ());
14+
15+ $ gauge = ExporterRepository::getRegistry ()->getGauge (config ('horizon-exporter.namespace ' ), 'wiki_entity_imports_pending ' );
16+
17+ self ::assertNotNull ($ gauge );
18+ }
19+ }
You can’t perform that action at this time.
0 commit comments