Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
LKaemmerling authored Nov 6, 2023
2 parents 42557de + 6f306e9 commit 9ec80af
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ jobs:
os: [ ubuntu-latest ]
php: [ 7.4, 8.0, 8.1, 8.2 ]
dependency-version: [ prefer-lowest, prefer-stable ]
redis-version: [ 6 ]
redis-version: [ 5, 6, 7 ]

name: P${{ matrix.php }} - ${{ matrix.dependency-version }} - ${{ matrix.os }}
name: P${{ matrix.php }} - ${{ matrix.dependency-version }} - ${{ matrix.os }} - ${{ matrix.redis-version }}

env:
# The hostname used to communicate with the Redis service container
Expand Down
2 changes: 1 addition & 1 deletion src/Prometheus/CollectorRegistry.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public function wipeStorage(): void
*/
public function getMetricFamilySamples(bool $sortMetrics = true): array
{
return $this->storageAdapter->collect($sortMetrics);
return $this->storageAdapter->collect($sortMetrics); /** @phpstan-ignore-line */
}

/**
Expand Down
1 change: 1 addition & 0 deletions src/Prometheus/Storage/Redis.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ public function wipeStorage(): void

$this->redis->eval(
<<<LUA
redis.replicate_commands()
local cursor = "0"
repeat
local results = redis.call('SCAN', cursor, 'MATCH', ARGV[1])
Expand Down
3 changes: 2 additions & 1 deletion src/Prometheus/Storage/RedisNg.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ public function wipeStorage(): void

$this->redis->eval(
<<<LUA
redis.replicate_commands()
local cursor = "0"
repeat
local results = redis.call('SCAN', cursor, 'MATCH', ARGV[1])
Expand Down Expand Up @@ -474,7 +475,7 @@ private function collectHistograms(): array
*
* @return string
*/
private function removePrefixFromKey(string $key): string
private function removePrefixFromKey(string $key): string /** @phpstan-ignore-line */
{
// @phpstan-ignore-next-line false positive, phpstan thinks getOptions returns int
if ($this->redis->getOption(\Redis::OPT_PREFIX) === null) {
Expand Down
8 changes: 4 additions & 4 deletions tests/Test/BlackBoxTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function gaugesShouldBeOverwritten(): void

];

Promise\settle($promises)->wait();
Promise\Utils::settle($promises)->wait();
$end = microtime(true);
echo "\ntime: " . ($end - $start) . "\n";

Expand Down Expand Up @@ -84,7 +84,7 @@ public function countersShouldIncrementAtomically($increment): void
$n += $increment;
}

Promise\settle($promises)->wait();
Promise\Utils::settle($promises)->wait();
$end = microtime(true);
echo "\ntime: " . ($end - $start) . "\n";

Expand Down Expand Up @@ -124,7 +124,7 @@ public function histogramsShouldIncrementAtomically(): void
$this->client->getAsync('/examples/some_histogram.php?c=9&adapter=' . $this->adapter),
];

Promise\settle($promises)->wait();
Promise\Utils::settle($promises)->wait();
$end = microtime(true);
echo "\ntime: " . ($end - $start) . "\n";

Expand Down Expand Up @@ -168,7 +168,7 @@ public function summariesShouldIncrementAtomically(): void
$this->client->getAsync('/examples/some_summary.php?c=10&adapter=' . $this->adapter),
];

Promise\settle($promises)->wait();
Promise\Utils::settle($promises)->wait();
$end = microtime(true);
echo "\ntime: " . ($end - $start) . "\n";

Expand Down

0 comments on commit 9ec80af

Please sign in to comment.