gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [gnunet] branch master updated: benchmark: track max time f


From: gnunet
Subject: [GNUnet-SVN] [gnunet] branch master updated: benchmark: track max time for URLs
Date: Wed, 26 Sep 2018 15:20:25 +0200

This is an automated email from the git hooks/post-receive script.

dold pushed a commit to branch master
in repository gnunet.

The following commit(s) were added to refs/heads/master by this push:
     new 99ba49914 benchmark: track max time for URLs
99ba49914 is described below

commit 99ba49914858c3af26e8fb6cd765af607ea178d9
Author: Florian Dold <address@hidden>
AuthorDate: Wed Sep 26 15:18:47 2018 +0200

    benchmark: track max time for URLs
---
 src/curl/curl.c      | 9 ++++++---
 src/util/benchmark.c | 5 +++--
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/src/curl/curl.c b/src/curl/curl.c
index 07f31970a..ec65986cb 100644
--- a/src/curl/curl.c
+++ b/src/curl/curl.c
@@ -505,15 +505,18 @@ GNUNET_CURL_perform (struct GNUNET_CURL_Context *ctx)
 #if ENABLE_BENCHMARK
   {
     char *url = NULL;
-    double total = 0;
+    double total_as_double = 0;
+    struct GNUNET_TIME_Relative total;
     struct UrlRequestData *urd;
     CURLcode res;
-    res = curl_easy_getinfo (cmsg->easy_handle, CURLINFO_TOTAL_TIME, &total);
+    res = curl_easy_getinfo (cmsg->easy_handle, CURLINFO_TOTAL_TIME, 
&total_as_double);
     GNUNET_break (CURLE_OK == res);
     curl_easy_getinfo (cmsg->easy_handle, CURLINFO_EFFECTIVE_URL, &url);
+    total.rel_value_us = total_as_double * 1000 * 1000;
     urd = get_url_benchmark_data (url, (unsigned int) response_code);
     urd->count++;
-    urd->time.rel_value_us += total * 1000 * 1000;
+    urd->time = GNUNET_TIME_relative_add (urd->time, total);
+    urd->time_max = GNUNET_TIME_relative_max (total, urd->time_max);
   }
 #endif
     job->jcc (job->jcc_cls,
diff --git a/src/util/benchmark.c b/src/util/benchmark.c
index 108e01659..b5fc2752c 100644
--- a/src/util/benchmark.c
+++ b/src/util/benchmark.c
@@ -135,11 +135,12 @@ write_benchmark_data (struct BenchmarkData *bd)
   for (unsigned int i = 0; i < bd->urd_len; i++)
   {
     struct UrlRequestData *urd = &bd->urd[i];
-    GNUNET_asprintf (&s, "url %s status %u count %llu time_us %llu\n",
+    GNUNET_asprintf (&s, "url %s status %u count %llu time_us %llu time_us_max 
%llu\n",
                      urd->request_url,
                      urd->status,
                      (unsigned long long) urd->count,
-                     (unsigned long long) urd->time.rel_value_us);
+                     (unsigned long long) urd->time.rel_value_us,
+                     (unsigned long long) urd->time_max.rel_value_us);
     GNUNET_assert (GNUNET_SYSERR != GNUNET_DISK_file_write_blocking (fh, s, 
strlen (s)));
     GNUNET_free (s);
   }

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]