From 6327828ed03d61f5dc2b35c92a9d8bce3d9c7529 Mon Sep 17 00:00:00 2001 From: Michele Tartara <mtartara@google.com> Date: Wed, 24 Apr 2013 09:24:16 +0000 Subject: [PATCH] Produce a report for all the data collectors Implement the API function of the monitoring daemon that provides the report of all the data collectors. Signed-off-by: Michele Tartara <mtartara@google.com> Reviewed-by: Helga Velroyen <helgav@google.com> --- src/Ganeti/Monitoring/Server.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Ganeti/Monitoring/Server.hs b/src/Ganeti/Monitoring/Server.hs index 9a9af404f..1f311e1f3 100644 --- a/src/Ganeti/Monitoring/Server.hs +++ b/src/Ganeti/Monitoring/Server.hs @@ -139,7 +139,9 @@ reportHandler = -- | Return the report of all the available collectors. allReports :: Snap () -allReports = writeText "TODO: return the reports of all the collectors" +allReports = do + reports <- mapM (liftIO . dReport) collectors + writeBS . pack . J.encode $ reports -- | Returns a category given its name. -- If "collector" is given as the name, the collector has no category, and -- GitLab