aboutsummaryrefslogtreecommitdiff
path: root/cli
diff options
context:
space:
mode:
authorSom_SP <somashekhar.puttagangaiah@intel.com>2021-10-21 11:06:24 +0200
committerAleksander Morgado <aleksander@aleksander.es>2021-11-03 12:41:51 +0100
commit511859ef0afe049870581e3a55365bc3d3866566 (patch)
treea27b16356a7e24239224f917e2511e13864a8e64 /cli
parentd71a0bcf8eba9d7c6ec7949004c806be4f3f3f0d (diff)
api,bearer: add 'uplink-speed' and 'downlink-speed' stats
These values show the rates that have been negotiated with the network during the PS domain attach. These are not the current ongoing data rates associated to the network usage at some given moment. Includes updates by Aleksander Morgado to fix coding style issues and add missing documentation items.
Diffstat (limited to 'cli')
-rw-r--r--cli/mmcli-bearer.c10
-rw-r--r--cli/mmcli-output.c2
-rw-r--r--cli/mmcli-output.h2
3 files changed, 14 insertions, 0 deletions
diff --git a/cli/mmcli-bearer.c b/cli/mmcli-bearer.c
index e9718e40..db06dbfa 100644
--- a/cli/mmcli-bearer.c
+++ b/cli/mmcli-bearer.c
@@ -279,6 +279,8 @@ print_bearer_info (MMBearer *bearer)
gchar *total_duration = NULL;
gchar *total_bytes_rx = NULL;
gchar *total_bytes_tx = NULL;
+ gchar *uplink_speed = NULL;
+ gchar *downlink_speed = NULL;
if (stats) {
guint64 val;
@@ -309,6 +311,12 @@ print_bearer_info (MMBearer *bearer)
val = mm_bearer_stats_get_total_tx_bytes (stats);
if (val)
total_bytes_tx = g_strdup_printf ("%" G_GUINT64_FORMAT, val);
+ val = mm_bearer_stats_get_uplink_speed (stats);
+ if (val)
+ uplink_speed = g_strdup_printf ("%" G_GUINT64_FORMAT, val);
+ val = mm_bearer_stats_get_downlink_speed (stats);
+ if (val)
+ downlink_speed = g_strdup_printf ("%" G_GUINT64_FORMAT, val);
}
if (start_date)
@@ -321,6 +329,8 @@ print_bearer_info (MMBearer *bearer)
mmcli_output_string_take (MMC_F_BEARER_STATS_TOTAL_DURATION, total_duration);
mmcli_output_string_take (MMC_F_BEARER_STATS_TOTAL_BYTES_RX, total_bytes_rx);
mmcli_output_string_take (MMC_F_BEARER_STATS_TOTAL_BYTES_TX, total_bytes_tx);
+ mmcli_output_string_take (MMC_F_BEARER_STATS_UPLINK_SPEED, uplink_speed);
+ mmcli_output_string_take (MMC_F_BEARER_STATS_DOWNLINK_SPEED, downlink_speed);
}
mmcli_output_dump ();
diff --git a/cli/mmcli-output.c b/cli/mmcli-output.c
index bacf3949..712018b6 100644
--- a/cli/mmcli-output.c
+++ b/cli/mmcli-output.c
@@ -251,6 +251,8 @@ static FieldInfo field_infos[] = {
[MMC_F_BEARER_IPV6_CONFIG_MTU] = { "bearer.ipv6-config.mtu", "mtu", MMC_S_BEARER_IPV6_CONFIG, },
[MMC_F_BEARER_STATS_START_DATE] = { "bearer.stats.start-date", "start date", MMC_S_BEARER_STATS, },
[MMC_F_BEARER_STATS_DURATION] = { "bearer.stats.duration", "duration", MMC_S_BEARER_STATS, },
+ [MMC_F_BEARER_STATS_UPLINK_SPEED] = { "bearer.stats.uplink-speed", "uplink-speed", MMC_S_BEARER_STATS, },
+ [MMC_F_BEARER_STATS_DOWNLINK_SPEED] = { "bearer.stats.downlink-speed", "downlink-speed", MMC_S_BEARER_STATS, },
[MMC_F_BEARER_STATS_BYTES_RX] = { "bearer.stats.bytes-rx", "bytes rx", MMC_S_BEARER_STATS, },
[MMC_F_BEARER_STATS_BYTES_TX] = { "bearer.stats.bytes-tx", "bytes tx", MMC_S_BEARER_STATS, },
[MMC_F_BEARER_STATS_ATTEMPTS] = { "bearer.stats.attempts", "attempts", MMC_S_BEARER_STATS, },
diff --git a/cli/mmcli-output.h b/cli/mmcli-output.h
index 678b2b61..cc34d536 100644
--- a/cli/mmcli-output.h
+++ b/cli/mmcli-output.h
@@ -269,6 +269,8 @@ typedef enum {
MMC_F_BEARER_IPV6_CONFIG_MTU,
MMC_F_BEARER_STATS_START_DATE,
MMC_F_BEARER_STATS_DURATION,
+ MMC_F_BEARER_STATS_UPLINK_SPEED,
+ MMC_F_BEARER_STATS_DOWNLINK_SPEED,
MMC_F_BEARER_STATS_BYTES_RX,
MMC_F_BEARER_STATS_BYTES_TX,
MMC_F_BEARER_STATS_ATTEMPTS,