aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgeny Grin (Karlson2k) <k2k@narod.ru>2022-09-30 09:36:07 +0300
committerEvgeny Grin (Karlson2k) <k2k@narod.ru>2022-09-30 15:28:03 +0300
commit3f98c6092dcdd1e0f59a78d872425e4637896d28 (patch)
tree30ee68199d917f2da73d2547012089bc71ed1d1e
parent4adc14c948ac4981a7b4c91c6e16dc5fc39dd97a (diff)
downloadlibmicrohttpd-3f98c6092dcdd1e0f59a78d872425e4637896d28.tar.gz
libmicrohttpd-3f98c6092dcdd1e0f59a78d872425e4637896d28.zip
Removed "gauger" server usage from the testsuite
The testsuite should test MHD functionality, not measure performance in some unpredictable conditions.
-rw-r--r--src/testcurl/Makefile.am6
-rw-r--r--src/testcurl/gauger.h86
-rw-r--r--src/testcurl/perf_get.c5
-rw-r--r--src/testcurl/perf_get_concurrent.c5
-rw-r--r--src/testcurl/test_concurrent_stop.c1
-rw-r--r--src/testcurl/test_post_loop.c21
6 files changed, 3 insertions, 121 deletions
diff --git a/src/testcurl/Makefile.am b/src/testcurl/Makefile.am
index cd6dcd21..13f9fed7 100644
--- a/src/testcurl/Makefile.am
+++ b/src/testcurl/Makefile.am
@@ -259,11 +259,11 @@ test_callback_SOURCES = \
259 259
260perf_get_SOURCES = \ 260perf_get_SOURCES = \
261 perf_get.c \ 261 perf_get.c \
262 gauger.h mhd_has_in_name.h 262 mhd_has_in_name.h
263 263
264perf_get_concurrent_SOURCES = \ 264perf_get_concurrent_SOURCES = \
265 perf_get_concurrent.c \ 265 perf_get_concurrent.c \
266 gauger.h mhd_has_in_name.h 266 mhd_has_in_name.h
267perf_get_concurrent_CFLAGS = \ 267perf_get_concurrent_CFLAGS = \
268 $(AM_CFLAGS) $(PTHREAD_CFLAGS) 268 $(AM_CFLAGS) $(PTHREAD_CFLAGS)
269perf_get_concurrent_LDADD = \ 269perf_get_concurrent_LDADD = \
@@ -271,7 +271,7 @@ perf_get_concurrent_LDADD = \
271 271
272perf_get_concurrent11_SOURCES = \ 272perf_get_concurrent11_SOURCES = \
273 perf_get_concurrent.c \ 273 perf_get_concurrent.c \
274 gauger.h mhd_has_in_name.h 274 mhd_has_in_name.h
275perf_get_concurrent11_CFLAGS = \ 275perf_get_concurrent11_CFLAGS = \
276 $(AM_CFLAGS) $(PTHREAD_CFLAGS) 276 $(AM_CFLAGS) $(PTHREAD_CFLAGS)
277perf_get_concurrent11_LDADD = \ 277perf_get_concurrent11_LDADD = \
diff --git a/src/testcurl/gauger.h b/src/testcurl/gauger.h
deleted file mode 100644
index d00839c1..00000000
--- a/src/testcurl/gauger.h
+++ /dev/null
@@ -1,86 +0,0 @@
1/** ---------------------------------------------------------------------------
2 * This software is in the public domain, furnished "as is", without technical
3 * support, and with no warranty, express or implied, as to its usefulness for
4 * any purpose.
5 *
6 * gauger.h
7 * Interface for C programs to log remotely to a gauger server
8 *
9 * Author: Bartlomiej Polot
10 * -------------------------------------------------------------------------*/
11#ifndef __GAUGER_H__
12#define __GAUGER_H__
13
14#ifndef WINDOWS
15
16#include <unistd.h>
17#include <stdio.h>
18#include <sys/wait.h>
19
20#define GAUGER(category, counter, value, unit) \
21 { \
22 const char *__gauger_v[10]; \
23 char __gauger_s[32]; \
24 pid_t __gauger_p; \
25 if (! (__gauger_p = fork ())) { \
26 if (! fork ()) { \
27 sprintf (__gauger_s,"%Lf", (long double) (value)); \
28 __gauger_v[0] = "gauger"; \
29 __gauger_v[1] = "-n"; \
30 __gauger_v[2] = counter; \
31 __gauger_v[3] = "-d"; \
32 __gauger_v[4] = __gauger_s; \
33 __gauger_v[5] = "-u"; \
34 __gauger_v[6] = unit; \
35 __gauger_v[7] = "-c"; \
36 __gauger_v[8] = category; \
37 __gauger_v[9] = (char *) NULL; \
38 execvp ("gauger", (char*const*) __gauger_v); \
39 _exit (1); \
40 }else{ \
41 _exit (0); \
42 } \
43 }else{ \
44 waitpid (__gauger_p,NULL,0); \
45 } \
46 }
47
48#define GAUGER_ID(category, counter, value, unit, id) \
49 { \
50 char*__gauger_v[12]; \
51 char __gauger_s[32]; \
52 pid_t __gauger_p; \
53 if (! (__gauger_p = fork ())) { \
54 if (! fork ()) { \
55 sprintf (__gauger_s,"%Lf", (long double) (value)); \
56 __gauger_v[0] = "gauger"; \
57 __gauger_v[1] = "-n"; \
58 __gauger_v[2] = counter; \
59 __gauger_v[3] = "-d"; \
60 __gauger_v[4] = __gauger_s; \
61 __gauger_v[5] = "-u"; \
62 __gauger_v[6] = unit; \
63 __gauger_v[7] = "-i"; \
64 __gauger_v[8] = id; \
65 __gauger_v[9] = "-c"; \
66 __gauger_v[10] = category; \
67 __gauger_v[11] = (char *) NULL; \
68 execvp ("gauger",__gauger_v); \
69 perror ("gauger"); \
70 _exit (1); \
71 }else{ \
72 _exit (0); \
73 } \
74 }else{ \
75 waitpid (__gauger_p,NULL,0); \
76 } \
77 }
78
79#else
80
81#define GAUGER_ID(category, counter, value, unit, id) {}
82#define GAUGER(category, counter, value, unit) {}
83
84#endif /* WINDOWS */
85
86#endif
diff --git a/src/testcurl/perf_get.c b/src/testcurl/perf_get.c
index 3ee1c388..a9298b2a 100644
--- a/src/testcurl/perf_get.c
+++ b/src/testcurl/perf_get.c
@@ -45,7 +45,6 @@
45#include <stdlib.h> 45#include <stdlib.h>
46#include <string.h> 46#include <string.h>
47#include <time.h> 47#include <time.h>
48#include "gauger.h"
49#include "mhd_has_in_name.h" 48#include "mhd_has_in_name.h"
50 49
51#ifndef WINDOWS 50#ifndef WINDOWS
@@ -131,10 +130,6 @@ stop (const char *desc)
131 desc, 130 desc,
132 rps, 131 rps,
133 "requests/s"); 132 "requests/s");
134 GAUGER (desc,
135 "Sequential GETs",
136 rps,
137 "requests/s");
138} 133}
139 134
140 135
diff --git a/src/testcurl/perf_get_concurrent.c b/src/testcurl/perf_get_concurrent.c
index 80f66eea..f0b4e923 100644
--- a/src/testcurl/perf_get_concurrent.c
+++ b/src/testcurl/perf_get_concurrent.c
@@ -42,7 +42,6 @@
42#include <string.h> 42#include <string.h>
43#include <time.h> 43#include <time.h>
44#include <pthread.h> 44#include <pthread.h>
45#include "gauger.h"
46#include "mhd_has_in_name.h" 45#include "mhd_has_in_name.h"
47 46
48#if defined(MHD_CPU_COUNT) && (MHD_CPU_COUNT + 0) < 2 47#if defined(MHD_CPU_COUNT) && (MHD_CPU_COUNT + 0) < 2
@@ -135,10 +134,6 @@ stop (const char *desc)
135 desc, 134 desc,
136 rps, 135 rps,
137 "requests/s"); 136 "requests/s");
138 GAUGER (desc,
139 "Parallel GETs",
140 rps,
141 "requests/s");
142} 137}
143 138
144 139
diff --git a/src/testcurl/test_concurrent_stop.c b/src/testcurl/test_concurrent_stop.c
index 306b2b5b..e427ea42 100644
--- a/src/testcurl/test_concurrent_stop.c
+++ b/src/testcurl/test_concurrent_stop.c
@@ -33,7 +33,6 @@
33#include <string.h> 33#include <string.h>
34#include <time.h> 34#include <time.h>
35#include <pthread.h> 35#include <pthread.h>
36#include "gauger.h"
37 36
38#if defined(MHD_CPU_COUNT) && (MHD_CPU_COUNT + 0) < 2 37#if defined(MHD_CPU_COUNT) && (MHD_CPU_COUNT + 0) < 2
39#undef MHD_CPU_COUNT 38#undef MHD_CPU_COUNT
diff --git a/src/testcurl/test_post_loop.c b/src/testcurl/test_post_loop.c
index f9238faa..dbfd170d 100644
--- a/src/testcurl/test_post_loop.c
+++ b/src/testcurl/test_post_loop.c
@@ -33,7 +33,6 @@
33#include <stdlib.h> 33#include <stdlib.h>
34#include <string.h> 34#include <string.h>
35#include <time.h> 35#include <time.h>
36#include "gauger.h"
37#include "mhd_has_in_name.h" 36#include "mhd_has_in_name.h"
38 37
39#ifndef WINDOWS 38#ifndef WINDOWS
@@ -642,11 +641,6 @@ main (int argc, char *const *argv)
642 "%s: Sequential POSTs (http/1.0) %f/s\n", 641 "%s: Sequential POSTs (http/1.0) %f/s\n",
643 "internal select", 642 "internal select",
644 (double) 1000 * LOOPCOUNT / (now () - start_time + 1.0)); 643 (double) 1000 * LOOPCOUNT / (now () - start_time + 1.0));
645 GAUGER ("internal select",
646 oneone ? "Sequential POSTs (http/1.1)" :
647 "Sequential POSTs (http/1.0)",
648 (double) 1000 * LOOPCOUNT / (now () - start_time + 1.0),
649 "requests/s");
650 start_time = now (); 644 start_time = now ();
651 errorCount += testMultithreadedPost (); 645 errorCount += testMultithreadedPost ();
652 fprintf (stderr, 646 fprintf (stderr,
@@ -654,11 +648,6 @@ main (int argc, char *const *argv)
654 "%s: Sequential POSTs (http/1.0) %f/s\n", 648 "%s: Sequential POSTs (http/1.0) %f/s\n",
655 "multithreaded post", 649 "multithreaded post",
656 (double) 1000 * LOOPCOUNT / (now () - start_time + 1.0)); 650 (double) 1000 * LOOPCOUNT / (now () - start_time + 1.0));
657 GAUGER ("Multithreaded select",
658 oneone ? "Sequential POSTs (http/1.1)" :
659 "Sequential POSTs (http/1.0)",
660 (double) 1000 * LOOPCOUNT / (now () - start_time + 1.0),
661 "requests/s");
662 start_time = now (); 651 start_time = now ();
663 errorCount += testMultithreadedPoolPost (); 652 errorCount += testMultithreadedPoolPost ();
664 fprintf (stderr, 653 fprintf (stderr,
@@ -666,11 +655,6 @@ main (int argc, char *const *argv)
666 "%s: Sequential POSTs (http/1.0) %f/s\n", 655 "%s: Sequential POSTs (http/1.0) %f/s\n",
667 "thread with pool", 656 "thread with pool",
668 (double) 1000 * LOOPCOUNT / (now () - start_time + 1.0)); 657 (double) 1000 * LOOPCOUNT / (now () - start_time + 1.0));
669 GAUGER ("thread with pool",
670 oneone ? "Sequential POSTs (http/1.1)" :
671 "Sequential POSTs (http/1.0)",
672 (double) 1000 * LOOPCOUNT / (now () - start_time + 1.0),
673 "requests/s");
674 } 658 }
675 start_time = now (); 659 start_time = now ();
676 errorCount += testExternalPost (); 660 errorCount += testExternalPost ();
@@ -679,11 +663,6 @@ main (int argc, char *const *argv)
679 "%s: Sequential POSTs (http/1.0) %f/s\n", 663 "%s: Sequential POSTs (http/1.0) %f/s\n",
680 "external select", 664 "external select",
681 (double) 1000 * LOOPCOUNT / (now () - start_time + 1.0)); 665 (double) 1000 * LOOPCOUNT / (now () - start_time + 1.0));
682 GAUGER ("external select",
683 oneone ? "Sequential POSTs (http/1.1)" :
684 "Sequential POSTs (http/1.0)",
685 (double) 1000 * LOOPCOUNT / (now () - start_time + 1.0),
686 "requests/s");
687 if (errorCount != 0) 666 if (errorCount != 0)
688 fprintf (stderr, "Error (code: %u)\n", errorCount); 667 fprintf (stderr, "Error (code: %u)\n", errorCount);
689 curl_global_cleanup (); 668 curl_global_cleanup ();