[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnunet] 04/06: rps profiler: change logging format of view
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnunet] 04/06: rps profiler: change logging format of view sizes |
Date: |
Wed, 04 Apr 2018 08:54:49 +0200 |
This is an automated email from the git hooks/post-receive script.
julius-buenger pushed a commit to branch master
in repository gnunet.
commit dd4322b37a5173c8d9dc4b06654ac4a7b1b5c052
Author: Julius Bünger <address@hidden>
AuthorDate: Wed Apr 4 08:33:51 2018 +0200
rps profiler: change logging format of view sizes
---
src/rps/test_rps.c | 20 ++++----------------
1 file changed, 4 insertions(+), 16 deletions(-)
diff --git a/src/rps/test_rps.c b/src/rps/test_rps.c
index 22f428e2e..05902f037 100644
--- a/src/rps/test_rps.c
+++ b/src/rps/test_rps.c
@@ -1901,11 +1901,7 @@ void compute_diversity ()
void print_view_sizes()
{
uint32_t i;
- char *view_sizes_str = NULL;
- uint32_t view_sizes_str_len = 0;
- char view_size_curr[32] = { 0 };
- GNUNET_array_grow (view_sizes_str, view_sizes_str_len, num_peers * 3);
for (i = 0; i < num_peers; i++) /* Peer to count */
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -1913,19 +1909,7 @@ void print_view_sizes()
i,
GNUNET_i2s (rps_peers[i].peer_id),
rps_peers[i].cur_view_count);
- GNUNET_snprintf (view_size_curr,
- sizeof (view_size_curr),
- " %" PRIu32 "",
- rps_peers[i].cur_view_count);
- if (view_sizes_str_len < view_sizes_str_len + strlen (view_size_curr))
- {
- GNUNET_array_grow (view_sizes_str, view_sizes_str_len,
view_sizes_str_len + 10);
- }
- strncat (view_sizes_str, view_size_curr, strlen(view_size_curr));
}
- to_file_ ("/tmp/rps/view_sizes.txt",
- view_sizes_str);
- GNUNET_array_grow (view_sizes_str, view_sizes_str_len, 0);
}
void all_views_updated_cb()
@@ -1941,6 +1925,10 @@ void view_update_cb (void *cls,
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"View was updated (%" PRIu64 ")\n", num_peers);
struct RPSPeer *rps_peer = (struct RPSPeer *) cls;
+ to_file ("/tmp/rps/view_sizes.txt",
+ "%" PRIu64 " %" PRIu32 "",
+ rps_peer->index,
+ num_peers);
for (int i = 0; i < num_peers; i++)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnunet] branch master updated (e331d5f6d -> ea51d048c), gnunet, 2018/04/04
- [GNUnet-SVN] [gnunet] 01/06: rps profiler: fix logging of statistic values, gnunet, 2018/04/04
- [GNUnet-SVN] [gnunet] 04/06: rps profiler: change logging format of view sizes,
gnunet <=
- [GNUnet-SVN] [gnunet] 02/06: rps service/config: rename option in config, too, gnunet, 2018/04/04
- [GNUnet-SVN] [gnunet] 03/06: rps service: log view size on history update, too, gnunet, 2018/04/04
- [GNUnet-SVN] [gnunet] 05/06: rps tests: be more flexible with logging to files, gnunet, 2018/04/04
- [GNUnet-SVN] [gnunet] 06/06: rps tests: connect to all services, gnunet, 2018/04/04