|
@@ -22,6 +22,7 @@ use Packagist\WebBundle\Entity\Package;
|
|
|
use Doctrine\DBAL\Connection;
|
|
|
use Packagist\WebBundle\HealthCheck\MetadataDirCheck;
|
|
|
use Predis\Client;
|
|
|
+use Graze\DogStatsD\Client as StatsDClient;
|
|
|
|
|
|
/**
|
|
|
* @author Jordi Boggiano <j.boggiano@seld.be>
|
|
@@ -117,6 +118,11 @@ class SymlinkDumper
|
|
|
*/
|
|
|
private $awsMeta;
|
|
|
|
|
|
+ /**
|
|
|
+ * @var StatsDClient
|
|
|
+ */
|
|
|
+ private $statsd;
|
|
|
+
|
|
|
/**
|
|
|
* Constructor
|
|
|
*
|
|
@@ -127,7 +133,7 @@ class SymlinkDumper
|
|
|
* @param string $targetDir
|
|
|
* @param int $compress
|
|
|
*/
|
|
|
- public function __construct(RegistryInterface $doctrine, Filesystem $filesystem, UrlGeneratorInterface $router, Client $redis, $webDir, $targetDir, $compress, $awsMetadata)
|
|
|
+ public function __construct(RegistryInterface $doctrine, Filesystem $filesystem, UrlGeneratorInterface $router, Client $redis, $webDir, $targetDir, $compress, $awsMetadata, StatsDClient $statsd)
|
|
|
{
|
|
|
$this->doctrine = $doctrine;
|
|
|
$this->fs = $filesystem;
|
|
@@ -138,6 +144,7 @@ class SymlinkDumper
|
|
|
$this->compress = $compress;
|
|
|
$this->redis = $redis;
|
|
|
$this->awsMeta = $awsMetadata;
|
|
|
+ $this->statsd = $statsd;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -507,6 +514,8 @@ class SymlinkDumper
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ $this->statsd->increment('packagist.metadata_dump');
|
|
|
+
|
|
|
// TODO when a package is deleted, it should be removed from provider files, or marked for removal at least
|
|
|
return true;
|
|
|
}
|