Add "Tor Browser updates by release channel" graph.

Implements #31755.
This commit is contained in:
Karsten Loesing 2019-10-02 12:24:38 +02:00
parent c30b25acbd
commit cba1711544
6 changed files with 85 additions and 0 deletions

View File

@ -1399,6 +1399,52 @@ plot_webstats_tb_locale <- function(start_p, end_p, path_p) {
ggsave(filename = path_p, width = 8, height = 5, dpi = 150)
}
prepare_webstats_tb_channel <- function(start_p = NULL, end_p = NULL) {
read_csv(file = paste(stats_dir, "webstats.csv", sep = ""),
col_types = cols(
log_date = col_date(format = ""),
request_type = col_factor(levels = NULL),
platform = col_skip(),
channel = col_factor(levels = NULL),
locale = col_skip(),
incremental = col_skip(),
count = col_double())) %>%
filter(if (!is.null(start_p)) log_date >= as.Date(start_p) else TRUE) %>%
filter(if (!is.null(end_p)) log_date <= as.Date(end_p) else TRUE) %>%
filter(request_type %in% c("tbup", "tbur")) %>%
filter(channel %in% c("a", "r")) %>%
group_by(log_date, channel, request_type) %>%
summarize(count = sum(count)) %>%
dcast(log_date + channel ~ request_type, value.var = "count") %>%
rename(date = log_date, update_pings = tbup, update_requests = tbur)
}
plot_webstats_tb_channel <- function(start_p, end_p, path_p) {
prepare_webstats_tb_channel(start_p, end_p) %>%
gather(request_type, count, -c(date, channel)) %>%
unite("request_type_channel", request_type, channel) %>%
mutate(request_type_channel = factor(request_type_channel,
levels = c("update_pings_r", "update_pings_a",
"update_requests_r", "update_requests_a"),
labels = c("Update pings (stable)", "Update pings (alpha)",
"Update requests (stable)", "Update requests (alpha)"))) %>%
ungroup() %>%
complete(date = full_seq(date, period = 1),
nesting(request_type_channel)) %>%
ggplot(aes(x = date, y = count)) +
geom_point() +
geom_line() +
scale_x_date(name = "", breaks = custom_breaks,
labels = custom_labels, minor_breaks = custom_minor_breaks) +
scale_y_continuous(name = "", labels = formatter, limits = c(0, NA)) +
facet_grid(request_type_channel ~ ., scales = "free_y") +
theme(strip.text.y = element_text(angle = 0, hjust = 0, size = rel(1.5)),
strip.background = element_rect(fill = NA)) +
ggtitle("Tor Browser updates by release channel") +
labs(caption = copyright_notice)
ggsave(filename = path_p, width = 8, height = 5, dpi = 150)
}
prepare_webstats_tm <- function(start_p = NULL, end_p = NULL) {
read_csv(file = paste(stats_dir, "webstats.csv", sep = ""),
col_types = cols(

View File

@ -51,6 +51,7 @@
<url-pattern>/webstats-tb.html</url-pattern>
<url-pattern>/webstats-tb-platform.html</url-pattern>
<url-pattern>/webstats-tb-locale.html</url-pattern>
<url-pattern>/webstats-tb-channel.html</url-pattern>
<url-pattern>/webstats-tm.html</url-pattern>
<url-pattern>/relays-ipv6.html</url-pattern>
<url-pattern>/bridges-ipv6.html</url-pattern>
@ -182,6 +183,9 @@
<url-pattern>/webstats-tb-locale.png</url-pattern>
<url-pattern>/webstats-tb-locale.pdf</url-pattern>
<url-pattern>/webstats-tb-locale.csv</url-pattern>
<url-pattern>/webstats-tb-channel.png</url-pattern>
<url-pattern>/webstats-tb-channel.pdf</url-pattern>
<url-pattern>/webstats-tb-channel.csv</url-pattern>
<url-pattern>/webstats-tm.png</url-pattern>
<url-pattern>/webstats-tm.pdf</url-pattern>
<url-pattern>/webstats-tm.csv</url-pattern>

View File

@ -88,6 +88,7 @@
"webstats-tb",
"webstats-tb-platform",
"webstats-tb-locale",
"webstats-tb-channel",
"webstats-tm"
]
}

View File

@ -415,6 +415,17 @@
"end"
]
},
{
"id": "webstats-tb-channel",
"title": "Tor Browser updates by release channel",
"type": "Graph",
"description": "<p>This graph shows absolute numbers of requests to Tor's web servers made by Tor Browser to check whether a newer version is available or to download a newer version, broken down by release channel.</p>",
"function": "webstats_tb_channel",
"parameters": [
"start",
"end"
]
},
{
"id": "webstats-tm",
"title": "Tor Messenger downloads and updates",

View File

@ -803,6 +803,7 @@ Applications <a href="#applications" name="applications" class="anchor">#</a></h
<li>Tor Browser downloads and updates <a href="/webstats-tb.html" class="btn btn-primary btn-xs"><i class="fa fa-chevron-right" aria-hidden="true"></i> graph</a></li>
<li>Tor Browser downloads and updates by platform <a href="/webstats-tb-platform.html" class="btn btn-primary btn-xs"><i class="fa fa-chevron-right" aria-hidden="true"></i> graph</a></li>
<li>Tor Browser downloads and updates by locale <a href="/webstats-tb-locale.html" class="btn btn-primary btn-xs"><i class="fa fa-chevron-right" aria-hidden="true"></i> graph</a></li>
<li>Tor Browser updates by release channel <a href="/webstats-tb-channel.html" class="btn btn-primary btn-xs"><i class="fa fa-chevron-right" aria-hidden="true"></i> graph</a></li>
<li>Tor Messenger downloads and updates <a href="/webstats-tm.html" class="btn btn-primary btn-xs"><i class="fa fa-chevron-right" aria-hidden="true"></i> graph</a></li>
</ul>

View File

@ -53,6 +53,7 @@ https://metrics.torproject.org/identifier.csv
<li><b>May 29, 2019:</b> Extended <a href="#onionperf-latencies">Circuit round-trip latencies</a> graph to contain high/low values.</li>
<li><b>June 2, 2019:</b> Added <a href="#onionperf-throughput">Throughput</a> graph.</li>
<li><b>August 5, 2019:</b> Re-added the <a href="#bandwidth">Total relay bandwidth</a> graph due to popular demand.</li>
<li><b>October 2, 2019:</b> Added <a href="#webstats-tb-channel">Tor Browser updates by release channel</a> graph.</li>
</ul>
</div>
@ -735,6 +736,27 @@ Applications <a href="#applications" name="applications" class="anchor">#</a></h
<li><b>update_pings:</b> Number of Tor Browser update pings.</li>
</ul>
<h3>Tor Browser updates by release channel
<a href="/webstats-tb-channel.html" class="btn btn-primary btn-xs"><i class="fa fa-chevron-right" aria-hidden="true"></i> graph</a>
<a href="/webstats-tb-channel.csv" class="btn btn-primary btn-xs"><i class="fa fa-chevron-right" aria-hidden="true"></i> data</a>
<a href="#webstats-tb-channel" name="webstats-tb-channel" class="anchor">#</a></h3>
<h4>Parameters</h4>
<ul>
<li><b>start:</b> First UTC date (YYYY-MM-DD) to include in the file.</li>
<li><b>end:</b> Last UTC date (YYYY-MM-DD) to include in the file.</li>
</ul>
<h4>Columns</h4>
<ul>
<li><b>date:</b> UTC date (YYYY-MM-DD) when requests to <code>torproject.org</code> web servers have been logged.</li>
<li><b>channel:</b> Release channel, like "r" for stable releases and "a" for alpha releases.</li>
<li><b>update_pings:</b> Number of Tor Browser update pings.</li>
<li><b>update_requests:</b> Number of Tor Browser update requests.</li>
</ul>
<h3>Tor Messenger downloads and updates
<a href="/webstats-tm.html" class="btn btn-primary btn-xs"><i class="fa fa-chevron-right" aria-hidden="true"></i> graph</a>
<a href="/webstats-tm.csv" class="btn btn-primary btn-xs"><i class="fa fa-chevron-right" aria-hidden="true"></i> data</a>