[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] [metrics-db/master] Stop generating .csv files.



Author: Karsten Loesing <karsten.loesing@xxxxxxx>
Date: Tue, 26 Oct 2010 14:01:00 +0200
Subject: Stop generating .csv files.
Commit: d120548049e0f4929b66e36910041c00914b63b1

---
 R/bridge-stats.R    |    8 -------
 R/consensus-stats.R |   12 ----------
 R/dirreq-stats.R    |   24 --------------------
 R/gettor.R          |   24 --------------------
 R/graphs.R          |    7 ------
 R/monthly-users.R   |   59 ---------------------------------------------------
 R/torperf.R         |    6 -----
 build.xml           |    4 +-
 plot.sh             |    3 --
 9 files changed, 2 insertions(+), 145 deletions(-)
 delete mode 100644 R/bridge-stats.R
 delete mode 100644 R/consensus-stats.R
 delete mode 100644 R/dirreq-stats.R
 delete mode 100644 R/gettor.R
 delete mode 100644 R/graphs.R
 delete mode 100644 R/monthly-users.R
 delete mode 100644 R/torperf.R
 delete mode 100755 plot.sh

diff --git a/R/bridge-stats.R b/R/bridge-stats.R
deleted file mode 100644
index 6e40e1f..0000000
--- a/R/bridge-stats.R
+++ /dev/null
@@ -1,8 +0,0 @@
-if (file.exists("stats/bridge-stats")) {
-  bridge <- read.csv("stats/bridge-stats", header = TRUE,
-    stringsAsFactors = FALSE)
-  bridge <- bridge[1:length(bridge$date)-1,]
-  write.csv(bridge, "website/csv/bridge-users.csv", quote = FALSE,
-    row.names = FALSE)
-}
-
diff --git a/R/consensus-stats.R b/R/consensus-stats.R
deleted file mode 100644
index b40f634..0000000
--- a/R/consensus-stats.R
+++ /dev/null
@@ -1,12 +0,0 @@
-if (file.exists("stats/consensus-stats")) {
-  consensuses <- read.csv("stats/consensus-stats", header = TRUE,
-      stringsAsFactors = FALSE);
-  consensuses <- consensuses[1:length(consensuses$date)-1,]
-  write.csv(data.frame(date = consensuses$date,
-    relays = consensuses$running, bridges = consensuses$brunning),
-    "website/csv/networksize.csv", quote = FALSE, row.names = FALSE)
-  write.csv(data.frame(date = consensuses$date,
-    all = consensuses$running, exit = consensuses$exit),
-    "website/csv/exit.csv", quote = FALSE, row.names = FALSE)
-}
-
diff --git a/R/dirreq-stats.R b/R/dirreq-stats.R
deleted file mode 100644
index 1871b5d..0000000
--- a/R/dirreq-stats.R
+++ /dev/null
@@ -1,24 +0,0 @@
-if (file.exists("stats/dirreq-stats")) {
-  dirreq <- read.csv("stats/dirreq-stats", header = TRUE,
-    stringsAsFactors = FALSE)
-  gabelmooSub <- subset(dirreq, directory %in%
-    c("68333D0761BCF397A587A0C0B963E4A9E99EC4D3",
-      "F2044413DAC2E02E3D6BCF4735A19BCA1DE97281"))
-  gabelmoo <- data.frame(date = gabelmooSub$date,
-    gabelmooSub[3:(length(gabelmooSub) - 1)] * 6)
-  trustedSub <- dirreq[dirreq$directory ==
-    "8522EB98C91496E80EC238E732594D1509158E77",]
-  trustedSub[!is.na(trustedSub$share) & trustedSub$share < 0.01,
-    3:length(trustedSub)] <- NA
-  # Take out values when trusted saw less than 1 % of all requests
-  trustedSub[!is.na(trustedSub$share) & trustedSub$share < 1,
-             3:length(trustedSub)] <- NA
-  trusted <- data.frame(date = trustedSub$date,
-    floor(trustedSub[3:(length(trustedSub) - 1)] / trustedSub$share * 10))
-
-  write.csv(gabelmoo, "website/csv/new-users.csv", quote = FALSE,
-    row.names = FALSE)
-  write.csv(trusted, "website/csv/direct-users.csv", quote = FALSE,
-    row.names = FALSE)
-}
-
diff --git a/R/gettor.R b/R/gettor.R
deleted file mode 100644
index 30e7f34..0000000
--- a/R/gettor.R
+++ /dev/null
@@ -1,24 +0,0 @@
-if (file.exists("stats/gettor-stats")) {
-  gettor <- read.csv("stats/gettor-stats", header = TRUE,
-      stringsAsFactors = FALSE);
-  start <- as.Date(min(gettor$date))
-  end <- seq(from = Sys.Date(), length = 2, by = "-1 day")[2]
-  total <- data.frame(date = gettor$date,
-    packages = rowSums(gettor[2:length(gettor)]) - gettor$none)
-  en <- data.frame(date = gettor$date,
-    packages = gettor$tor.browser.bundle_en + gettor$tor.im.browser.bundle_en)
-  zh_cn <- data.frame(date = gettor$date,
-    packages = gettor$tor.browser.bundle_zh_cn +
-    gettor$tor.im.browser.bundle_zh_cn)
-  fa <- data.frame(date = gettor$date,
-    packages = gettor$tor.browser.bundle_fa + gettor$tor.im.browser.bundle_fa)
-
-  write.csv(data.frame(date = gettor$date,
-    total = rowSums(gettor[2:length(gettor)]) - gettor$none,
-    en = gettor$tor.browser.bundle_en + gettor$tor.im.browser.bundle_en,
-    zh_cn = gettor$tor.browser.bundle_zh_cn +
-      gettor$tor.im.browser.bundle_zh_cn,
-    fa = gettor$tor.browser.bundle_fa + gettor$tor.im.browser.bundle_fa),
-    "website/csv/gettor.csv", quote = FALSE, row.names = FALSE)
-}
-
diff --git a/R/graphs.R b/R/graphs.R
deleted file mode 100644
index bfb65cc..0000000
--- a/R/graphs.R
+++ /dev/null
@@ -1,7 +0,0 @@
-source("R/consensus-stats.R");
-source("R/dirreq-stats.R");
-source("R/bridge-stats.R");
-source("R/torperf.R");
-source("R/gettor.R");
-source("R/monthly-users.R");
-
diff --git a/R/monthly-users.R b/R/monthly-users.R
deleted file mode 100644
index deef458..0000000
--- a/R/monthly-users.R
+++ /dev/null
@@ -1,59 +0,0 @@
-options(warn = -1)
-suppressPackageStartupMessages(library("ggplot2"))
-
-# Ensure that both input files exist
-if (file.exists("stats/dirreq-stats") &
-    file.exists("stats/bridge-stats")) {
-
-  # Read direct user numbers
-  dirreq <- read.csv("stats/dirreq-stats", header = TRUE,
-    stringsAsFactors = FALSE)
-  trustedSub <- dirreq[dirreq$directory ==
-    "8522EB98C91496E80EC238E732594D1509158E77",]
-  trustedSub[!is.na(trustedSub$share) & trustedSub$share < 1,
-    3:length(trustedSub)] <- NA
-  trusted <- data.frame(date = trustedSub$date,
-    floor(trustedSub[3:(length(trustedSub) - 1)] / trustedSub$share * 10))
-
-  # Read bridge user numbers
-  bridge <- read.csv("stats/bridge-stats", header = TRUE,
-    stringsAsFactors = FALSE)
-  bridge <- bridge[1:length(bridge$date)-1,]
-  bridge <- data.frame(date = bridge[,1],
-    floor(bridge[,2:length(bridge[1,])]))
-
-  # Melt both data frames and append them
-  bridge_melted <- data.frame(melt(bridge, id.vars = "date", na.rm = TRUE),
-    source = "bridge")
-  direct_melted <- data.frame(melt(trusted, id.vars = "date", na.rm = TRUE),
-    source = "direct")
-  both_melted <- rbind(bridge_melted, direct_melted)
-
-  # Merge data source (bridge or direct)
-  country_day <- aggregate(both_melted$value,
-    by = list(date = both_melted$date, country = both_melted$variable), sum)
-
-  # Merge months
-  month_mean <- aggregate(country_day$x,
-    by = list(month = substr(country_day$date, 1, 7),
-    country = country_day$country), mean)
-  month_max <- aggregate(country_day$x,
-    by = list(month = substr(country_day$date, 1, 7),
-    country = country_day$country), max)
-
-  # Convert to final matrices
-  month_peak <- t(matrix(month_max$x,
-    ncol = length(unique(month_max$country)),
-    dimnames = list(unique(month_max$month),
-    as.vector(unique(month_max$country)))))
-  month_avg <- t(matrix(floor(month_mean$x),
-    ncol = length(unique(month_mean$country)),
-    dimnames = list(unique(month_mean$month),
-    as.vector(unique(month_mean$country)))))
-
-  # Write to disk
-  write.csv(month_peak, "website/csv/monthly-users-peak.csv", quote = FALSE)
-  write.csv(month_avg, "website/csv/monthly-users-average.csv",
-    quote = FALSE)
-}
-
diff --git a/R/torperf.R b/R/torperf.R
deleted file mode 100644
index 9c38235..0000000
--- a/R/torperf.R
+++ /dev/null
@@ -1,6 +0,0 @@
-if (file.exists("stats/torperf-stats")) {
-  t <- read.csv("stats/torperf-stats", colClasses = c("character", "Date",
-    "integer", "integer", "integer"))
-  write.csv(t, "website/csv/torperf.csv", quote = FALSE, row.names = FALSE)
-}
-
diff --git a/build.xml b/build.xml
index 39c74b2..cf440ab 100644
--- a/build.xml
+++ b/build.xml
@@ -22,14 +22,14 @@
 <!--ERNIE-specific targets -->
   <target name="init">
     <mkdir dir="${classes}"/>
-    <mkdir dir="website/csv"/>
   </target>
   <target name="compile" depends="init"> 
     <javac srcdir="${sources}"
            destdir="${classes}"
            excludes="org/torproject/ernie/web/"
            debug="true" debuglevel="lines,source"
-           classpath="lib/commons-codec-1.4.jar;lib/commons-compress-1.0.jar;lib/postgresql-8.4-701.jdbc4.jar"/>
+           classpath="lib/commons-codec-1.4.jar;lib/commons-compress-1.0.jar;lib/postgresql-8.4-701.jdbc4.jar"
+           includeantruntime="false"/>
   </target>
   <target name="run" depends="compile">
     <java classpath="${classes};lib/commons-codec-1.4.jar:lib/commons-compress-1.0.jar;lib/postgresql-8.4-701.jdbc4.jar"
diff --git a/plot.sh b/plot.sh
deleted file mode 100755
index c538245..0000000
--- a/plot.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-TZ=GMT R --slave < R/graphs.R
-
-- 
1.7.1