[ostree] repo: Report metadata fetch progress separately
- From: Matthew Barnes <mbarnes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ostree] repo: Report metadata fetch progress separately
- Date: Mon, 12 Jan 2015 16:28:05 +0000 (UTC)
commit 6ff841d3b015cdf3192209d6863face30916e108
Author: Matthew Barnes <mbarnes redhat com>
Date: Thu Jan 8 14:43:01 2015 -0500
repo: Report metadata fetch progress separately
Partially resolves https://bugzilla.gnome.org/740276
src/libostree/ostree-repo-pull.c | 4 ++++
src/libostree/ostree-repo.c | 17 ++++++++++++++---
2 files changed, 18 insertions(+), 3 deletions(-)
---
diff --git a/src/libostree/ostree-repo-pull.c b/src/libostree/ostree-repo-pull.c
index efe87f6..2a302ba 100644
--- a/src/libostree/ostree-repo-pull.c
+++ b/src/libostree/ostree-repo-pull.c
@@ -189,6 +189,10 @@ update_progress (gpointer user_data)
ostree_async_progress_set_uint64 (pull_data->progress, "bytes-transferred", bytes_transferred);
ostree_async_progress_set_uint64 (pull_data->progress, "start-time", start_time);
+ /* We fetch metadata before content. These allow us to report metadata fetch progress specifically. */
+ ostree_async_progress_set_uint (pull_data->progress, "outstanding-metadata-fetches",
pull_data->n_outstanding_metadata_fetches);
+ ostree_async_progress_set_uint (pull_data->progress, "metadata-fetched", pull_data->n_fetched_metadata);
+
if (pull_data->fetching_sync_uri)
{
gs_free char *uri_string = soup_uri_to_string (pull_data->fetching_sync_uri, TRUE);
diff --git a/src/libostree/ostree-repo.c b/src/libostree/ostree-repo.c
index aa6939a..942c24a 100644
--- a/src/libostree/ostree-repo.c
+++ b/src/libostree/ostree-repo.c
@@ -2748,6 +2748,7 @@ ostree_repo_pull_default_console_progress_changed (OstreeAsyncProgress *progress
GString *buf;
gs_free char *status = NULL;
guint outstanding_fetches;
+ guint outstanding_metadata_fetches;
guint outstanding_writes;
guint n_scanned_metadata;
@@ -2758,6 +2759,7 @@ ostree_repo_pull_default_console_progress_changed (OstreeAsyncProgress *progress
status = ostree_async_progress_get_status (progress);
outstanding_fetches = ostree_async_progress_get_uint (progress, "outstanding-fetches");
+ outstanding_metadata_fetches = ostree_async_progress_get_uint (progress, "outstanding-metadata-fetches");
outstanding_writes = ostree_async_progress_get_uint (progress, "outstanding-writes");
n_scanned_metadata = ostree_async_progress_get_uint (progress, "scanned-metadata");
if (status)
@@ -2768,6 +2770,7 @@ ostree_repo_pull_default_console_progress_changed (OstreeAsyncProgress *progress
{
guint64 bytes_transferred = ostree_async_progress_get_uint64 (progress, "bytes-transferred");
guint fetched = ostree_async_progress_get_uint (progress, "fetched");
+ guint metadata_fetched = ostree_async_progress_get_uint (progress, "metadata-fetched");
guint requested = ostree_async_progress_get_uint (progress, "requested");
guint64 bytes_sec = (g_get_monotonic_time () - ostree_async_progress_get_uint64 (progress,
"start-time")) / G_USEC_PER_SEC;
gs_free char *formatted_bytes_transferred =
@@ -2782,9 +2785,17 @@ ostree_repo_pull_default_console_progress_changed (OstreeAsyncProgress *progress
formatted_bytes_sec = g_format_size (bytes_sec);
}
- g_string_append_printf (buf, "Receiving objects: %u%% (%u/%u) %s/s %s",
- (guint)((((double)fetched) / requested) * 100),
- fetched, requested, formatted_bytes_sec, formatted_bytes_transferred);
+ if (outstanding_metadata_fetches)
+ {
+ g_string_append_printf (buf, "Receiving metadata objects: %u/(estimating) %s/s %s",
+ metadata_fetched, formatted_bytes_sec, formatted_bytes_transferred);
+ }
+ else
+ {
+ g_string_append_printf (buf, "Receiving objects: %u%% (%u/%u) %s/s %s",
+ (guint)((((double)fetched) / requested) * 100),
+ fetched, requested, formatted_bytes_sec, formatted_bytes_transferred);
+ }
}
else if (outstanding_writes)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]