add comon_analysis graph
authorStephen Soltesz <soltesz@cs.princeton.edu>
Fri, 25 Jun 2010 15:40:50 +0000 (15:40 +0000)
committerStephen Soltesz <soltesz@cs.princeton.edu>
Fri, 25 Jun 2010 15:40:50 +0000 (15:40 +0000)
statistics/comon_analysis.r [new file with mode: 0644]
statistics/functions.r
statistics/myops_restoration.r
statistics/node_history_may0809.r
statistics/operator_overhead.r

diff --git a/statistics/comon_analysis.r b/statistics/comon_analysis.r
new file mode 100644 (file)
index 0000000..b0c0747
--- /dev/null
@@ -0,0 +1,110 @@
+
+source("functions.r")
+cm <- read.csv('comon_analysis.txt', sep=',', header=TRUE)
+
+planetlab_releases <- function (height) 
+{
+    h = height
+    tstamp_20040412 <-abline_at_date("2004-04-12", col='white', lty=0, height=h)
+    tstamp_20041112 <-abline_at_date("2004-11-12", col='grey60', lty=3, height=h)
+    tstamp_20050301 <-abline_at_date("2005-03-01", col='grey60', lty=3, height=h)
+    tstamp_20050615 <-abline_at_date("2005-06-15", col='white',  lty=0, height=h)
+    tstamp_20051001 <-abline_at_date("2005-10-01", col='grey60', lty=3, height=h)
+    tstamp_20060519 <-abline_at_date("2006-05-19", col='grey60', lty=3, height=h)
+    tstamp_20070228 <-abline_at_date("2007-02-28", col='grey60', lty=3, height=h)
+    tstamp_20070501 <-abline_at_date("2007-05-01", col='white',  lty=0, height=h)
+    tstamp_20071021 <-abline_at_date("2007-10-21", col='grey60', lty=3, height=h)
+    tstamp_20080601 <-abline_at_date("2008-06-01", col='grey60', lty=3, height=h)
+    tstamp_20080815 <-abline_at_date("2008-08-15", col='white',  lty=0, height=h)
+    tstamp_20090501 <-abline_at_date("2009-05-01", col='grey60', lty=3, height=h)
+    tstamp_20100201 <-abline_at_date("2010-02-01", col='white',  lty=0, height=h)
+
+    text(x=c(tstamp_20040412,
+            tstamp_20041112,
+            tstamp_20050301,
+            tstamp_20050615,
+            tstamp_20051001,
+            tstamp_20060519,
+            tstamp_20070228,
+            tstamp_20071021,
+            tstamp_20080601,
+            tstamp_20090501),
+         y=c(h),
+         labels=c('Release', '3.0', '3.1', '', '3.2', '3.3', '4.0', '4.1', '4.2', '4.3')) 
+}
+
+# needs:
+#   xlim=c(min_ts, max_ts)
+#   labels = names
+#   at = ts position
+#   x
+#   y
+time_graph_setup <- function (from, to)
+{
+    # find 'type' range of days
+    xlim <- c(tstamp(from, format="%Y/%m/%d"), tstamp(to, format="%Y/%m/%d"))
+
+    date_months <-seq(as.Date(from), as.Date(to), 'month')
+    date_years <-seq(as.Date(from), as.Date(to), 'year')
+    month_str <- format(date_months, "%b")
+    month_ts <- unclass(as.POSIXct(date_months))
+
+    year_str <- format(date_years, "%Y")
+    year_ts <- unclass(as.POSIXct(date_years))+180*60*60*24
+        
+    return (list(xlim=xlim, month_str=month_str, 
+                 month_ts=month_ts, year_str=year_str, 
+                 year_ts=year_ts))
+}
+
+tg <- time_graph_setup('2004/1/1', '2010/6/28')
+
+start_image("platform_availability.png")
+par(mfrow=c(2,1))
+# bottom, left, top, right margins
+par(mai=c(0.2, 1, 0.3, 0.1))
+
+
+
+plot(cm$ts, cm$online, type='l', col='black', 
+        axes=F,
+        xlab="",
+        xlim=tg$xlim,
+        ylim=c(0,900),
+        ylab="a) Online Node Count")
+
+#axis(1, labels=tg$month_str, at=tg$month_ts, cex.axis=0.7)
+#axis(1, tick=F, labels=tg$year_str, at=tg$year_ts, cex.axis=0.7, line=1)
+axis(1, labels=c("","","","","","",""), at=tg$year_ts, cex.axis=0.7, line=-0.5)
+axis(2, las=1)
+planetlab_releases(800)
+
+
+par(mai=c(1, 1, 0.2, 0.1))
+
+plot(cm$ts, log(cm$X2nd), type='l', col='grey75',
+        axes=F,
+        xlab="",
+        xlim=tg$xlim,
+        ylim=c(7,18), 
+        ylab="b) Node Uptime by Quartile (days)")
+
+axis(1, labels=tg$month_str, at=tg$month_ts, cex.axis=0.7)
+axis(1, tick=F, labels=tg$year_str, at=tg$year_ts, cex.axis=0.7, line=1)
+# TODO: change labels to days up, rather than log(days).
+d<-c(.1,1,3.5,7,15,30,60,120,240)
+axis(2, labels=d, at=log(d*60*60*24),las=1)
+
+lines(cm$ts, log(cm$X3rd), col='black')
+lines(cm$ts, log(cm$X4th), col='grey50')
+#lines(cm$ts, log(cm$X5th), col='grey75')
+
+abline(h=log(max(cm$X2nd[which(!is.na(cm$X2nd))])), col='grey80', lty=2)
+abline(h=log(max(cm$X3rd[which(!is.na(cm$X3rd))])), col='grey80', lty=2)
+abline(h=log(max(cm$X4th[which(!is.na(cm$X4th))])), col='grey80', lty=2)
+#abline(h=log(max(cm$X5th[which(!is.na(cm$X5th))])), col='grey80', lty=2)
+abline(h=log(7*60*60*24), col='grey80', lty=2)
+
+planetlab_releases(18)
+
+end_image()
index d9e4023..e02ee67 100644 (file)
@@ -414,3 +414,9 @@ tstamp <- function (date, format="%Y-%m-%d")
     ts <- unclass(as.POSIXct(date, format=format, origin="1970-01-01"))[1]
     return (ts)
 }
