Pārlūkot izejas kodu

Merge pull request #4233 from naderman/output-ruleset-size

Output the number of rules used in the solver for profiling purposes
Nils Adermann 9 gadi atpakaļ
vecāks
revīzija
5d7036e740

+ 5 - 0
src/Composer/DependencyResolver/Solver.php

@@ -50,6 +50,11 @@ class Solver
         $this->ruleSetGenerator = new RuleSetGenerator($policy, $pool);
     }
 
+    public function getRuleSetSize()
+    {
+        return count($this->rules);
+    }
+
     // aka solver_makeruledecisions
     private function makeAssertionRuleDecisions()
     {

+ 1 - 0
src/Composer/Installer.php

@@ -513,6 +513,7 @@ class Installer
 
         if ($this->io->isVerbose()) {
             $this->io->writeError("Analyzed ".count($pool)." packages to resolve dependencies");
+            $this->io->writeError("Analyzed ".$solver->getRuleSetSize()." rules to resolve dependencies");
         }
 
         // force dev packages to be updated if we update or install from a (potentially new) lock