From 13cadf3accb566bb1b4d6668a1feb2664e9d2ca4 Mon Sep 17 00:00:00 2001 From: Jeroen De Meerleer Date: Mon, 3 Jun 2024 14:00:10 +0200 Subject: [PATCH] Refactor metric configurations for HTTP requests - Restructured config to include 'http' with url and data fields for each metric. Added metrics 3 and 4 with specific data outputs. --- config.example.php | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/config.example.php b/config.example.php index 535fbc3..0dafe17 100644 --- a/config.example.php +++ b/config.example.php @@ -7,7 +7,24 @@ $config = [ ], 'app_demo_metric2' => [ 'help' => 'Help text for metric', - 'httpurl' => 'http://example.com', // The url to get collected for the metric + 'http' => [ + 'url' => 'http://example.com', // The url to get collected for the metric + 'data' => 'responsebody' // The body is used as output + ], 'jsonelem' => '0.metric', ], + 'app_demo_metric3' => [ + 'help' => 'Help text for metric', + 'http' => [ + 'url' => 'http://example.com', // The url to get collected for the metric + 'data' => 'hasresponse' // If an error occured during request this will return 0, otherwise 1 + ], + ], + 'app_demo_metric4' => [ + 'help' => 'Help text for metric', + 'http' => [ + 'url' => 'http://example.com', // The url to get collected for the metric + 'data' => 'responsetime' // This will return the transfer time + ], + ], ]; \ No newline at end of file