Skip to content

Commit 6edd9fb

Browse files
committed
Add statsd logs for CDN purge collection
1 parent 089f0eb commit 6edd9fb

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Package/V2Dumper.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,7 @@ private function verifyCdnFiles(bool $verbose = false): void
487487
$cdnContent = $this->fetchCdnFile($relativePath);
488488

489489
if ($localContent !== $cdnContent) {
490+
$this->statsd->increment('packagist.metadata_cdn_purge_warn');
490491
$this->logger->error(
491492
'Mismatch detected for CDN file: '.$relativePath.', purging again',
492493
['file' => $relativePath, 'local' => base64_encode($localContent), 'cdn' => base64_encode($cdnContent)]
@@ -495,13 +496,16 @@ private function verifyCdnFiles(bool $verbose = false): void
495496

496497
$cdnContent = $this->fetchCdnFile($relativePath);
497498
if ($localContent !== $cdnContent) {
499+
$this->statsd->increment('packagist.metadata_cdn_purge_fail');
498500
$this->logger->error(
499501
'Mismatch still present after another cache purge: '.$relativePath,
500502
['file' => $relativePath, 'local' => base64_encode($localContent), 'cdn' => base64_encode($cdnContent)]
501503
);
502504
} else {
503505
$this->logger->info('Cache purge worked now for '.$relativePath);
504506
}
507+
} else {
508+
$this->statsd->increment('packagist.metadata_cdn_purge_ok');
505509
}
506510
}
507511
}

0 commit comments

Comments
 (0)