[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [metrics-web/master] Add OnionPerf instances op-nl and op-us.
commit c48e048ce3c702651b4f117b2ecfc1ce362ba987
Author: Karsten Loesing <karsten.loesing@xxxxxxx>
Date: Sat Mar 18 19:45:28 2017 +0100
Add OnionPerf instances op-nl and op-us.
Implements #21272.
---
.../ernie/cron/performance/TorperfProcessor.java | 20 ++++++++++++++------
website/etc/categories.json | 2 +-
website/rserve/graphs.R | 15 ++++++---------
.../src/org/torproject/metrics/web/GraphServlet.java | 4 +++-
.../metrics/web/graphs/GraphParameterChecker.java | 3 ++-
5 files changed, 26 insertions(+), 18 deletions(-)
diff --git a/modules/legacy/src/main/java/org/torproject/ernie/cron/performance/TorperfProcessor.java b/modules/legacy/src/main/java/org/torproject/ernie/cron/performance/TorperfProcessor.java
index 2883299..25b0050 100644
--- a/modules/legacy/src/main/java/org/torproject/ernie/cron/performance/TorperfProcessor.java
+++ b/modules/legacy/src/main/java/org/torproject/ernie/cron/performance/TorperfProcessor.java
@@ -100,6 +100,12 @@ public class TorperfProcessor {
continue;
}
TorperfResult result = (TorperfResult) descriptor;
+ if (null != result.getUnrecognizedKeys()
+ && result.getUnrecognizedKeys().containsKey("ENDPOINTREMOTE")
+ && result.getUnrecognizedKeys().get("ENDPOINTREMOTE")
+ .contains(".onion")) {
+ continue;
+ }
String source = result.getSource();
long fileSize = result.getFileSize();
if (fileSize == 51200) {
@@ -162,12 +168,14 @@ public class TorperfProcessor {
long q1 = dlTimes.get(dlTimes.size() / 4 - 1);
long md = dlTimes.get(dlTimes.size() / 2 - 1);
long q3 = dlTimes.get(dlTimes.size() * 3 / 4 - 1);
- String[] tempParts = tempSourceDate.split("[-,]", 3);
- String tempDate = tempParts[2];
- int tempSize = Integer.parseInt(
- tempParts[1].substring(0, tempParts[1].length() - 2))
- * 1024 * (tempParts[1].endsWith("mb") ? 1024 : 1);
- String tempSource = tempParts[0];
+ String[] tempParts = tempSourceDate.split("[,]", 3);
+ String tempDate = tempParts[1];
+ int tempSize = Integer.parseInt(tempParts[0].substring(
+ tempParts[0].lastIndexOf('-') + 1,
+ tempParts[0].length() - 2))
+ * 1024 * (tempParts[0].endsWith("mb") ? 1024 : 1);
+ String tempSource = tempParts[0].substring(0,
+ tempParts[0].lastIndexOf('-'));
String tempDateSizeSource = String.format("%s,%d,%s",
tempDate, tempSize, tempSource);
stats.put(tempDateSizeSource,
diff --git a/website/etc/categories.json b/website/etc/categories.json
index 7c8bcbf..0f5947c 100644
--- a/website/etc/categories.json
+++ b/website/etc/categories.json
@@ -54,7 +54,7 @@
"icon": "fa-dashboard",
"header": "Performance",
"summary": "How fast and reliable the Tor network is.",
- "description": "We use <a href=\"https://gitweb.torproject.org/torperf.git\">Torperf</a> to run performance measurements. It works by fetching files of different sizes over Tor and measuring how long that takes.",
+ "description": "We use <a href=\"https://gitweb.torproject.org/torperf.git\">Torperf</a> and <a href=\"https://github.com/robgjansen/onionperf\">OnionPerf</a> to run performance measurements. Both work by fetching files of different sizes over Tor and measuring how long that takes.",
"metrics": [
"torperf",
"torperf-failures",
diff --git a/website/rserve/graphs.R b/website/rserve/graphs.R
index 29cad9a..988e3b2 100644
--- a/website/rserve/graphs.R
+++ b/website/rserve/graphs.R
@@ -565,6 +565,10 @@ plot_torperf <- function(start, end, source, filesize, path) {
ifelse(filesize == '1mb', 1024 * 1024, 5 * 1024 * 1024))
t <- read.csv(paste("/srv/metrics.torproject.org/metrics/shared/stats/",
"torperf.csv", sep = ""), stringsAsFactors = FALSE)
+ known_sources <- c("all", unique(t[t$source != "", "source"]))
+ colours <- data.frame(source = known_sources,
+ colour = brewer.pal(length(known_sources), "Paired"),
+ stringsAsFactors = FALSE)
t <- t[t$date >= start & t$date <= end & t$size == size &
t$source == ifelse(source == 'all', '', source), ]
torperf <- data.frame(date = as.Date(t$date, "%Y-%m-%d"),
@@ -576,14 +580,10 @@ plot_torperf <- function(start, end, source, filesize, path) {
torperf <- rbind(torperf,
data.frame(date = as.Date(missing, origin = "1970-01-01"),
q1 = NA, md = NA, q3 = NA))
- colours <- data.frame(source = c("all", "siv", "moria", "torperf"),
- colour = c("#FF8C00", "#0000EE", "#EE0000", "#00CD00"),
- stringsAsFactors = FALSE)
colour <- colours[colours$source == source, "colour"]
filesizes <- data.frame(filesizes = c("5mb", "1mb", "50kb"),
label = c("5 MiB", "1 MiB", "50 KiB"), stringsAsFactors = FALSE)
filesizeStr <- filesizes[filesizes$filesize == filesize, "label"]
- maxY <- max(torperf$q3, na.rm = TRUE)
date_breaks <- date_breaks(
as.numeric(max(as.Date(torperf$date, "%Y-%m-%d")) -
min(as.Date(torperf$date, "%Y-%m-%d"))))
@@ -597,7 +597,8 @@ plot_torperf <- function(start, end, source, filesize, path) {
labels = date_format(date_breaks$format),
breaks = date_breaks$major,
minor_breaks = date_breaks$minor) +
- scale_y_continuous(name = "", limits = c(0, maxY) / 1e3) +
+ scale_y_continuous(name = "") +
+ expand_limits(y = 0) +
scale_fill_manual(name = paste("Measured times on",
ifelse(source == "all", "all sources", source), "per day"),
breaks = c("line", "ribbon"),
@@ -627,10 +628,6 @@ plot_torperf_failures <- function(start, end, source, filesize, path) {
torperf <- rbind(torperf,
data.frame(date = as.Date(missing, origin = "1970-01-01"),
timeouts = NA, failures = NA, requests = NA))
- colours <- data.frame(source = c("all", "siv", "moria", "torperf"),
- colour = c("#FF8C00", "#0000EE", "#EE0000", "#00CD00"),
- stringsAsFactors = FALSE)
- colour <- colours[colours$source == source, "colour"]
filesizes <- data.frame(filesizes = c("5mb", "1mb", "50kb"),
label = c("5 MiB", "1 MiB", "50 KiB"), stringsAsFactors = FALSE)
filesizeStr <- filesizes[filesizes$filesize == filesize, "label"]
diff --git a/website/src/org/torproject/metrics/web/GraphServlet.java b/website/src/org/torproject/metrics/web/GraphServlet.java
index 0503195..8b4a4c6 100644
--- a/website/src/org/torproject/metrics/web/GraphServlet.java
+++ b/website/src/org/torproject/metrics/web/GraphServlet.java
@@ -110,7 +110,9 @@ public class GraphServlet extends MetricServlet {
{ "all", " checked" },
{ "torperf", "" },
{ "moria", "" },
- { "siv", "" } });
+ { "siv", "" },
+ { "op-nl", "" },
+ { "op-us", "" }});
this.defaultParameters.put("filesize", new String[][] {
{ "50kb", " checked", "50 KiB" },
{ "1mb", "", "1 MiB" },
diff --git a/website/src/org/torproject/metrics/web/graphs/GraphParameterChecker.java b/website/src/org/torproject/metrics/web/graphs/GraphParameterChecker.java
index 0b39adb..4cdd84f 100644
--- a/website/src/org/torproject/metrics/web/graphs/GraphParameterChecker.java
+++ b/website/src/org/torproject/metrics/web/graphs/GraphParameterChecker.java
@@ -64,7 +64,8 @@ public class GraphParameterChecker {
}
this.knownParameterValues.put("country", sb.toString());
this.knownParameterValues.put("events", "on,off,points");
- this.knownParameterValues.put("source", "all,siv,moria,torperf");
+ this.knownParameterValues.put("source", "all,siv,moria,torperf,op-nl,"
+ + "op-us");
this.knownParameterValues.put("filesize", "50kb,1mb,5mb");
this.knownParameterValues.put("transport", "obfs2,obfs3,obfs4,"
+ "websocket,fte,meek,scramblesuit,snowflake,<OR>,<??>,!<OR>");
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits