jdecool/scaleway-runtimepublic Fork
⑂ v0.3.0
Commits
⬇ Clone ▾
git clone https://git.rickub.com/jdecool/scaleway-runtime.git
git clone ssh://git@rickub.com/jdecool/scaleway-runtime.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

Download ZIP
ci: measure the Function Runtimes weekly and propose catalogue updates 37de7fdUnverified · on v0.3.0 · Jérémy DECOOL · 2d ago
catalogue.php · 21 lines · 886 BPHP Blame HistoryRaw
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
<?php

declare(strict_types=1);

/*
 * Regenerates resources/function-runtimes.php from the probe outputs in tests/Fixtures/FunctionRuntimes,
 * saved with the probe's "runtime" mode, and prints what changed: see docs/probe-results.md#function-runtime-catalogue.
 */

use JDecool\ScalewayRuntime\FunctionRuntimeCatalogue;

require __DIR__.'/../vendor/autoload.php';

$old = FunctionRuntimeCatalogue::load();
$files = glob(__DIR__.'/../tests/Fixtures/FunctionRuntimes/*.json') ?: [];
file_put_contents(FunctionRuntimeCatalogue::FILE, FunctionRuntimeCatalogue::generate(array_map(static fn (string $file): string => (string) file_get_contents($file), $files)));

// Prints what changed, nothing when only the measurement dates did: the freshness workflow opens a pull request on output.
foreach (FunctionRuntimeCatalogue::load()->changes($old) as $change) {
    echo $change, \PHP_EOL;
}