diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2020-03-27 16:24:48 +0100 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2020-04-10 11:45:03 +0000 |
commit | f325ef59020b0acc33b6d05e96c8df7b58373715 (patch) | |
tree | 820d9d192275a6f95f4b150eb6fefb11d99f7cb5 /cli/mmcli-bearer.c | |
parent | b3ec30403fb813cf3902a02350289e769858f10e (diff) |
api,bearer: add 'attempts' and 'failed-attempts' statistics
When we're reusing over and over the same bearer object, we can
provide statistical information about the number of connection
attempts that have been done and how many of them failed.
Diffstat (limited to 'cli/mmcli-bearer.c')
-rw-r--r-- | cli/mmcli-bearer.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/cli/mmcli-bearer.c b/cli/mmcli-bearer.c index 279e568a..2dfdab35 100644 --- a/cli/mmcli-bearer.c +++ b/cli/mmcli-bearer.c @@ -248,6 +248,8 @@ print_bearer_info (MMBearer *bearer) gchar *duration = NULL; gchar *bytes_rx = NULL; gchar *bytes_tx = NULL; + gchar *attempts = NULL; + gchar *failed_attempts = NULL; if (stats) { guint64 val; @@ -261,11 +263,19 @@ print_bearer_info (MMBearer *bearer) val = mm_bearer_stats_get_tx_bytes (stats); if (val) bytes_tx = g_strdup_printf ("%" G_GUINT64_FORMAT, val); + val = mm_bearer_stats_get_attempts (stats); + if (val) + attempts = g_strdup_printf ("%" G_GUINT64_FORMAT, val); + val = mm_bearer_stats_get_failed_attempts (stats); + if (val) + failed_attempts = g_strdup_printf ("%" G_GUINT64_FORMAT, val); } - mmcli_output_string_take (MMC_F_BEARER_STATS_DURATION, duration); - mmcli_output_string_take (MMC_F_BEARER_STATS_BYTES_RX, bytes_rx); - mmcli_output_string_take (MMC_F_BEARER_STATS_BYTES_TX, bytes_tx); + mmcli_output_string_take (MMC_F_BEARER_STATS_DURATION, duration); + mmcli_output_string_take (MMC_F_BEARER_STATS_BYTES_RX, bytes_rx); + mmcli_output_string_take (MMC_F_BEARER_STATS_BYTES_TX, bytes_tx); + mmcli_output_string_take (MMC_F_BEARER_STATS_ATTEMPTS, attempts); + mmcli_output_string_take (MMC_F_BEARER_STATS_FAILED_ATTEMPTS, failed_attempts); } mmcli_output_dump (); |