From: Brian Warner <warner@lothar.com>
Date: Sat, 12 Jul 2008 04:34:36 +0000 (-0700)
Subject: add 1%,10% percentiles to the storage server latency output
X-Git-Url: https://git.rkrishnan.org/vdrive/listings/install-details.html?a=commitdiff_plain;h=bffe14ef3e58224d0d455a975ae137788e93032c;p=tahoe-lafs%2Ftahoe-lafs.git

add 1%,10% percentiles to the storage server latency output
---

diff --git a/src/allmydata/storage.py b/src/allmydata/storage.py
index 513b486f..775c47e3 100644
--- a/src/allmydata/storage.py
+++ b/src/allmydata/storage.py
@@ -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)]