1
0
mirror of https://github.com/danog/MadelineProto.git synced 2024-11-30 04:39:50 +01:00
This commit is contained in:
Daniil Gentili 2024-05-29 22:51:56 +02:00
parent 54c0cbe69f
commit b014adaf0d
2 changed files with 26 additions and 1 deletions

2
docs

@ -1 +1 @@
Subproject commit 6bfc02901884587f9ebcc1bb86766efa887e3aaf
Subproject commit 6a47633e88e55ce95846f4f89dc2d774b9742a83

View File

@ -45,6 +45,8 @@ use danog\MadelineProto\Settings\Database\Redis;
use danog\MadelineProto\SimpleEventHandler;
use danog\MadelineProto\VoIP;
use function Amp\Socket\SocketAddress\fromString;
// MadelineProto is already loaded
if (class_exists(API::class)) {
// Otherwise, if a stable version of MadelineProto was installed via composer, load composer autoloader
@ -310,6 +312,29 @@ $settings->getLogger()->setLevel(Logger::LEVEL_ULTRA_VERBOSE);
// $settings->setDb((new Postgres)->setDatabase('MadelineProto')->setUsername('daniil')->setPassword('pony'));
// $settings->setDb((new Mysql)->setDatabase('MadelineProto')->setUsername('daniil')->setPassword('pony'));
// You can also enable collection of additional prometheus metrics.
// $settings->getMetrics()->setEnablePrometheusCollection(true);
// You can also enable collection of additional memory profiling metrics.
// Note: you must also set the MEMPROF_PROFILE=1 environment variable or GET parameter.
// $settings->getMetrics()->setEnableMemprofCollection(true);
// Metrics can be returned by an autoconfigured http://127.0.0.1:12345 HTTP server.
//
// Endpoints:
//
// /metrics - Prometheus metrics
// /debug/pprof - PProf memory profile for pyroscope
//
// $settings->getMetrics()->setMetricsBindTo(fromString("127.0.0.1:12345"));
// Metrics can also be returned by the current script via web, if called with a specific query string:
//
// ?metrics - Prometheus metrics
// ?pprof - PProf memory profile for pyroscope
//
// $settings->getMetrics()->setReturnMetricsFromStartAndLoop(true);
// For users or bots
MyEventHandler::startAndLoop('bot.madeline', $settings);