diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1dc5d15..1e4a07c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,12 +12,12 @@ jobs: strategy: fail-fast: false matrix: - php: [7.4] + php: [7.4, "8.0", 8.1] composer: [lowest, current, highest] needs: lint runs-on: ubuntu-latest container: - image: wyrihaximusnet/php:${{ matrix.php }}-zts-alpine3.12-dev-root + image: wyrihaximusnet/php:${{ matrix.php }}-nts-alpine-dev-root steps: - uses: actions/checkout@v1 - name: Cache composer packages @@ -38,13 +38,13 @@ jobs: strategy: fail-fast: false matrix: - php: [7.4] + php: [7.4, "8.0", 8.1] composer: [lowest, current, highest] - qa: [lint, cs, stan, psalm, unit-ci, infection, composer-require-checker, composer-unused] + qa: [lint, cs, stan, psalm, unit, infection, composer-require-checker, composer-unused] needs: composer-install runs-on: ubuntu-latest container: - image: wyrihaximusnet/php:${{ matrix.php }}-zts-alpine3.12-dev-root + image: wyrihaximusnet/php:${{ matrix.php }}-nts-alpine-dev-root steps: - uses: actions/checkout@v1 - name: Cache composer packages diff --git a/.gitignore b/.gitignore index 3a693c9..f686202 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,11 @@ composer.phar vendor/ +.phpcs.cache +.phpunit.result.cache +build/ +covHtml/ +infection-log.txt +.idea # Commit your application's lock file http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file # You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file diff --git a/Makefile b/Makefile index c464cf3..85e66ba 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ # set all to phony -SHELL=bash +SHELL=sh .PHONY: * diff --git a/composer.json b/composer.json index 27c288b..b16bbdc 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,7 @@ "require-dev": { "ringcentral/psr7": "^1.3.0", "thecodingmachine/safe": "^1.2", - "wyrihaximus/async-test-utilities": "^3.2 || ^4.0" + "wyrihaximus/async-test-utilities": "^4.0.6" }, "config": { "platform": { diff --git a/composer.lock b/composer.lock index 5d535f2..d1f0359 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "34a22e2746381529fa36c7a0c7c2ba46", + "content-hash": "ab670b688e35233eb3e08948e234c36b", "packages": [ { "name": "lcobucci/clock", @@ -367,20 +367,20 @@ }, { "name": "wyrihaximus/constants", - "version": "1.6.0", + "version": "1.5.0", "source": { "type": "git", "url": "https://github.com/WyriHaximus/php-constants.git", - "reference": "32ceffdd881593c7fa24d8fcbf9deb58687484cb" + "reference": "a2202b683261f8119f3772eb1e3469a2b5c4d9eb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/WyriHaximus/php-constants/zipball/32ceffdd881593c7fa24d8fcbf9deb58687484cb", - "reference": "32ceffdd881593c7fa24d8fcbf9deb58687484cb", + "url": "https://api.github.com/repos/WyriHaximus/php-constants/zipball/a2202b683261f8119f3772eb1e3469a2b5c4d9eb", + "reference": "a2202b683261f8119f3772eb1e3469a2b5c4d9eb", "shasum": "" }, "require": { - "php": "^8 || ^7 || ^5.3" + "php": "^7.0 || ^5.3" }, "type": "library", "autoload": { @@ -405,28 +405,22 @@ "description": "Collection of constants for PHP", "support": { "issues": "https://github.com/WyriHaximus/php-constants/issues", - "source": "https://github.com/WyriHaximus/php-constants/tree/1.6.0" + "source": "https://github.com/WyriHaximus/php-constants/tree/master" }, - "funding": [ - { - "url": "https://github.com/WyriHaximus", - "type": "github" - } - ], - "time": "2020-11-28T12:04:43+00:00" + "time": "2020-04-02T21:00:04+00:00" }, { "name": "wyrihaximus/metrics", - "version": "1.0.2", + "version": "1.0.1", "source": { "type": "git", "url": "https://github.com/WyriHaximus/php-metrics.git", - "reference": "cdf8ee62b5fa6b253ec8823070ea112671757f9a" + "reference": "91dc0d437b63a2516abc4c8c69220857663dcf2f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/WyriHaximus/php-metrics/zipball/cdf8ee62b5fa6b253ec8823070ea112671757f9a", - "reference": "cdf8ee62b5fa6b253ec8823070ea112671757f9a", + "url": "https://api.github.com/repos/WyriHaximus/php-metrics/zipball/91dc0d437b63a2516abc4c8c69220857663dcf2f", + "reference": "91dc0d437b63a2516abc4c8c69220857663dcf2f", "shasum": "" }, "require": { @@ -459,7 +453,7 @@ "description": "🕵️‍♀️ Prometheus modelled metric VO's and registry", "support": { "issues": "https://github.com/WyriHaximus/php-metrics/issues", - "source": "https://github.com/WyriHaximus/php-metrics/tree/1.0.2" + "source": "https://github.com/WyriHaximus/php-metrics/tree/1.0.1" }, "funding": [ { @@ -467,7 +461,7 @@ "type": "github" } ], - "time": "2020-11-17T22:53:16+00:00" + "time": "2020-11-15T22:52:35+00:00" } ], "packages-dev": [ @@ -773,16 +767,16 @@ }, { "name": "composer/ca-bundle", - "version": "1.2.11", + "version": "1.3.1", "source": { "type": "git", "url": "https://github.com/composer/ca-bundle.git", - "reference": "0b072d51c5a9c6f3412f7ea3ab043d6603cb2582" + "reference": "4c679186f2aca4ab6a0f1b0b9cf9252decb44d0b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/0b072d51c5a9c6f3412f7ea3ab043d6603cb2582", - "reference": "0b072d51c5a9c6f3412f7ea3ab043d6603cb2582", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/4c679186f2aca4ab6a0f1b0b9cf9252decb44d0b", + "reference": "4c679186f2aca4ab6a0f1b0b9cf9252decb44d0b", "shasum": "" }, "require": { @@ -829,7 +823,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/ca-bundle/issues", - "source": "https://github.com/composer/ca-bundle/tree/1.2.11" + "source": "https://github.com/composer/ca-bundle/tree/1.3.1" }, "funding": [ { @@ -845,7 +839,7 @@ "type": "tidelift" } ], - "time": "2021-09-25T20:32:43+00:00" + "time": "2021-10-28T20:44:15+00:00" }, { "name": "composer/composer", @@ -3136,16 +3130,16 @@ }, { "name": "nikic/php-parser", - "version": "v4.13.0", + "version": "v4.13.1", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "50953a2691a922aa1769461637869a0a2faa3f53" + "reference": "63a79e8daa781cac14e5195e63ed8ae231dd10fd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/50953a2691a922aa1769461637869a0a2faa3f53", - "reference": "50953a2691a922aa1769461637869a0a2faa3f53", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/63a79e8daa781cac14e5195e63ed8ae231dd10fd", + "reference": "63a79e8daa781cac14e5195e63ed8ae231dd10fd", "shasum": "" }, "require": { @@ -3186,9 +3180,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.13.0" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.13.1" }, - "time": "2021-09-20T12:20:58+00:00" + "time": "2021-11-03T20:52:16+00:00" }, { "name": "nikolaposa/version", @@ -4474,23 +4468,23 @@ }, { "name": "phpunit/php-code-coverage", - "version": "9.2.7", + "version": "9.2.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "d4c798ed8d51506800b441f7a13ecb0f76f12218" + "reference": "cf04e88a2e3c56fc1a65488afd493325b4c1bc3e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/d4c798ed8d51506800b441f7a13ecb0f76f12218", - "reference": "d4c798ed8d51506800b441f7a13ecb0f76f12218", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/cf04e88a2e3c56fc1a65488afd493325b4c1bc3e", + "reference": "cf04e88a2e3c56fc1a65488afd493325b4c1bc3e", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^4.12.0", + "nikic/php-parser": "^4.13.0", "php": ">=7.3", "phpunit/php-file-iterator": "^3.0.3", "phpunit/php-text-template": "^2.0.2", @@ -4539,7 +4533,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.7" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.8" }, "funding": [ { @@ -4547,7 +4541,7 @@ "type": "github" } ], - "time": "2021-09-17T05:39:03+00:00" + "time": "2021-10-30T08:01:38+00:00" }, { "name": "phpunit/php-file-iterator", @@ -5658,16 +5652,16 @@ }, { "name": "sanmai/pipeline", - "version": "v5.2.0", + "version": "v5.2.1", "source": { "type": "git", "url": "https://github.com/sanmai/pipeline.git", - "reference": "34232df0bd3bd27798fa5d0be1fc22e8395129cf" + "reference": "2b5509a7635143165041109eb1c393c8515724f1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sanmai/pipeline/zipball/34232df0bd3bd27798fa5d0be1fc22e8395129cf", - "reference": "34232df0bd3bd27798fa5d0be1fc22e8395129cf", + "url": "https://api.github.com/repos/sanmai/pipeline/zipball/2b5509a7635143165041109eb1c393c8515724f1", + "reference": "2b5509a7635143165041109eb1c393c8515724f1", "shasum": "" }, "require": { @@ -5711,7 +5705,7 @@ "description": "General-purpose collections pipeline", "support": { "issues": "https://github.com/sanmai/pipeline/issues", - "source": "https://github.com/sanmai/pipeline/tree/v5.2.0" + "source": "https://github.com/sanmai/pipeline/tree/v5.2.1" }, "funding": [ { @@ -5719,7 +5713,7 @@ "type": "github" } ], - "time": "2021-10-10T13:44:01+00:00" + "time": "2021-11-01T10:09:55+00:00" }, { "name": "sebastian/cli-parser", @@ -6915,16 +6909,16 @@ }, { "name": "symfony/config", - "version": "v5.3.4", + "version": "v5.3.10", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "4268f3059c904c61636275182707f81645517a37" + "reference": "ac23c2f24d5634966d665d836c3933d54347e5d4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/4268f3059c904c61636275182707f81645517a37", - "reference": "4268f3059c904c61636275182707f81645517a37", + "url": "https://api.github.com/repos/symfony/config/zipball/ac23c2f24d5634966d665d836c3933d54347e5d4", + "reference": "ac23c2f24d5634966d665d836c3933d54347e5d4", "shasum": "" }, "require": { @@ -6974,7 +6968,7 @@ "description": "Helps you find, load, combine, autofill and validate configuration values of any kind", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/config/tree/v5.3.4" + "source": "https://github.com/symfony/config/tree/v5.3.10" }, "funding": [ { @@ -6990,20 +6984,20 @@ "type": "tidelift" } ], - "time": "2021-07-21T12:40:44+00:00" + "time": "2021-10-22T09:06:52+00:00" }, { "name": "symfony/console", - "version": "v5.3.7", + "version": "v5.3.10", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "8b1008344647462ae6ec57559da166c2bfa5e16a" + "reference": "d4e409d9fbcfbf71af0e5a940abb7b0b4bad0bd3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/8b1008344647462ae6ec57559da166c2bfa5e16a", - "reference": "8b1008344647462ae6ec57559da166c2bfa5e16a", + "url": "https://api.github.com/repos/symfony/console/zipball/d4e409d9fbcfbf71af0e5a940abb7b0b4bad0bd3", + "reference": "d4e409d9fbcfbf71af0e5a940abb7b0b4bad0bd3", "shasum": "" }, "require": { @@ -7073,7 +7067,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.3.7" + "source": "https://github.com/symfony/console/tree/v5.3.10" }, "funding": [ { @@ -7089,7 +7083,7 @@ "type": "tidelift" } ], - "time": "2021-08-25T20:02:16+00:00" + "time": "2021-10-26T09:30:15+00:00" }, { "name": "symfony/deprecation-contracts", @@ -8053,16 +8047,16 @@ }, { "name": "symfony/string", - "version": "v5.3.7", + "version": "v5.3.10", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "8d224396e28d30f81969f083a58763b8b9ceb0a5" + "reference": "d70c35bb20bbca71fc4ab7921e3c6bda1a82a60c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/8d224396e28d30f81969f083a58763b8b9ceb0a5", - "reference": "8d224396e28d30f81969f083a58763b8b9ceb0a5", + "url": "https://api.github.com/repos/symfony/string/zipball/d70c35bb20bbca71fc4ab7921e3c6bda1a82a60c", + "reference": "d70c35bb20bbca71fc4ab7921e3c6bda1a82a60c", "shasum": "" }, "require": { @@ -8116,7 +8110,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.3.7" + "source": "https://github.com/symfony/string/tree/v5.3.10" }, "funding": [ { @@ -8132,7 +8126,7 @@ "type": "tidelift" } ], - "time": "2021-08-26T08:00:08+00:00" + "time": "2021-10-27T18:21:46+00:00" }, { "name": "symfony/yaml", @@ -8373,16 +8367,16 @@ }, { "name": "vimeo/psalm", - "version": "4.11.1", + "version": "4.11.2", "source": { "type": "git", "url": "https://github.com/vimeo/psalm.git", - "reference": "e33492398bd4e5e2ab60e331d445979bd83feecd" + "reference": "6fba5eb554f9507b72932f9c75533d8af593688d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vimeo/psalm/zipball/e33492398bd4e5e2ab60e331d445979bd83feecd", - "reference": "e33492398bd4e5e2ab60e331d445979bd83feecd", + "url": "https://api.github.com/repos/vimeo/psalm/zipball/6fba5eb554f9507b72932f9c75533d8af593688d", + "reference": "6fba5eb554f9507b72932f9c75533d8af593688d", "shasum": "" }, "require": { @@ -8472,9 +8466,9 @@ ], "support": { "issues": "https://github.com/vimeo/psalm/issues", - "source": "https://github.com/vimeo/psalm/tree/4.11.1" + "source": "https://github.com/vimeo/psalm/tree/4.11.2" }, - "time": "2021-10-24T12:29:22+00:00" + "time": "2021-10-26T17:28:17+00:00" }, { "name": "webmozart/assert", diff --git a/src/Metrics.php b/src/Metrics.php index 2878278..35354e4 100644 --- a/src/Metrics.php +++ b/src/Metrics.php @@ -6,7 +6,11 @@ use WyriHaximus\Metrics\Factory; use WyriHaximus\Metrics\Label; +use WyriHaximus\Metrics\Label\Name; use WyriHaximus\Metrics\Registry; +use WyriHaximus\Metrics\Registry\Counters; +use WyriHaximus\Metrics\Registry\Gauges; +use WyriHaximus\Metrics\Registry\Summaries; use function array_map; @@ -15,11 +19,11 @@ final class Metrics /** @var array