swift/test/unit/common
Samuel Merritt 4cf96b3791 Honor sample_rate in StatsD logging.
It's there to let administrators turn down the barrage of stats data
that StatsD must cope with, but it wasn't actually honored. Worse, if
the sample rate was set to e.g. 0.2, the stats would all be multiplied
by its inverse, e.g. 2. This patch actually drops packets when
sample_rate < 1, so you get correct measurements.

Fortunately, the default sample rate is 1 (i.e. drop nothing), and
multiplying by 1/1 doesn't change anything, so stats with the default
sample rate of 1.0 are, and have been, just fine.

Fixes bug 1065643.

Also, make the two touched files compliant with pep8 v1.3.3.

Change-Id: I66663144009ae4c9ee96f6a111745d8f5d2f5ca3
2012-10-12 12:38:33 -07:00
..
middleware Merge "local WSGI Request and Response classes" 2012-10-03 20:49:05 +00:00
ring builder.add_devs gets next id if not provided 2012-09-14 16:11:50 -05:00
__init__.py Initial commit of Swift code 2010-07-12 17:03:45 -05:00
corrupted_example.db Real files for bad databases. 2011-08-02 18:21:25 +00:00
malformed_example.db Real files for bad databases. 2011-08-02 18:21:25 +00:00
test_bench.py updated copyright date for all files 2012-03-19 13:45:34 -05:00
test_bufferedhttp.py Fix PEP8 issues in ./test/unit/common . 2012-08-31 11:24:46 +08:00
test_constraints.py local WSGI Request and Response classes 2012-09-28 14:48:48 -07:00
test_daemon.py updated copyright date for all files 2012-03-19 13:45:34 -05:00
test_db_replicator.py Fix PEP8 issues in ./test/unit/common . 2012-08-31 11:24:46 +08:00
test_db.py Fix PEP8 issues in ./test/unit/common . 2012-08-31 11:24:46 +08:00
test_direct_client.py updated copyright date for all files 2012-03-19 13:45:34 -05:00
test_exceptions.py updated copyright date for all files 2012-03-19 13:45:34 -05:00
test_init.py Fix PEP8 issues in ./test/unit/common . 2012-08-31 11:24:46 +08:00
test_internal_client.py fixed internal client things 2012-10-11 15:37:56 +00:00
test_manager.py Warn when killing fails with EPERM 2012-10-03 08:28:36 -07:00
test_memcached.py Fix pep8 issues in test_memcached.py. 2012-09-05 09:34:06 +08:00
test_swob.py Merge "Fix two edge cases with Range: header" 2012-10-09 20:18:15 +00:00
test_utils.py Honor sample_rate in StatsD logging. 2012-10-12 12:38:33 -07:00
test_wsgi.py fix swob for make_pre_authed_request 2012-10-09 09:19:29 -07:00