]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
add 1%,10% percentiles to the storage server latency output
authorBrian Warner <warner@lothar.com>
Sat, 12 Jul 2008 04:34:36 +0000 (21:34 -0700)
committerBrian Warner <warner@lothar.com>
Sat, 12 Jul 2008 04:34:36 +0000 (21:34 -0700)
src/allmydata/storage.py

index 513b486f6b59af0a071a2b31f1148386f0188172..775c47e399d55e3d6d0bd423b8691b7781a31dd4 100644 (file)
@@ -821,10 +821,10 @@ class StorageServer(service.MultiService, Referenceable):
     def get_latencies(self):
         """Return a dict, indexed by category, that contains a dict of
         latency numbers for each category. Each dict will contain the
-        following keys: mean, median, 90_percentile, 95_percentile,
-        99_percentile). If no samples have been collected for the given
-        category, then that category name will not be present in the return
-        value."""
+        following keys: mean, median, 1_percentile, 10_percentile,
+        90_percentile, 95_percentile, 99_percentile, 999_percentile. If no
+        samples have been collected for the given category, then that
+        category name will not be present in the return value."""
         # note that Amazon's Dynamo paper says they use 99.9% percentile.
         output = {}
         for category in self.latencies:
@@ -835,6 +835,8 @@ class StorageServer(service.MultiService, Referenceable):
             samples.sort()
             count = len(samples)
             stats["mean"] = sum(samples) / count
+            stats["1_percentile"] = samples[int(0.01 * count)]
+            stats["10_percentile"] = samples[int(0.1 * count)]
             stats["median"] = samples[int(0.5 * count)]
             stats["90_percentile"] = samples[int(0.9 * count)]
             stats["95_percentile"] = samples[int(0.95 * count)]