+
+lowess_smooth <- function (x, y, delta=(60*60*24), f=0.02)
+{
+    a<-lowess(x, y, delta=delta, f=f)
+    return (a);
+}
index c55db03..838e0b1 100644 (file)
@@ -131,6 +131,24 @@ hbreaks<-unclass(as.POSIXct(dates))
 x_start<-unclass(as.POSIXct("2008-05-01", origin="1970-01-01"))[1]
 x_end  <-unclass(as.POSIXct("2009-06-1", origin="1970-01-01"))[1]
 
+
+tstamp_0510 <-abline_at_date("2008-05-10", col='grey20', lty=0, height=570)
+# dates takes from reboot_image() output for API events.
+# green
+tstamp_0610 <-abline_at_date("2008-06-10", col='grey40', lty=5, height=570)
+tstamp_0815 <-abline_at_date("2008-08-15", col='grey70', lty=1, height=570)
+
+# red
+#tstamp_0905 <-abline_at_date("2008-09-05", col='grey70', height=570)
+tstamp_0924 <-abline_at_date("2008-09-24", col='grey70', lty=1, height=570)
+tstamp_1015 <-abline_at_date("2008-10-15", col='grey40', lty=5, height=570)
+# blue
+#tstamp_1105 <-abline_at_date("2008-11-05", col='white', lty=2, height=570)
+#tstamp_1214 <-abline_at_date("2008-12-14", col='grey70', height=570)
+tstamp_0223 <-abline_at_date("2009-02-23", col='grey70', height=570)
+# red
+#tstamp_0313 <-abline_at_date("2009-03-13", col='grey70', height=570)
+
 start_image("myops_restore_nopcu.png")
 par(mfrow=c(2,1))
 par(mai=c(.9,.8,.1,.1))
