Improved XMPP probing.

This commit is contained in:
Christian P. MOMON 2023-05-09 10:29:56 +02:00
parent 72ea872546
commit 3565c1024b
2 changed files with 57 additions and 6 deletions

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2022 Christian Pierre MOMON <christian@momon.org> * Copyright (C) 2022-2023 Christian Pierre MOMON <christian@momon.org>
* *
* This file is part of StatoolInfos, simple service statistics tool. * This file is part of StatoolInfos, simple service statistics tool.
* *
@ -29,7 +29,6 @@ import org.slf4j.LoggerFactory;
import fr.devinsy.statoolinfos.core.StatoolInfosException; import fr.devinsy.statoolinfos.core.StatoolInfosException;
import fr.devinsy.statoolinfos.metrics.PathCounters; import fr.devinsy.statoolinfos.metrics.PathCounters;
import fr.devinsy.statoolinfos.metrics.TimeMark; import fr.devinsy.statoolinfos.metrics.TimeMark;
import fr.devinsy.statoolinfos.util.FilesUtils;
// TODO: Auto-generated Javadoc // TODO: Auto-generated Javadoc
/** /**
@ -78,10 +77,6 @@ public class XmppDataAnalyzer
// metrics.service.files.bytes // metrics.service.files.bytes
long size = FileUtils.sizeOfDirectory(dataDirectory); long size = FileUtils.sizeOfDirectory(dataDirectory);
result.set(size, "metrics.service.files.bytes", year, yearMonth, yearWeek, date); result.set(size, "metrics.service.files.bytes", year, yearMonth, yearWeek, date);
// metrics.pastebins.count
long count = FilesUtils.searchByWildcard(dataDirectory.getAbsolutePath() + "/??/*").size();
result.set(count, "metrics.libreqr.files.count", year, yearMonth, yearWeek, date);
} }
else else
{ {

View file

@ -69,6 +69,62 @@ public class XmppProber
// metrics.service.files.bytes // metrics.service.files.bytes
result.putAll(XmppDataAnalyzer.probe(dataPath)); result.putAll(XmppDataAnalyzer.probe(dataPath));
// metrics.xmpp.domains
// ejabberdctl registered_vhosts | wc -l
// metrics.xmpp.accounts
// for domain in $(ejabberdctl registered_vhosts); do ejabberdctl
// registered_users $domain ; done | wc -l
// metrics.xmpp.accounts.active
// metrics.xmpp.biboumi.users
// metrics.xmpp.biboumi.servers
// metrics.xmpp.biboumi.channels
// echo " - actifs: $(count_active_accounts)"
// echo " - inactifs: $(count_inactive_accounts '1 MONTH')"
// echo " - suppressibles: $(count_removable_accounts '6 MONTHS')"
// echo ""
// # echo "Nombre d'utilisateurs du pont IRC: $(count_biboumi_users)
// dont $(count_biboumi_external_users) provenant de la fédération"
// # echo " - actifs: $(count_biboumi_active_users '1 MONTH') (provenant
// de la fédération: $(count_biboumi_active_external_users '1 MONTH'))"
// # echo " - inactifs: $(count_biboumi_inactive_users '1 MONTH')
// (provenant de la fédération: $(count_biboumi_inactive_external_users
// '1 MONTH'))"
// echo ""
// echo "Un compte inactif est un compte ne s'étant pas connecté durant
// le mois écoulé."
// echo "Un compte suppressible n'a jamais lu le message de bienvenue et
// ne s'est pas connecté durant les six derniers mois."
// echo ""
// echo "Occupation d'espace disque des archives de messages (MAM):
// $(count_archived_messages) o"
// echo " - Messages stockés pour le pont IRC (MAM):
// $(count_biboumi_archived_messages)"
// echo ""
// echo "Salons XMPP actifs: $(ejabberdctl muc_online_rooms global | wc
// -l)"
// # echo "Salons IRC actifs : $(count_biboumi_active_chan)"
// # echo " - $(count_biboumi_active_servers) serveur(s) connectés"
// echo ""
// echo "Occupation d'espace disque téléversement de fichiers: $(du -sh
// ${STORAGE_DIR} | awk '{print $1}')io"
// per_account_storage_usage
// echo "Quota de stockage par utilisateur: $(get_hard_quota) Mio"
// echo ""
// echo "Nombre d'appels audio/vidéo transmis: $(zgrep -h "$DATE"
// /var/log/ejabberd/ejabberd* | grep -i -e 'Offering stun' | wc -l)"
// echo "Quantité de données relayée (UDP): moyenne
// $(get_avg_UDP_turn_relayed_data) MiB, max
// $(get_max_UDP_turn_relayed_data) MiB, total
// $(get_total_UDP_turn_relayed_data) MiB"
// echo "Quantité de données relayée (TCP): moyenne
// $(get_avg_TCP_turn_relayed_data) MiB, max
// $(get_max_TCP_turn_relayed_data) MiB, total
// $(get_total_TCP_turn_relayed_data) MiB"
// //
return result; return result;
} }