-
Philipp Winter authored
Until now, we had no insight into how BridgeDB is being used. We don't know the relative popularity of our distribution method; we don't know how many users BridgeDB sees; we don't know how many requests succeed or fail; and we don't know the relative popularity of transports that users request. This patch attempts to answer these questions by making BridgeDB export usage metrics. At the end of each 24-hour measurement interval, BridgeDB will append usage metrics to the file METRICS_FILE, which is configured in bridgedb.conf. Our metrics keep track of the number of (un)successful requests per transport type per country code (or email provider) per distribution method. This way, we get to learn that, say, over the last 24 hours there were 31-40 users in Iran who successfully requested an obfs4 bridge over Moat. The corresponding metrics line would look as follows: bridgedb-metric-count moat.obfs4.ir.success.none 40 To make the metrics preserve user privacy, we don't collect user-identifying information and we introduce noise by rounding up metrics to our bin size which defaults to 10. This patch also extends the looping calls that BridgeDB spawns. When BridgeDB first starts, it loads proxies from the files PROXY_LIST_FILES. It augments this list of proxies with Tor exit relays that we download every three hours.