[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [snowflake/master] Updated broker specification and comments



commit 94de69aa369ebdee0cee5b683a42ebc8811a796d
Author: Cecylia Bocovich <cohosh@xxxxxxxxxxxxxx>
Date:   Tue Nov 26 10:44:40 2019 -0500

    Updated broker specification and comments
---
 broker/metrics.go        | 59 ++----------------------------------------------
 common/messages/proxy.go |  4 ++--
 doc/broker-spec.txt      | 18 +++++++++++++++
 3 files changed, 22 insertions(+), 59 deletions(-)

diff --git a/broker/metrics.go b/broker/metrics.go
index c23a170..bf5ce29 100644
--- a/broker/metrics.go
+++ b/broker/metrics.go
@@ -1,66 +1,11 @@
 /*
-We export metrics in the following format:
-
-    "snowflake-stats-end" YYYY-MM-DD HH:MM:SS (NSEC s) NL
-        [At most once.]
-
-        YYYY-MM-DD HH:MM:SS defines the end of the included measurement
-        interval of length NSEC seconds (86400 seconds by default).
-
-    "snowflake-ips" CC=NUM,CC=NUM,... NL
-        [At most once.]
-
-        List of mappings from two-letter country codes to the number of
-        unique IP addresses of snowflake proxies that have polled.
-
-    "snowflake-ips-total" NUM NL
-        [At most once.]
-
-        A count of the total number of unique IP addresses of snowflake
-        proxies that have polled.
-
-    "snowflake-ips-standalone" NUM NL
-        [At most once.]
-
-        A count of the total number of unique IP addresses of snowflake
-        proxies of type "standalone" that have polled.
-
-    "snowflake-ips-badge" NUM NL
-        [At most once.]
-
-        A count of the total number of unique IP addresses of snowflake
-        proxies of type "badge" that have polled.
-
-    "snowflake-ips-webext" NUM NL
-        [At most once.]
-
-        A count of the total number of unique IP addresses of snowflake
-        proxies of type "webext" that have polled.
-
-    "snowflake-idle-count" NUM NL
-        [At most once.]
-
-        A count of the number of times a proxy has polled but received
-        no client offer, rounded up to the nearest multiple of 8.
-
-    "client-denied-count" NUM NL
-        [At most once.]
-
-        A count of the number of times a client has requested a proxy
-        from the broker but no proxies were available, rounded up to
-        the nearest multiple of 8.
-
-    "client-snowflake-match-count" NUM NL
-        [At most once.]
-
-        A count of the number of times a client successfully received a
-        proxy from the broker, rounded up to the nearest multiple of 8.
+We export metrics in the format specified in our broker spec:
+https://gitweb.torproject.org/pluggable-transports/snowflake.git/tree/doc/broker-spec.txt
 */
 
 package main
 
 import (
-	// "golang.org/x/net/internal/timeseries"
 	"fmt"
 	"log"
 	"math"
diff --git a/common/messages/proxy.go b/common/messages/proxy.go
index d57af1e..89dd43c 100644
--- a/common/messages/proxy.go
+++ b/common/messages/proxy.go
@@ -17,7 +17,7 @@ const version = "1.1"
 {
   Sid: [generated session id of proxy],
   Version: 1.1,
-  Type: [badge|webext|standalone]
+  Type: ["badge"|"webext"|"standalone"]
 }
 
 == ProxyPollResponse ==
@@ -87,7 +87,7 @@ func EncodePollRequest(sid string, proxyType string) ([]byte, error) {
 }
 
 // Decodes a poll message from a snowflake proxy and returns the
-// sid of the proxy on success and an error if it failed
+// sid and proxy type of the proxy on success and an error if it failed
 func DecodePollRequest(data []byte) (string, string, error) {
 	var message ProxyPollRequest
 
diff --git a/doc/broker-spec.txt b/doc/broker-spec.txt
index 2877784..eba3347 100644
--- a/doc/broker-spec.txt
+++ b/doc/broker-spec.txt
@@ -31,6 +31,24 @@ Metrics data from the Snowflake broker can be retrieved by sending an HTTP GET r
         A count of the total number of unique IP addresses of Snowflake
         proxies that have polled.
 
+    "snowflake-ips-standalone" NUM NL
+        [At most once.]
+
+        A count of the total number of unique IP addresses of snowflake
+        proxies of type "standalone" that have polled.
+
+    "snowflake-ips-badge" NUM NL
+        [At most once.]
+
+        A count of the total number of unique IP addresses of snowflake
+        proxies of type "badge" that have polled.
+
+    "snowflake-ips-webext" NUM NL
+        [At most once.]
+
+        A count of the total number of unique IP addresses of snowflake
+        proxies of type "webext" that have polled.
+
     "snowflake-idle-count" NUM NL
         [At most once.]
 

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