Merge remote-tracking branch 'origin/master' v1.0.1
authorFlorian Forster <octo@verplant.org>
Tue, 16 Jul 2013 10:13:46 +0000 (12:13 +0200)
committerFlorian Forster <octo@verplant.org>
Tue, 16 Jul 2013 10:13:46 +0000 (12:13 +0200)
ChangeLog
configure.ac
src/Makefile.am
src/statsd-tg.c
src/statsd-tg.pod [new file with mode: 0644]

index fedfcb6..d59a00c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,2 +1,7 @@
+2013-07-16, Version 1.0.1
+       * Fix the "-T" command line option and add it to the usage
+         information.
+       * Added the statsd-tg(1) manual page.
+
 2013-07-12, Version 1.0.0
        * Initial version.
index 93f4cc0..51fc877 100644 (file)
@@ -1,5 +1,5 @@
-AC_PREREQ([2.68])
-AC_INIT([statsd-tg], [1.0.0], [ff@octo.it])
+AC_PREREQ([2.67])
+AC_INIT([statsd-tg], [1.0.1], [ff@octo.it])
 AC_CONFIG_SRCDIR([src/statsd-tg.c])
 AC_CONFIG_HEADERS([src/config.h])
 
@@ -11,6 +11,7 @@ AC_DEFINE([_XOPEN_SOURCE], [500], [Request XOpen issue 5])
 
 # Checks for programs.
 AC_PROG_CC
+AM_PROG_CC_C_O
 
 # Checks for libraries.
 
index 1189f8e..9978128 100644 (file)
@@ -3,3 +3,15 @@ bin_PROGRAMS = statsd-tg
 statsd_tg_SOURCES = statsd-tg.c
 statsd_tg_CFLAGS = $(AM_CFLAGS) -pthread
 statsd_tg_LDADD = -lrt
+
+EXTRA_DIST = statsd-tg.pod
+
+dist_man_MANS = statsd-tg.1
+
+.pod.1:
+       pod2man --release=$(VERSION) --center=$(PACKAGE) $< \
+               >.pod2man.tmp.$$$$ 2>/dev/null && mv -f .pod2man.tmp.$$$$ $@ || true
+       @if grep '\<POD ERRORS\>' $@ >/dev/null 2>&1; \
+       then \
+               echo "$@ has some POD errors!"; false; \
+       fi
index 5dda266..1d7f6af 100644 (file)
@@ -86,6 +86,7 @@ static void exit_usage (int exit_status) /* {{{ */
       "                   (Default: "DEF_NODE")\n"
       "    -D <port>      Destination port of the network packets.\n"
       "                   (Default: "DEF_SERVICE")\n"
+      "    -T <threads>   Number of threads to use to generate load.\n"
       "    -h             Print usage information (this output).\n"
       "\n"
       "Copyright (C) 2013  Florian Forster\n"
@@ -248,7 +249,7 @@ static int read_options (int argc, char **argv) /* {{{ */
   conf_threads_num = (int) sysconf (_SC_NPROCESSORS_ONLN);
 #endif
 
-  while ((opt = getopt (argc, argv, "c:t:g:s:S:d:D:h")) != -1)
+  while ((opt = getopt (argc, argv, "c:t:g:s:S:d:D:T:h")) != -1)
   {
     switch (opt)
     {
diff --git a/src/statsd-tg.pod b/src/statsd-tg.pod
new file mode 100644 (file)
index 0000000..7c45f53
--- /dev/null
@@ -0,0 +1,81 @@
+=encoding UTF-8
+
+=head1 NAME
+
+statsd-tg - Traffic generator for StatsD.
+
+=head1 SYNOPSIS
+
+statsd-tg B<-c> I<counters_num> B<-t> I<timers_num> B<-g> I<gauges_num>
+B<-s> I<sets_num> B<-S> I<set_size> B<-d> I<dest> B<-D> I<dport> B<-T> I<threads_num>
+
+=head1 DESCRIPTION
+
+B<statsd-tg> generates dummy I<StatsD> network traffic. The names of the
+metrics are pseudo-random, i.e. they should look random but two invokations
+with the same arguments should produce the same set of metrics. The values of
+these metrics and the frequency with which each metric is sent is
+unpredictable, though.
+
+You can use the B<-c>, B<-t>, B<-g> and B<-s> options to control the number of
+counters, timers, gauges and sets to closely match your real traffic.
+
+=head1 ARGUMENTS AND OPTIONS
+
+The following options are understood by I<statsd-tg>. The order of the
+arguments generally doesn't matter, as long as no argument is passed more than
+once.
+
+=over 4
+
+=item B<-c> I<counters_num>
+
+The number of metrics with type I<counter> to simulate. Defaults to B<1000>.
+
+=item B<-t> I<timers_num>
+
+The number of metrics with type I<timer> to simulate. Defaults to B<1000>.
+
+=item B<-g> I<gauges_num>
+
+The number of metrics with type I<gauge> to simulate. Defaults to B<100>.
+
+=item B<-s> I<sets_num>
+
+The number of metrics with type I<set> to simulate. Defaults to B<100>.
+
+=item B<-S> I<set_size>
+
+The number of unique values in each metric of type I<set>. Defaults to B<128>.
+
+=item B<-d> I<dest>
+
+Sets the destination to which to send the generated network traffic. Defaults
+to B<localhost>.
+
+=item B<-D> I<dport>
+
+Sets the destination port or service to which to send the generated network
+traffic. Defaults to I<StatsD's> default port, C<8125>.
+
+=item B<-T> I<threads_num>
+
+Number of threads to start to generate dummy traffic. Defaults to the number of
+online CPUs on your system, if it can be read. Otherwise defaults to a single
+thread.
+
+=item B<-h>
+
+Print usage summary.
+
+=back
+
+=head1 SEE ALSO
+
+L<https://github.com/etsy/statsd/>
+
+=head1 AUTHOR
+
+Florian Forster E<lt>ffE<nbsp>atE<nbsp>octo.itE<gt>
+
+=cut