[tor-commits] [metrics-web/master] Remove view containing one consensus per month.

karsten at torproject.org karsten at torproject.org
Wed Jan 18 11:51:50 UTC 2012


commit d25007efbb31b5e08ed5f993597416c4dbedd33b
Author: Karsten Loesing <karsten.loesing at gmx.net>
Date:   Wed Jan 18 12:49:15 2012 +0100

    Remove view containing one consensus per month.
    
    This view depended on the old statusentry table that we partitioned
    recently.  The .csv file that used this view wasn't linked from anywhere.
    Get rid of the view and .csv file.
---
 db/tordir.sql                                |   22 ----------------------
 rserve/csv.R                                 |   12 ------------
 src/org/torproject/ernie/web/CsvServlet.java |    1 -
 3 files changed, 0 insertions(+), 35 deletions(-)

diff --git a/db/tordir.sql b/db/tordir.sql
index 7ae0afe..e1ca324 100644
--- a/db/tordir.sql
+++ b/db/tordir.sql
@@ -329,28 +329,6 @@ RETURNS geoip_result AS $$
   BETWEEN geoipdb.ipstart AND geoipdb.ipend LIMIT 1;
 $$ LANGUAGE SQL;
 
--- View that contains the relays of the first known consensuses of all
--- months in the database.
-CREATE OR REPLACE VIEW relays_monthly_snapshots AS
-SELECT status.validafter, status.fingerprint, status.nickname,
-    status.address, (status.geoip).country, (status.geoip).latitude,
-    (status.geoip).longitude, status.isexit, status.isfast,
-    status.isguard, status.isstable, status.version, status.ports,
-    descriptor.bandwidthavg, descriptor.bandwidthburst,
-    descriptor.bandwidthobserved
-FROM (
-  SELECT *, geoip_lookup(address) AS geoip
-  FROM statusentry
-  WHERE validafter IN (
-    SELECT MIN(validafter)
-    FROM consensus
-    GROUP BY DATE_TRUNC('month', validafter)
-  )
-) AS status
-LEFT JOIN descriptor
-ON status.descriptor = descriptor.descriptor
-ORDER BY validafter, fingerprint;
-
 -- FUNCTION refresh_relay_statuses_per_day()
 -- Updates helper table which is used to refresh the aggregate tables.
 CREATE OR REPLACE FUNCTION refresh_relay_statuses_per_day()
diff --git a/rserve/csv.R b/rserve/csv.R
index 5693413..20b9c8a 100644
--- a/rserve/csv.R
+++ b/rserve/csv.R
@@ -293,18 +293,6 @@ export_connbidirect <- function(path) {
       quote = FALSE, row.names = FALSE)
 }
 
-export_relays_monthly_snapshots <- function(path) {
-  drv <- dbDriver("PostgreSQL")
-  con <- dbConnect(drv, user = dbuser, password = dbpassword, dbname = db)
-  q <- paste("SELECT * FROM relays_monthly_snapshots")
-  rs <- dbSendQuery(con, q)
-  c <- fetch(rs, n = -1)
-  dbDisconnect(con)
-  dbUnloadDriver(drv)
-  write.csv(format(c, trim = TRUE, scientific = FALSE), path,
-      quote = FALSE, row.names = FALSE)
-}
-
 export_dirreq_stats <- function(path) {
   drv <- dbDriver("PostgreSQL")
   con <- dbConnect(drv, user = dbuser, password = dbpassword, dbname = db)
diff --git a/src/org/torproject/ernie/web/CsvServlet.java b/src/org/torproject/ernie/web/CsvServlet.java
index 01cdb28..593f584 100644
--- a/src/org/torproject/ernie/web/CsvServlet.java
+++ b/src/org/torproject/ernie/web/CsvServlet.java
@@ -42,7 +42,6 @@ public class CsvServlet extends HttpServlet {
     this.availableCsvFiles.add("monthly-users-peak");
     this.availableCsvFiles.add("networksize");
     this.availableCsvFiles.add("platforms");
-    this.availableCsvFiles.add("relays-monthly-snapshots");
     this.availableCsvFiles.add("relaycountries");
     this.availableCsvFiles.add("relayflags");
     this.availableCsvFiles.add("relayflags-hour");



More information about the tor-commits mailing list