Skip to content

add total data output field to metrics page

what it does: adds a field that says how many gb/tb/pb a relay has sent in the past (up to 5 years) using the graphs from the bottom of the page, and then editing the DOM

I have added an element between flags and uptime in the page for individual relay metrics.

helpers.js has new functions: number of bytes -> pretty printed "501.6 GB" etc. and an integral function for area under graphs

main.js has a _.each() replaced with a for loop, so that I can grab the data from the longest time frame and calculate the total data throughput

things I'm not sure about: whether the tip span class="tip" title="the total amount of data donated by this relay in the past 5 years">Total Data</span works like the others

testing: I have set up my chromium to inject my javascript changes, and I used inspect element to change the HTML. this seems to work. I am assuming the changes I made will "just work" when run on production...

Sorry if this merge request is awful, it is my first one ever 😄

Edited by trauts1234

Merge request reports

Loading