From bca3902fb6959f33268a8ac3fce44fa714a7006e Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Wed, 29 May 2024 23:31:32 +0200 Subject: [PATCH] Add docs --- README.md | 1 + docs | 2 +- src/GarbageCollector.php | 1 + tools/build_docs.php | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6899413a8..d8148cf40 100644 --- a/README.md +++ b/README.md @@ -97,6 +97,7 @@ Some of MadelineProto's core components are also available as separate, standalo * [Databases on docker](https://docs.madelineproto.xyz/docs/DOCKER.html#databases-on-docker) * [Web docker](https://docs.madelineproto.xyz/docs/DOCKER.html#web-docker) * [Custom extensions](https://docs.madelineproto.xyz/docs/DOCKER.html#custom-extensions) +* [Metrics](https://docs.madelineproto.xyz/docs/METRICS.html) - MadelineProto can expose many useful metrics, that can be visualized using the official MadelineProto Grafana dashboard. * [Installation](https://docs.madelineproto.xyz/docs/INSTALLATION.html) - There are various ways to install MadelineProto: * [Simple](https://docs.madelineproto.xyz/docs/INSTALLATION.html#simple) * [Composer from existing project](https://docs.madelineproto.xyz/docs/INSTALLATION.html#composer-from-existing-project) diff --git a/docs b/docs index 6a47633e8..9cf886d25 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit 6a47633e88e55ce95846f4f89dc2d774b9742a83 +Subproject commit 9cf886d25e36c6e7fba442dc7da320bd3fad5b5c diff --git a/src/GarbageCollector.php b/src/GarbageCollector.php index 5b74ac0e7..8ffe04284 100644 --- a/src/GarbageCollector.php +++ b/src/GarbageCollector.php @@ -76,6 +76,7 @@ final class GarbageCollector self::$inuse = self::$prometheus->registerGauge("MadelineProto", "php_memstats_inuse_bytes", "RAM actually used by PHP"); $counter = self::$prometheus->registerCounter("MadelineProto", "explicit_gc_count", "Number of times the GC was explicitly invoked"); + $counter->incBy(0); EventLoop::unreference(EventLoop::repeat(1, static function () use ($counter): void { $currentMemory = self::getMemoryConsumption(); if ($currentMemory > self::$memoryConsumption + self::$memoryDiffMb) { diff --git a/tools/build_docs.php b/tools/build_docs.php index 168bcada9..131f2d12b 100755 --- a/tools/build_docs.php +++ b/tools/build_docs.php @@ -99,6 +99,7 @@ $order = [ 'FEATURES', 'REQUIREMENTS', 'DOCKER', + 'METRICS', 'INSTALLATION', 'BROADCAST', 'UPDATES',