Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/Metrics/FailedQsBatches.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
class FailedQsBatches implements Exporter {
protected $gauge;

public function metrics(CollectorRegistry $collectorRegistry) {
public function metrics(CollectorRegistry $collectorRegistry): void {
$this->gauge = $collectorRegistry->getOrRegisterGauge(
config('horizon-exporter.namespace'),
'qs_batches_failed_batches',
'The number of QueryService batches marked as failed',
);
}

public function collect() {
public function collect(): void {
$numBatches = QsBatch::has('wiki')->where([
'failed' => 1,
])->count();
Expand Down
4 changes: 2 additions & 2 deletions app/Metrics/PendingQsBatches.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
class PendingQsBatches implements Exporter {
protected $gauge;

public function metrics(CollectorRegistry $collectorRegistry) {
public function metrics(CollectorRegistry $collectorRegistry): void {
$this->gauge = $collectorRegistry->getOrRegisterGauge(
config('horizon-exporter.namespace'),
'qs_batches_pending_batches',
'The number of QueryService batches waiting to be processed',
);
}

public function collect() {
public function collect(): void {
$numBatches = QsBatch::has('wiki')->where([
'done' => 0,
'failed' => 0,
Expand Down
4 changes: 2 additions & 2 deletions app/Metrics/WikiEntityImports.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
class WikiEntityImports implements Exporter {
protected $pending;

public function metrics(CollectorRegistry $collectorRegistry) {
public function metrics(CollectorRegistry $collectorRegistry): void {
$this->pending = $collectorRegistry->getOrRegisterGauge(
config('horizon-exporter.namespace'),
'wiki_entity_imports_pending',
'The number of pending Entity imports currently being processed.',
);
}

public function collect() {
public function collect(): void {
// counters for failed / success are incremented in the HTTP controller
$this->pending->set(
WikiEntityImport::where(['status' => WikiEntityImportStatus::Pending])->count()
Expand Down
63 changes: 33 additions & 30 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions config/horizon-exporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
use App\Metrics\PendingQsBatches;
use App\Metrics\WikiEntityImports;
use LKDevelopment\HorizonPrometheusExporter\Exporter\CurrentMasterSupervisors;
use LKDevelopment\HorizonPrometheusExporter\Exporter\CurrentProccesesPerQueue;
use LKDevelopment\HorizonPrometheusExporter\Exporter\CurrentProcessesPerQueue;
use LKDevelopment\HorizonPrometheusExporter\Exporter\CurrentWorkload;
use LKDevelopment\HorizonPrometheusExporter\Exporter\FailedJobsPerHour;
use LKDevelopment\HorizonPrometheusExporter\Exporter\HorizonStatus;
Expand All @@ -30,7 +30,7 @@
CurrentMasterSupervisors::class,
JobsPerMinute::class,
CurrentWorkload::class,
CurrentProccesesPerQueue::class,
CurrentProcessesPerQueue::class,
FailedJobsPerHour::class,
HorizonStatus::class,
RecentJobs::class,
Expand Down
Loading