Opened 6 years ago

Closed 6 years ago

#11799 closed task (implemented)

Include total PT usage in userstats-bridge-transport

Reported by: asn Owned by:
Priority: Medium Milestone:
Component: Metrics/Website Version:
Severity: Keywords:
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:



this is like #11399, but it would be great if the graphs could also include scramblesuit users.

It would also be amazing if there was a graph that prints the sum of all the PT activity. So that we can compare that graph with the total OR activity (userstats-bridge-country) to evaluate the deployment of PTs.

If you need help with the coding, please tell me.

(Hm, actually I don't know whether userstats-bridge-country includes PT activity.)

Child Tickets

Attachments (1)

0001-Option-to-plot-sum-of-all-non-OR-transports.patch (3.8 KB) - added by joelanders 6 years ago.

Download all attachments as: .zip

Change History (5)

comment:1 Changed 6 years ago by karsten

Added scramblesuit to the list of transports.

Adding a graph with the sum of all transports except "<OR>" and "<??>" requires some R hacking. It's probably easiest if I do that, but just in case you're feeling like you might enjoy writing R code, here's what I would do:

  • Think about a new parameter to pass to plot_userstats_bridge_transport instead of the actual transport name. I could imagine "!<*>". It needs to be different from any future transport names. That's also the parameter value that will be passed from the HTML form.
  • Extend plot_userstats in the same source file to handle that special transport name. The data frame created in line 816 will contain more than one row per date, so we'll have to use aggregate() to sum them up. There's an example for using aggregate() in line 734.
  • Add the new "sum of all transports" transport to website, which is very similar to how scramblesuit, meek, FTE, etc. have been added.

Let me know if you want to hack on this. If not, I'll do it.

comment:2 Changed 6 years ago by karsten

Summary: Include scramblesuit and total PT usage to userstats-bridge-transportInclude total PT usage in userstats-bridge-transport

Updating the summary to reflect that part of this ticket is already done.

comment:3 Changed 6 years ago by joelanders

Patch for your consideration.
(I tested the R part a bit, so I think that works, but I didn't actually slog through the server setup and database import. My version of ggplot2 didn't play well with this code, anyway.)

comment:4 Changed 6 years ago by karsten

Resolution: implemented
Status: newclosed

Works like a charm! I made two very minor tweaks, but mostly deployed this as is. Thanks!

Note: See TracTickets for help on using tickets.