diff options
author | Jakob Borg <jakob@kastelo.net> | 2023-01-31 09:10:52 +0100 |
---|---|---|
committer | Jakob Borg <jakob@kastelo.net> | 2023-01-31 09:10:52 +0100 |
commit | b10e11abb79d17be0180012bc17000964b7a3865 (patch) | |
tree | a498749c5b7169d3332c6f59464a580b0482335f | |
parent | 5a50de1154416408ba147444a3c0d0f50abe88d0 (diff) |
cmd/ursrv: Remove broken and unsustainable join/leave chart
-rw-r--r-- | cmd/uraggregate/main.go | 7 | ||||
-rw-r--r-- | cmd/ursrv/main.go | 3 | ||||
-rw-r--r-- | cmd/ursrv/static/index.html | 40 |
3 files changed, 2 insertions, 48 deletions
diff --git a/cmd/uraggregate/main.go b/cmd/uraggregate/main.go index 29ba019099..6a2deb4f5f 100644 --- a/cmd/uraggregate/main.go +++ b/cmd/uraggregate/main.go @@ -53,13 +53,6 @@ func runAggregation(db *sql.DB) { } log.Println("Inserted", rows, "rows") - log.Println("Aggregating UserMovement data") - rows, err = aggregateUserMovement(db) - if err != nil { - log.Println("aggregate:", err) - } - log.Println("Inserted", rows, "rows") - since = maxIndexedDay(db, "Performance") log.Println("Aggregating Performance data since", since) rows, err = aggregatePerformance(db, since.Add(24*time.Hour)) diff --git a/cmd/ursrv/main.go b/cmd/ursrv/main.go index 91e56a6223..4c882d6436 100644 --- a/cmd/ursrv/main.go +++ b/cmd/ursrv/main.go @@ -582,7 +582,6 @@ func getReport(db *sql.DB) map[string]interface{} { for rows.Next() { err := rows.Scan(&rep.Received, &rep) - if err != nil { log.Println("sql:", err) return nil @@ -1158,9 +1157,11 @@ type sortableFeatureList []feature func (l sortableFeatureList) Len() int { return len(l) } + func (l sortableFeatureList) Swap(a, b int) { l[a], l[b] = l[b], l[a] } + func (l sortableFeatureList) Less(a, b int) bool { if l[a].Pct != l[b].Pct { return l[a].Pct < l[b].Pct diff --git a/cmd/ursrv/static/index.html b/cmd/ursrv/static/index.html index b59bd2e839..327c6efcfa 100644 --- a/cmd/ursrv/static/index.html +++ b/cmd/ursrv/static/index.html @@ -50,7 +50,6 @@ found in the LICENSE file. <script type="text/javascript"> google.setOnLoadCallback(drawVersionChart); - google.setOnLoadCallback(drawMovementChart); google.setOnLoadCallback(drawBlockStatsChart); google.setOnLoadCallback(drawPerformanceCharts); @@ -82,37 +81,6 @@ found in the LICENSE file. chart.draw(data, options); } - function drawMovementChart() { - var jsonData = $.ajax({url: "movement.json", dataType:"json", async: false}).responseText; - var rows = JSON.parse(jsonData); - - var data = new google.visualization.DataTable(); - data.addColumn('date', 'Day'); - for (var i = 1; i < rows[0].length; i++){ - data.addColumn('number', rows[0][i]); - } - - for (var i = 1; i < rows.length; i++){ - rows[i][0] = new Date(rows[i][0]); - if (rows[i][1] > 500) { - rows[i][1] = null; - } - if (rows[i][2] < -500) { - rows[i][2] = null; - } - data.addRow(rows[i]); - }; - - var options = { - legend: { position: 'bottom', alignment: 'center' }, - colors: ['rgb(102,194,165)','rgb(252,141,98)','rgb(141,160,203)','rgb(231,138,195)','rgb(166,216,84)','rgb(255,217,47)'], - chartArea: {left: 80, top: 20, width: '1020', height: '300'}, - }; - - var chart = new google.visualization.AreaChart(document.getElementById('movementChart')); - chart.draw(data, options); - } - function formatGibibytes(gibibytes, decimals) { if(gibibytes == 0) return '0 GiB'; var k = 1024, @@ -273,14 +241,6 @@ found in the LICENSE file. </p> <div class="img-thumbnail" id="versionChart" style="width: 1130px; height: 400px; padding: 10px;"></div> - <h4 id="joining-leaving">Users Joining and Leaving per Day</h4> - <p> - This is the total number of unique users joining and leaving per day. A user is counted as "joined" on first the day their unique ID is seen, and as "left" on the last day the unique ID was seen before a two weeks or longer absence. "Bounced" refers to users who joined and left on the same day. - </p> - <div class="img-thumbnail" id="movementChart" style="width: 1130px; height: 400px; padding: 10px;"></div> - <p class="text-muted"> - Reappearance of users cause the "left" data to shrink retroactively. - </p> <div id="block-stats"> <h4>Data Transfers per Day</h4> <p> |