changeset 4777:883ad8b0a7c0

mod_http_admin_api: Export total storage use via mod_http_file_share Does not include size of other user data, chat logs etc. Uploads will likely be a significant fraction of total storage use.
author Kim Alvefur <zash@zash.se>
date Thu, 18 Nov 2021 19:28:43 +0100
parents 13e913471b75
children 229f2a79ad6f
files mod_http_admin_api/mod_http_admin_api.lua mod_http_admin_api/openapi.yaml
diffstat 2 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mod_http_admin_api/mod_http_admin_api.lua	Thu Nov 18 19:26:07 2021 +0100
+++ b/mod_http_admin_api/mod_http_admin_api.lua	Thu Nov 18 19:28:43 2021 +0100
@@ -621,6 +621,7 @@
 	result.memory = maybe_export_plain_gauge(families.process_resident_memory_bytes);
 	result.cpu = maybe_export_plain_counter(families.process_cpu_seconds);
 	result.c2s = maybe_export_summed_gauge(families["prosody_mod_c2s/connections"])
+	result.uploads = maybe_export_summed_gauge(families["prosody_mod_http_file_share/total_storage_bytes"]);
 	return json.encode(result);
 end
 
--- a/mod_http_admin_api/openapi.yaml	Thu Nov 18 19:26:07 2021 +0100
+++ b/mod_http_admin_api/openapi.yaml	Thu Nov 18 19:28:43 2021 +0100
@@ -788,6 +788,9 @@
         c2s:
           type: integer
           description: Number of active c2s sessions
+				uploads:
+					type: integer
+					description: Disk space used by uploaded files
     Announcement:
       type: object
       description: An announcemen to post to users on the server