commit 6b53cd0e4619fa18fae8630de91c23e7ba7bbdaa
Author: Karsten Loesing <karsten.loes...@gmx.net>
Date:   Thu May 17 15:11:40 2018 +0200

    Simplify dirread and dirwrite in bandwidth.csv.
    
    With this change we're making it clear that these two columns contain
    statistics from directory mirrors only, and we're taking out the
    extrapolation step.
    
    Implements #26002.
---
 src/main/resources/web/json/metrics.json | 2 +-
 src/main/resources/web/jsps/stats.jsp    | 9 ++++-----
 src/main/sql/legacy/tordir.sql           | 6 ++----
 3 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/src/main/resources/web/json/metrics.json 
b/src/main/resources/web/json/metrics.json
index 57b7c9c..b867f50 100644
--- a/src/main/resources/web/json/metrics.json
+++ b/src/main/resources/web/json/metrics.json
@@ -103,7 +103,7 @@
     "id": "dirbytes",
     "title": "Bandwidth spent on answering directory requests",
     "type": "Graph",
-    "description": "<p>This graph shows the portion of <a 
href=\"glossary.html#bandwidth-history\">consumed bandwidth</a> that <a 
href=\"glossary.html#directory-authority\">directory authorities</a> and <a 
href=\"glossary.html#directory-mirror\">mirrors</a> have spent on answering 
directory requests.  Not all directories report these statistics, so the graph 
shows an estimation of total consumed bandwidth as it would be observed if all 
directories reported these statistics.</p>",
+    "description": "<p>This graph shows the portion of <a 
href=\"glossary.html#bandwidth-history\">consumed bandwidth</a> that <a 
href=\"glossary.html#directory-mirror\">directory mirrors</a> have spent on 
answering directory requests.</p>",
     "function": "dirbytes",
     "parameters": [
       "start",
diff --git a/src/main/resources/web/jsps/stats.jsp 
b/src/main/resources/web/jsps/stats.jsp
index 2674ba0..ea5faf8 100644
--- a/src/main/resources/web/jsps/stats.jsp
+++ b/src/main/resources/web/jsps/stats.jsp
@@ -125,15 +125,14 @@ This metric includes any kind of traffic.</li>
 <li><b>bwwrite:</b> Similar to <b>bwread</b>, but for traffic written by
 relays.</li>
 
-<li><b>dirread:</b> Bandwidth in bytes per second that relays have read when
-serving directory data.  Not all relays report how many bytes they read when
-serving directory data which is why this value is an estimate from the 
available
-data.  This metric is not available for subsets of relays with certain relay
+<li><b>dirread:</b> Bandwidth in bytes per second that directory mirrors have
+read when serving directory data.
+This metric is not available for subsets of relays with certain relay
 flags, so that this column will contain the empty string if either 
<b>isexit</b>
 or <b>isguard</b> is non-empty.</li>
 
 <li><b>dirwrite:</b> Similar to <b>dirread</b>, but for traffic written by
-relays when serving directory data.</li>
+directory mirrors when serving directory data.</li>
 
 </ul>
 
diff --git a/src/main/sql/legacy/tordir.sql b/src/main/sql/legacy/tordir.sql
index 5d254f6..bd91ab6 100644
--- a/src/main/sql/legacy/tordir.sql
+++ b/src/main/sql/legacy/tordir.sql
@@ -807,11 +807,9 @@ UNION ALL
   CASE WHEN total_bwhist.written IS NOT NULL
   THEN total_bwhist.written / 86400 END AS bwwrite,
   CASE WHEN u.date IS NOT NULL
-  THEN FLOOR(CAST(u.dr AS NUMERIC) * CAST(u.brp AS NUMERIC) /
-  CAST(u.brd AS NUMERIC) / CAST(86400 AS NUMERIC)) END AS dirread,
+  THEN FLOOR(CAST(u.dr AS NUMERIC) / CAST(86400 AS NUMERIC)) END AS dirread,
   CASE WHEN u.date IS NOT NULL
-  THEN FLOOR(CAST(u.dw AS NUMERIC) * CAST(u.bwp AS NUMERIC) /
-  CAST(u.bwd AS NUMERIC) / CAST(86400 AS NUMERIC)) END AS dirwrite
+  THEN FLOOR(CAST(u.dw AS NUMERIC) / CAST(86400 AS NUMERIC)) END AS dirwrite
   FROM total_bandwidth FULL OUTER JOIN total_bwhist
   ON total_bandwidth.date = total_bwhist.date
   FULL OUTER JOIN (SELECT * FROM user_stats WHERE country = 'zy'

_______________________________________________
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits

Reply via email to