4 available_nodes <- function (ns, from, to, type, fmt="%b")
6 # find 'type' range of days
7 dates <-seq(as.Date(from), as.Date(to), type)
8 months <- format(dates, fmt)
9 hbreaks<-unclass(as.POSIXct(dates))
14 for ( i in seq(1,length(hbreaks)-1) )
17 ns_sub <- ns[which(ns$date > hbreaks[i] & ns$date <= hbreaks[i+1] & ns$status == 'BOOT'),]
18 nodes <- length(ns_sub$date)
20 xx<- c(xx, hbreaks[i])
24 m<- months[1:length(months)-1]
25 return (rbind(xx,yy,m))
30 open_tickets <- function (t, from, to, type, fmt="%b")
32 # find 'type' range of days
33 dates <-seq(as.Date(from), as.Date(to), type)
34 months <- format(dates, fmt)
35 hbreaks<-unclass(as.POSIXct(dates))
40 for ( i in seq(1,length(hbreaks)-1) )
42 # identify any tickets with a start time in range, lastreply in range
43 # or where both start is less and lastreply is greater than the range
44 t_sub <- t[which( (t$start < hbreaks[i] & t$lastreply > hbreaks[i+1]) |
45 (t$start > hbreaks[i] & t$start <= hbreaks[i+1]) |
46 (t$lastreply > hbreaks[i] & t$lastreply <= hbreaks[i+1]) ),]
47 tickets <- length(t_sub$start)
48 #if ( nrow(t_sub) > 0 ){
49 # for ( j in seq(1,nrow(t_sub)) )
51 # #print(sprintf("id %s, date %s", t_sub[i,'ticket_id'], t_sub[i,'s1']))
52 # print(sprintf("id %s, date %s", t_sub[j,]$ticket_id, t_sub[j, 's1']))
56 xx<- c(xx, hbreaks[i])
60 m<- months[1:length(months)-1]
61 return (rbind(xx,yy,m))
64 online_nodes <- function (fb)
66 breaks <- unique(fb$timestamp)
70 for (i in seq(1,length(breaks)) )
73 sub <- fb[which(fb$timestamp == ts),]
74 node_count <- length(unique(sub$hostname))
75 online_count <- length(unique(sub$hostname[which(sub$state=='BOOT')]))
86 lowess_smooth <- function (x, y, delta=(60*60*24), f=0.02)
88 a<-lowess(x, y, delta=delta, f=f)
94 ns <- read.csv('node-status-jun09-feb10.csv', sep=',', header=TRUE)
95 an <- available_nodes(ns, "2009-06-10", "2010-02-28", 'day')
97 an_x<-an[1,][which(as.numeric(an[2,]) > 100)]
98 an_y<-an[2,][which(as.numeric(an[2,]) > 100)]
101 #fb7 <- read.csv('findbad_raw_2007.csv', sep=',', header=TRUE)
102 #fb8 <- read.csv('findbad_raw_2008.csv', sep=',', header=TRUE)
103 #fb9 <- read.csv('findbad_raw_2009.csv', sep=',', header=TRUE)
104 #fball <- rbind(fb7,fb8,fb9)
106 z7<- online_nodes(fb7)
107 z8<- online_nodes(fb8)
108 z9<- online_nodes(fb9)
110 zx <- c(z7[1,],z8[1,],z9[1,])
111 zy_reg <- c(z7[2,], z8[2,],z9[2,])
112 zy_avail <- c(z7[3,], z8[3,],z9[3,])
114 start_image("node_availability.png")
116 par(mai=c(0.1,1,0.1,0.1))
118 a_reg<-lowess_smooth(zx, zy_reg)
119 plot(a_reg$x, a_reg$y,
120 ylim=c(0,700), xlim=c(min(x1[length(x1)/2]), max(x1)), type='l', pch='.', axes=F,
121 ylab="Online Node Count", xlab="")
123 sx <- zx[which(zy_avail > 330)]
124 sy <- zy_avail[which(zy_avail > 330)]
125 sx <- c(sx[1:2037],sx[2061:length(sx)])
126 sy <- c(sy[1:2037],sy[2061:length(sy)])
128 sx <- c(sx[1:1699],sx[1701:1707],sx[1709:length(sx)])
129 sy <- c(sy[1:1699],sy[1701:1707],sy[1709:length(sy)])
131 lines(sx, sy, col='grey80', pch='.')
132 lines(an_x, an_y, col='grey80', pch='.')
134 a_avail<-lowess_smooth(zx, zy_avail)
135 lines(a_avail$x, a_avail$y, col='red', pch='.')
137 a_avail_m3<-lowess_smooth(an_x, an_y)
138 lines(a_avail_m3$x, a_avail_m3$y, col='red', pch='.')
142 x_online_node_list <- c(tstamp("2004-6-1"), tstamp("2005-6-1"), tstamp("2006-6-1"), tstamp("2007-11-1"))
143 y_online_node_list <- c(330, 480, 500, 550)
144 lines(x_online_node_list, y_online_node_list, col='grey80')
146 #abline_at_date('2005-01-01', 'grey60')
147 #abline_at_date('2006-01-01', 'grey60')
148 #abline_at_date('2007-01-01', 'grey60')
149 #abline_at_date('2008-01-01', 'grey60')
150 #abline_at_date('2009-01-01', 'grey60')
151 #abline_at_date('2010-01-01', 'grey60')
153 tstamp_20041112 <-abline_at_date("2004-11-12", col='grey60', lty=2)
154 tstamp_20050301 <-abline_at_date("2005-03-01", col='grey60', lty=2)
155 tstamp_20050615 <-abline_at_date("2005-06-15", col='grey60', lty=2)
156 tstamp_20051023 <-abline_at_date("2005-10-23", col='grey60', lty=2)
157 tstamp_20070101 <-abline_at_date("2007-01-01", col='grey60', lty=2)
158 tstamp_20070501 <-abline_at_date("2007-05-01", col='grey60', lty=2)
159 tstamp_20080601 <-abline_at_date("2008-06-01", col='grey60', lty=2)
160 tstamp_20080815 <-abline_at_date("2008-08-15", col='grey60', lty=2)
161 tstamp_20090501 <-abline_at_date("2009-05-01", col='grey60', lty=2)
162 tstamp_20100201 <-abline_at_date("2010-02-01", col='white', lty=2)
165 text(x=c( tstamp_20041112+(tstamp_20050301-tstamp_20041112)/2,
166 tstamp_20050301+(tstamp_20050615-tstamp_20050301)/2,
167 tstamp_20050615+(tstamp_20051023-tstamp_20050615)/2,
168 tstamp_20051023+(tstamp_20070101-tstamp_20051023)/2,
169 tstamp_20070101+(tstamp_20070501-tstamp_20070101)/2,
170 tstamp_20080601+(tstamp_20080815-tstamp_20080601)/2,
171 tstamp_20090501+(tstamp_20100201-tstamp_20090501)/2 ),
173 labels=c('3.0', '3.1', '3.1S', '3.2', '4.0', '4.2', '4.3'))
177 #axis(1, labels=ot[3,l/2:l], at=ot[1,l/2:l], cex.axis=0.7)
179 #mtext("2004 2005 2006 2007 2008 2009", 1,2)
181 uptime_nodes_m3 <- function (uh, from, to)
183 # find 'type' range of days
184 dates <-seq(as.Date(from), as.Date(to), 'day')
185 months <- format(dates, '%b')
186 hbreaks<-unclass(as.POSIXct(dates))
193 print(length(hbreaks))
195 for ( i in seq(1,length(hbreaks)-1) )
197 print (sprintf("round %s of %s", i, length(hbreaks)-1))
199 print (sprintf("ts %s ", hbreaks[i] ))
200 uh_sub <- uh[which(uh$date > hbreaks[i] & uh$date <= hbreaks[i+1] ),]
201 if ( length(uh_sub$uptime ) <= 1 ) { next }
205 print (sprintf("min: %s, median: %s, max: %s", min(d), median(d), max(d)))
207 print (sprintf("length: %s", length(d)))
211 date_index <- c(date_index, i)
213 xx<- c(xx, hbreaks[i])
214 q_list <- rbind(q_list, q)
217 m<- months[date_index]
218 return (cbind(xx,q_list, m))
223 uh <- read.csv('node_uptime_history.csv', header=TRUE, sep=',')
226 dm <- uptime_nodes_m3(uh, "2009-06-10", "2010-02-28")
228 par(mai=c(1,1,0.1,0.1))
229 plot(dm[,1], as.numeric(dm[,5])/(60*60*24), type='l', lty=1, xlab="",
230 ylim=c(min(as.numeric(dm[,2])/(60*60*24)),max(as.numeric(dm[,5])/(60*60*24))), xlim=c(min(x1[length(x1)/2]), max(x1)), axes=F, ylab="Uptime (days)", col='orange')
231 lines(dm[,1], as.numeric(dm[,4])/(60*60*24), lty=1, col='red')
232 lines(dm[,1], as.numeric(dm[,3])/(60*60*24), lty=1, col='black')
233 lines(dm[,1], as.numeric(dm[,6])/(60*60*24), lty=1, col='orange')
234 lines(dm[,1], as.numeric(dm[,2])/(60*60*24), lty=1, col='blue')
235 #axis(1, labels=dm[,7], at=dm[,1])
237 #m<-round(max(as.numeric(dm[,4])/(60*60*24)), 2)
238 #axis(2, labels=m, at=m, las=1)
239 #abline(h=m, lty=2, col='grey40')
243 axis(1, labels=ot[3,l2:l], at=ot[1,l2:l], cex.axis=0.7)
245 mtext("2007 2008 2009", 1,2)
247 tstamp_20041112 <-abline_at_date("2004-11-12", col='grey60', lty=2)
248 tstamp_20050301 <-abline_at_date("2005-03-01", col='grey60', lty=2)
249 tstamp_20050615 <-abline_at_date("2005-06-15", col='grey60', lty=2)
250 tstamp_20051023 <-abline_at_date("2005-10-23", col='grey60', lty=2)
251 tstamp_20070101 <-abline_at_date("2007-01-01", col='grey60', lty=2)
252 tstamp_20070501 <-abline_at_date("2007-05-01", col='grey60', lty=2)
253 tstamp_20080601 <-abline_at_date("2008-06-01", col='grey60', lty=2)
254 tstamp_20080815 <-abline_at_date("2008-08-15", col='grey60', lty=2)
255 tstamp_20090501 <-abline_at_date("2009-05-01", col='grey60', lty=2)
256 tstamp_20100201 <-abline_at_date("2010-02-01", col='white', lty=2)
259 text(x=c( tstamp_20041112+(tstamp_20050301-tstamp_20041112)/2,
260 tstamp_20050301+(tstamp_20050615-tstamp_20050301)/2,
261 tstamp_20050615+(tstamp_20051023-tstamp_20050615)/2,
262 tstamp_20051023+(tstamp_20070101-tstamp_20051023)/2,
263 tstamp_20070101+(tstamp_20070501-tstamp_20070101)/2,
264 tstamp_20080601+(tstamp_20080815-tstamp_20080601)/2,
265 tstamp_20090501+(tstamp_20100201-tstamp_20090501)/2 ),
267 labels=c('3.0', '3.1', '3.1S', '3.2', '4.0', '4.2', '4.3'))