44
55namespace Iamfarhad \Prometheus ;
66
7- use InvalidArgumentException ;
87use Iamfarhad \Prometheus \Traits \HasDebugLogging ;
8+ use InvalidArgumentException ;
99use Prometheus \CollectorRegistry ;
1010use Prometheus \Counter ;
1111use Prometheus \Gauge ;
@@ -28,7 +28,7 @@ public function __construct(
2828 ) {
2929 $ this ->debugInfo ('Prometheus instance created ' , [
3030 'namespace ' => $ namespace ,
31- 'registry_class ' => get_class ($ registry )
31+ 'registry_class ' => get_class ($ registry ),
3232 ]);
3333 }
3434
@@ -181,7 +181,7 @@ public function getOrRegisterSummary(
181181
182182 $ this ->debugMetricOperation ('getOrRegisterSummary ' , $ fullName , $ labelNames , [
183183 'max_age_seconds ' => $ maxAgeSeconds ,
184- 'quantiles ' => $ quantiles
184+ 'quantiles ' => $ quantiles,
185185 ]);
186186
187187 return $ this ->registry ->getOrRegisterSummary ($ this ->namespace , $ fullName , $ help , $ labelNames , $ maxAgeSeconds , $ quantiles );
@@ -201,7 +201,7 @@ public function hasMetric(string $name): bool
201201 $ samples = $ this ->registry ->getMetricFamilySamples ();
202202
203203 foreach ($ samples as $ sample ) {
204- if ($ sample ->getName () === $ fullName || $ sample ->getName () === $ this ->namespace . '_ ' . $ fullName ) {
204+ if ($ sample ->getName () === $ fullName || $ sample ->getName () === $ this ->namespace . '_ ' . $ fullName ) {
205205 return true ;
206206 }
207207 }
@@ -217,7 +217,7 @@ public function collect(): array
217217 $ samples = $ this ->registry ->getMetricFamilySamples ();
218218
219219 $ this ->debugTiming ('metrics collection ' , $ startTime , [
220- 'samples_count ' => count ($ samples )
220+ 'samples_count ' => count ($ samples ),
221221 ]);
222222
223223 return $ samples ;
@@ -232,7 +232,7 @@ public function render(): string
232232 $ result = $ renderer ->render ($ this ->collect ());
233233
234234 $ this ->debugTiming ('metrics rendering ' , $ startTime , [
235- 'output_size ' => strlen ($ result )
235+ 'output_size ' => strlen ($ result ),
236236 ]);
237237
238238 return $ result ;
0 commit comments