cmd/ursrv: Remove broken and unsustainable join/leave chart

This commit is contained in:
Jakob Borg 2023-01-31 09:10:52 +01:00
parent 5a50de1154
commit b10e11abb7
3 changed files with 2 additions and 48 deletions

View File

@ -53,13 +53,6 @@ func runAggregation(db *sql.DB) {
} }
log.Println("Inserted", rows, "rows") 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") since = maxIndexedDay(db, "Performance")
log.Println("Aggregating Performance data since", since) log.Println("Aggregating Performance data since", since)
rows, err = aggregatePerformance(db, since.Add(24*time.Hour)) rows, err = aggregatePerformance(db, since.Add(24*time.Hour))

View File

@ -582,7 +582,6 @@ func getReport(db *sql.DB) map[string]interface{} {
for rows.Next() { for rows.Next() {
err := rows.Scan(&rep.Received, &rep) err := rows.Scan(&rep.Received, &rep)
if err != nil { if err != nil {
log.Println("sql:", err) log.Println("sql:", err)
return nil return nil
@ -1158,9 +1157,11 @@ type sortableFeatureList []feature
func (l sortableFeatureList) Len() int { func (l sortableFeatureList) Len() int {
return len(l) return len(l)
} }
func (l sortableFeatureList) Swap(a, b int) { func (l sortableFeatureList) Swap(a, b int) {
l[a], l[b] = l[b], l[a] l[a], l[b] = l[b], l[a]
} }
func (l sortableFeatureList) Less(a, b int) bool { func (l sortableFeatureList) Less(a, b int) bool {
if l[a].Pct != l[b].Pct { if l[a].Pct != l[b].Pct {
return l[a].Pct < l[b].Pct return l[a].Pct < l[b].Pct

View File

@ -50,7 +50,6 @@ found in the LICENSE file.
<script type="text/javascript"> <script type="text/javascript">
google.setOnLoadCallback(drawVersionChart); google.setOnLoadCallback(drawVersionChart);
google.setOnLoadCallback(drawMovementChart);
google.setOnLoadCallback(drawBlockStatsChart); google.setOnLoadCallback(drawBlockStatsChart);
google.setOnLoadCallback(drawPerformanceCharts); google.setOnLoadCallback(drawPerformanceCharts);
@ -82,37 +81,6 @@ found in the LICENSE file.
chart.draw(data, options); 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) { function formatGibibytes(gibibytes, decimals) {
if(gibibytes == 0) return '0 GiB'; if(gibibytes == 0) return '0 GiB';
var k = 1024, var k = 1024,
@ -273,14 +241,6 @@ found in the LICENSE file.
</p> </p>
<div class="img-thumbnail" id="versionChart" style="width: 1130px; height: 400px; padding: 10px;"></div> <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"> <div id="block-stats">
<h4>Data Transfers per Day</h4> <h4>Data Transfers per Day</h4>
<p> <p>