diff --git a/performance_timing.c b/performance_timing.c index e45c3f6a..2d91fd3a 100644 --- a/performance_timing.c +++ b/performance_timing.c @@ -149,17 +149,8 @@ int fd_showstats() stats = stats->_next; } - // Show periodic rhizome transfer information, but only - // if there are some active rhizome transfers. - if (rhizome_active_fetch_count()!=0) - INFOF("Rhizome transfer progress: %"PRIu64",%"PRIu64",%"PRIu64",%"PRIu64",%"PRIu64",%"PRIu64" (remaining %"PRIu64")", - rhizome_active_fetch_bytes_received(0), - rhizome_active_fetch_bytes_received(1), - rhizome_active_fetch_bytes_received(2), - rhizome_active_fetch_bytes_received(3), - rhizome_active_fetch_bytes_received(4), - rhizome_active_fetch_bytes_received(5), - rhizome_fetch_queue_bytes()); + // Show periodic rhizome transfer information + rhizome_fetch_log_short_status(); // Report any functions that take too much time if (!config.debug.timing) diff --git a/rhizome.h b/rhizome.h index 7b171a15..a45cd823 100644 --- a/rhizome.h +++ b/rhizome.h @@ -898,7 +898,6 @@ enum rhizome_start_fetch_result { enum rhizome_start_fetch_result rhizome_fetch_request_manifest_by_prefix(const struct sockaddr_in *peerip, const sid_t *sidp, const unsigned char *prefix, size_t prefix_length); int rhizome_any_fetch_active(); int rhizome_any_fetch_queued(); -uint64_t rhizome_fetch_queue_bytes(); int rhizome_fetch_status_html(struct strbuf *b); int rhizome_fetch_has_queue_space(unsigned char log2_size); diff --git a/rhizome_fetch.c b/rhizome_fetch.c index 08452e4f..8c70bf93 100644 --- a/rhizome_fetch.c +++ b/rhizome_fetch.c @@ -150,23 +150,14 @@ static const char * fetch_state(int state) } } -int rhizome_active_fetch_count() -{ - int i,active=0; - for(i=0;i=NQUEUES) return -1; if (rhizome_fetch_queues[q].active.state==RHIZOME_FETCH_FREE) return -1; return rhizome_fetch_queues[q].active.write_state.file_offset; } -uint64_t rhizome_fetch_queue_bytes() +static uint64_t rhizome_fetch_queue_bytes() { uint64_t bytes = 0; unsigned i; @@ -186,6 +177,25 @@ uint64_t rhizome_fetch_queue_bytes() return bytes; } +void rhizome_fetch_log_short_status() +{ + int i,active=0; + for(i=0;i