@@ -154,7 +172,7 @@ axis(1, cex.axis=0.7, labels=months, at=hbreaks)
        
 
 
-#tstamp_0510 <-abline_at_date("2008-05-10", col='grey20', lty=0, height=570)
+tstamp_0510 <-abline_at_date("2008-05-10", col='grey20', lty=0, height=570)
 # dates takes from reboot_image() output for API events.
 # green
 tstamp_0610 <-abline_at_date("2008-06-10", col='grey40', lty=5, height=570)
@@ -198,10 +216,10 @@ text(x=c(tstamp_0510-(60*60*24*10),
 mtext("2008                                 2009", 1,2)
 legend(unclass(as.POSIXct("2009-02-23", origin="1970-01-01"))[1], 200,
         cex=0.7,
-        legend=c("Typical MyOps", "Notice Bug", "Kernel Bug", 'Bug Added', 'Fix Added'),
+        legend=c("Typical MyOps", "Bug1", "Bug2", 'Bug Added', 'Fix Added'),
         pch=c('-', '-', '-'),
-        col=c('red', 'blue', 'darkgreen', 'grey20', 'grey70'),
-        lty=c(1, 2, 3, 5, 1), merge=T)
+        col=c('red', 'darkgreen', 'blue', 'grey20', 'grey70'),
+        lty=c(1, 3, 2, 5, 1), merge=T)
 
         #legend=c("Registered", "Online", 'Kernel Update', 'MyOps Event'),
         #pch=c('-', '-', '-', '-'),
@@ -273,7 +291,7 @@ abline(v=c(91), col='grey80', lty=2)
 
 legend(92, 0.25,
        cex=0.7,
-       legend=c("Typical MyOps", "Notice Bug", "Kernel Bug"),
+       legend=c("Typical MyOps", "Only Notices", "No Notices"),
        pch=c('-', '-', '-'),
        col=c('red', 'blue', 'darkgreen'),
        lty=c(1, 2, 3), merge=T)
index ac7c3df..526cfb6 100644 (file)
@@ -87,5 +87,5 @@ legend(unclass(as.POSIXct("2009-02-23", origin="1970-01-01"))[1], 200,
         #col=c('blue', 'red', 'grey20', 'grey70'),
         #lty=c(1, 1, 2, 1), merge=T)
 
-end_image()
+#end_image()
 
index 6658366..c62c399 100644 (file)
@@ -121,12 +121,6 @@ online_nodes <- function (fb)
     return (rbind(x,n,o))
 }
 
-lowess_smooth <- function (x, y, delta=(60*60*24), f=0.02)
-{
-    a<-lowess(x, y, delta=delta, f=f)
-    return (a);
-}
-
 #####
 
 # system("parse_rt_data.py 3 > rt_data.csv");
@@ -134,7 +128,7 @@ t <- read.csv('rt_data_2004-2010.csv', sep=',', header=TRUE)
 t2 <- t[which(t$complete == 1),]
 ot <- open_tickets(t2, '2004/1/1', '2010/2/28', 'day', "%b")
 
-start_image("rt_operator_overhead.png")
+#start_image("rt_operator_overhead.png")
 par(mfrow=c(2,1))
 par(mai=c(0,1,0.3,0.1))
 
@@ -276,4 +270,4 @@ text(x=c(tstamp_20040412,
 #     y=c(15),
 #     labels=c('3.0', '3.1', '3.1S', '3.2', '4.0', '4.2', '4.3')) 
 
-end_image()
+#end_image()