Blame


1 2b6c15d8 2005-07-19 devnull
2 d392fc77 2007-04-21 devnull biggraph = "arg=rpctotal&graph=diff"
3 2b6c15d8 2005-07-19 devnull
4 2b6c15d8 2005-07-19 devnull graphname = new Array(
5 d392fc77 2007-04-21 devnull "arg=*&graph=diskbw",
6 2b6c15d8 2005-07-19 devnull "<b>disk</b> bytes/second",
7 d392fc77 2007-04-21 devnull "arg=*&graph=netbw",
8 2b6c15d8 2005-07-19 devnull "<b>network</b> bytes/second",
9 d392fc77 2007-04-21 devnull "arg=*&graph=iobw",
10 2b6c15d8 2005-07-19 devnull "total: <b>disk+net</b> bytes/second",
11 2b6c15d8 2005-07-19 devnull
12 d392fc77 2007-04-21 devnull "arg=apartreadbyte&graph=diff",
13 2b6c15d8 2005-07-19 devnull "arena read bytes/second",
14 d392fc77 2007-04-21 devnull "arg=apartwritebyte&graph=diff",
15 2b6c15d8 2005-07-19 devnull "arena write bytes/second",
16 2b6c15d8 2005-07-19 devnull
17 d392fc77 2007-04-21 devnull "arg=bloomfalsemiss&graph=pctdiff&arg2=bloomlookup&max=100",
18 2b6c15d8 2005-07-19 devnull "bloom false hit %",
19 d392fc77 2007-04-21 devnull "arg=bloomhit&graph=pctdiff&arg2=bloomlookup&max=100",
20 2b6c15d8 2005-07-19 devnull "bloom miss %",
21 d392fc77 2007-04-21 devnull "arg=bloomlookuptime&graph=divdiff&arg2=bloomlookup",
22 2b6c15d8 2005-07-19 devnull "bloom lookup time",
23 d392fc77 2007-04-21 devnull "arg=bloomones&graph=pct&arg2=bloombits&max=100",
24 2b6c15d8 2005-07-19 devnull "bloom usage %",
25 2b6c15d8 2005-07-19 devnull
26 d392fc77 2007-04-21 devnull "arg=dcachedirty&graph=pct&arg2=dcachesize&max=100",
27 2b6c15d8 2005-07-19 devnull "dcache dirty %",
28 d392fc77 2007-04-21 devnull "arg=dcachehit&graph=pctdiff&arg2=dcachelookup&max=100",
29 2b6c15d8 2005-07-19 devnull "dcache hit %",
30 d392fc77 2007-04-21 devnull "arg=dcachelookuptime&graph=divdiff&arg2=dcachelookup",
31 2b6c15d8 2005-07-19 devnull "dcache lookup time",
32 d392fc77 2007-04-21 devnull "arg=dcachelookup&graph=diff",
33 2b6c15d8 2005-07-19 devnull "dcache lookups/second",
34 d392fc77 2007-04-21 devnull "arg=dcachewrite&graph=diff",
35 2b6c15d8 2005-07-19 devnull "dcache writes/second",
36 2b6c15d8 2005-07-19 devnull
37 d392fc77 2007-04-21 devnull "arg=icachedirty&graph=pct&arg2=icachesize&max=100",
38 2b6c15d8 2005-07-19 devnull "icache dirty %",
39 d392fc77 2007-04-21 devnull "arg=icachehit&graph=pctdiff&arg2=icachelookup&max=100",
40 2b6c15d8 2005-07-19 devnull "icache hit %",
41 7a400ee9 2007-09-25 rsc "arg=scachehit&graph=pctdiff&arg2=icachelookup&max=100",
42 7a400ee9 2007-09-25 rsc "scache hit %",
43 7a400ee9 2007-09-25 rsc "arg=icachemiss&graph=pctdiff&arg2=icachelookup&max=100",
44 7a400ee9 2007-09-25 rsc "icache miss %",
45 d392fc77 2007-04-21 devnull "arg=icachelookuptime&graph=divdiff&arg2=icachelookup",
46 2b6c15d8 2005-07-19 devnull "icache lookup time",
47 d392fc77 2007-04-21 devnull "arg=icacheprefetch&graph=diff",
48 2b6c15d8 2005-07-19 devnull "icache prefetches/second",
49 d392fc77 2007-04-21 devnull "arg=icachewrite&graph=diff",
50 2b6c15d8 2005-07-19 devnull "icache writes/second",
51 2b6c15d8 2005-07-19 devnull
52 d392fc77 2007-04-21 devnull "arg=isectreadbyte&graph=diff",
53 2b6c15d8 2005-07-19 devnull "isect read bytes/second",
54 d392fc77 2007-04-21 devnull "arg=isectwritebyte&graph=diff",
55 2b6c15d8 2005-07-19 devnull "isect write bytes/second",
56 2b6c15d8 2005-07-19 devnull
57 d392fc77 2007-04-21 devnull "arg=lcachehit&graph=pctdiff&arg2=lcachelookup&max=100",
58 2b6c15d8 2005-07-19 devnull "lump cache hit %",
59 d392fc77 2007-04-21 devnull "arg=lcachelookuptime&graph=divdiff&arg2=lcachelookup",
60 2b6c15d8 2005-07-19 devnull "lump cache lookup time",
61 d392fc77 2007-04-21 devnull "arg=lcachewrite&graph=diff",
62 2b6c15d8 2005-07-19 devnull "lcache writes/second",
63 2b6c15d8 2005-07-19 devnull
64 d392fc77 2007-04-21 devnull "arg=rpcreadbyte&graph=diff",
65 2b6c15d8 2005-07-19 devnull "read RPC bytes/second",
66 d392fc77 2007-04-21 devnull "arg=rpctotal&graph=diff",
67 2b6c15d8 2005-07-19 devnull "RPCs/second",
68 d392fc77 2007-04-21 devnull "arg=rpcwritebyte&graph=diff",
69 2b6c15d8 2005-07-19 devnull "write RPC bytes/second",
70 d392fc77 2007-04-21 devnull "arg=rpcreadtime&graph=divdiff&arg2=rpcread",
71 2b6c15d8 2005-07-19 devnull "read RPC time",
72 d392fc77 2007-04-21 devnull "arg=rpcwritetime&graph=divdiff&arg2=rpcwrite",
73 2b6c15d8 2005-07-19 devnull "write RPC time",
74 d392fc77 2007-04-21 devnull "arg=rpcreadcachedtime&graph=divdiff&arg2=rpcreadcached",
75 2b6c15d8 2005-07-19 devnull "cached read RPC time",
76 d392fc77 2007-04-21 devnull "arg=rpcreaduncachedtime&graph=divdiff&arg2=rpcreaduncached",
77 2b6c15d8 2005-07-19 devnull "uncached read RPC time",
78 d392fc77 2007-04-21 devnull "arg=rpcwritenewtime&graph=divdiff&arg2=rpcwritenew",
79 2b6c15d8 2005-07-19 devnull "fresh write RPC time",
80 d392fc77 2007-04-21 devnull "arg=rpcwriteoldtime&graph=divdiff&arg2=rpcwriteold",
81 2b6c15d8 2005-07-19 devnull "dup write RPC time",
82 7a400ee9 2007-09-25 rsc "arg=cigloadtime&graph=divdiff&arg2=cigload",
83 7a400ee9 2007-09-25 rsc "cig load time",
84 2b6c15d8 2005-07-19 devnull
85 d392fc77 2007-04-21 devnull "arg=sumreadbyte&graph=diff",
86 2b6c15d8 2005-07-19 devnull "checksum bytes/second",
87 2b6c15d8 2005-07-19 devnull
88 d392fc77 2007-04-21 devnull "arg=dblockstall",
89 2b6c15d8 2005-07-19 devnull "threads stalled: dblock",
90 d392fc77 2007-04-21 devnull "arg=dcachestall",
91 2b6c15d8 2005-07-19 devnull "threads stalled: dcache",
92 d392fc77 2007-04-21 devnull "arg=icachestall",
93 2b6c15d8 2005-07-19 devnull "threads stalled: icache",
94 d392fc77 2007-04-21 devnull "arg=lumpstall",
95 2b6c15d8 2005-07-19 devnull "threads stalled: lump",
96 2b6c15d8 2005-07-19 devnull
97 d392fc77 2007-04-21 devnull "arg=END"
98 2b6c15d8 2005-07-19 devnull )
99 2b6c15d8 2005-07-19 devnull
100 2b6c15d8 2005-07-19 devnull column0 = new Array(
101 2b6c15d8 2005-07-19 devnull "column0",
102 2b6c15d8 2005-07-19 devnull "!bandwidth",
103 d392fc77 2007-04-21 devnull "arg=*&graph=iobw",
104 d392fc77 2007-04-21 devnull "arg=*&graph=netbw",
105 d392fc77 2007-04-21 devnull "arg=rpcreadbyte&graph=diff",
106 d392fc77 2007-04-21 devnull "arg=rpcwritebyte&graph=diff",
107 d392fc77 2007-04-21 devnull "arg=*&graph=diskbw",
108 d392fc77 2007-04-21 devnull "arg=isectreadbyte&graph=diff",
109 d392fc77 2007-04-21 devnull "arg=isectwritebyte&graph=diff",
110 d392fc77 2007-04-21 devnull "arg=apartreadbyte&graph=diff",
111 d392fc77 2007-04-21 devnull "arg=apartwritebyte&graph=diff",
112 d392fc77 2007-04-21 devnull "arg=sumreadbyte&graph=diff",
113 2b6c15d8 2005-07-19 devnull
114 2b6c15d8 2005-07-19 devnull "!bloom filter",
115 d392fc77 2007-04-21 devnull "arg=bloomhit&graph=pctdiff&arg2=bloomlookup&max=100",
116 d392fc77 2007-04-21 devnull "arg=bloomfalsemiss&graph=pctdiff&arg2=bloomlookup&max=100",
117 d392fc77 2007-04-21 devnull "arg=bloomones&graph=pct&arg2=bloombits&max=100",
118 2b6c15d8 2005-07-19 devnull
119 2b6c15d8 2005-07-19 devnull "END"
120 2b6c15d8 2005-07-19 devnull )
121 2b6c15d8 2005-07-19 devnull
122 2b6c15d8 2005-07-19 devnull column1 = new Array(
123 2b6c15d8 2005-07-19 devnull "column1",
124 2b6c15d8 2005-07-19 devnull "!icache",
125 d392fc77 2007-04-21 devnull "arg=icachedirty&graph=pct&arg2=icachesize&max=100",
126 d392fc77 2007-04-21 devnull "arg=icachehit&graph=pctdiff&arg2=icachelookup&max=100",
127 7a400ee9 2007-09-25 rsc "arg=scachehit&graph=pctdiff&arg2=icachelookup&max=100",
128 7a400ee9 2007-09-25 rsc "arg=icachemiss&graph=pctdiff&arg2=icachelookup&max=100",
129 d392fc77 2007-04-21 devnull "arg=icachewrite&graph=diff",
130 d392fc77 2007-04-21 devnull "arg=icacheprefetch&graph=diff",
131 7a400ee9 2007-09-25 rsc "arg=scacheprefetch&graph=diff",
132 2b6c15d8 2005-07-19 devnull
133 2b6c15d8 2005-07-19 devnull "!dcache",
134 d392fc77 2007-04-21 devnull "arg=dcachedirty&graph=pct&arg2=dcachesize&max=100",
135 d392fc77 2007-04-21 devnull "arg=dcachehit&graph=pctdiff&arg2=dcachelookup&max=100",
136 d392fc77 2007-04-21 devnull "arg=dcachelookup&graph=diff",
137 d392fc77 2007-04-21 devnull "arg=dcachewrite&graph=diff",
138 2b6c15d8 2005-07-19 devnull
139 2b6c15d8 2005-07-19 devnull "!lump cache",
140 d392fc77 2007-04-21 devnull "arg=lcachehit&graph=pctdiff&arg2=lcachelookup&max=100",
141 d392fc77 2007-04-21 devnull "arg=lcachewrite&graph=diff",
142 2b6c15d8 2005-07-19 devnull
143 2b6c15d8 2005-07-19 devnull "END"
144 2b6c15d8 2005-07-19 devnull )
145 2b6c15d8 2005-07-19 devnull
146 2b6c15d8 2005-07-19 devnull column2 = new Array(
147 2b6c15d8 2005-07-19 devnull "column2",
148 2b6c15d8 2005-07-19 devnull
149 2b6c15d8 2005-07-19 devnull "!stalls",
150 d392fc77 2007-04-21 devnull "arg=icachestall",
151 d392fc77 2007-04-21 devnull "arg=dcachestall",
152 d392fc77 2007-04-21 devnull "arg=dblockstall",
153 d392fc77 2007-04-21 devnull "arg=lumpstall",
154 2b6c15d8 2005-07-19 devnull
155 2b6c15d8 2005-07-19 devnull "!timings",
156 d392fc77 2007-04-21 devnull "arg=bloomlookuptime&graph=divdiff&arg2=bloomlookup",
157 d392fc77 2007-04-21 devnull "arg=icachelookuptime&graph=divdiff&arg2=icachelookup",
158 d392fc77 2007-04-21 devnull "arg=lcachelookuptime&graph=divdiff&arg2=lcachelookup",
159 d392fc77 2007-04-21 devnull "arg=dcachelookuptime&graph=divdiff&arg2=dcachelookup",
160 d392fc77 2007-04-21 devnull "arg=rpcreadtime&graph=divdiff&arg2=rpcread",
161 d392fc77 2007-04-21 devnull "arg=rpcwritetime&graph=divdiff&arg2=rpcwrite",
162 d392fc77 2007-04-21 devnull "arg=rpcreadcachedtime&graph=divdiff&arg2=rpcreadcached",
163 d392fc77 2007-04-21 devnull "arg=rpcreaduncachedtime&graph=divdiff&arg2=rpcreaduncached",
164 d392fc77 2007-04-21 devnull "arg=rpcwritenewtime&graph=divdiff&arg2=rpcwritenew",
165 d392fc77 2007-04-21 devnull "arg=rpcwriteoldtime&graph=divdiff&arg2=rpcwriteold",
166 7a400ee9 2007-09-25 rsc "arg=cigloadtime&graph=divdiff&arg2=cigload",
167 2b6c15d8 2005-07-19 devnull
168 2b6c15d8 2005-07-19 devnull "END"
169 2b6c15d8 2005-07-19 devnull )
170 2b6c15d8 2005-07-19 devnull
171 2b6c15d8 2005-07-19 devnull col0info = new Array(column0.length)
172 2b6c15d8 2005-07-19 devnull col1info = new Array(column1.length)
173 2b6c15d8 2005-07-19 devnull col2info = new Array(column2.length)
174 2b6c15d8 2005-07-19 devnull
175 2b6c15d8 2005-07-19 devnull function cleardebug() {
176 2b6c15d8 2005-07-19 devnull var p = document.getElementById("debug")
177 2b6c15d8 2005-07-19 devnull p.innerHTML = ""
178 2b6c15d8 2005-07-19 devnull }
179 2b6c15d8 2005-07-19 devnull
180 2b6c15d8 2005-07-19 devnull function debug(s) {
181 2b6c15d8 2005-07-19 devnull var p = document.getElementById("debug")
182 2b6c15d8 2005-07-19 devnull if(p.innerHTML == "")
183 2b6c15d8 2005-07-19 devnull p.innerHTML = "<a href=\"javascript:cleardebug()\">clear</a>\n"
184 2b6c15d8 2005-07-19 devnull p.innerHTML += "<br>"+s
185 2b6c15d8 2005-07-19 devnull }
186 2b6c15d8 2005-07-19 devnull
187 2b6c15d8 2005-07-19 devnull function Ginfo(y, fill, name) {
188 2b6c15d8 2005-07-19 devnull var g = new Object()
189 2b6c15d8 2005-07-19 devnull g.y = y
190 2b6c15d8 2005-07-19 devnull g.fill = fill
191 2b6c15d8 2005-07-19 devnull g.name = name
192 2b6c15d8 2005-07-19 devnull return g
193 2b6c15d8 2005-07-19 devnull }
194 2b6c15d8 2005-07-19 devnull
195 2b6c15d8 2005-07-19 devnull function cleartable(t) {
196 2b6c15d8 2005-07-19 devnull for(var i=t.rows.length-1; i>=0; i--)
197 2b6c15d8 2005-07-19 devnull t.deleteRow(i)
198 2b6c15d8 2005-07-19 devnull }
199 2b6c15d8 2005-07-19 devnull
200 2b6c15d8 2005-07-19 devnull function textofname(name)
201 2b6c15d8 2005-07-19 devnull {
202 2b6c15d8 2005-07-19 devnull for(var i=0; i<graphname.length; i+=2)
203 2b6c15d8 2005-07-19 devnull if(name == graphname[i])
204 2b6c15d8 2005-07-19 devnull return graphname[i+1]
205 2b6c15d8 2005-07-19 devnull }
206 2b6c15d8 2005-07-19 devnull
207 2b6c15d8 2005-07-19 devnull function graphrow(row, span, name, dt, wid, ht, fill, text) {
208 d392fc77 2007-04-21 devnull var url = "/graph?"+name
209 d392fc77 2007-04-21 devnull url = url+"&min=0"
210 d392fc77 2007-04-21 devnull url = url+"&t0=-"+dt
211 d392fc77 2007-04-21 devnull url = url+"&wid="+wid
212 d392fc77 2007-04-21 devnull url = url+"&ht="+ht
213 d392fc77 2007-04-21 devnull url = url+"&fill="+fill
214 2b6c15d8 2005-07-19 devnull
215 2b6c15d8 2005-07-19 devnull var s = "<td colSpan="+span
216 2b6c15d8 2005-07-19 devnull s = s+" valign=bottom"
217 2b6c15d8 2005-07-19 devnull s = s+" align=center"
218 2b6c15d8 2005-07-19 devnull s = s+" width="+wid
219 2b6c15d8 2005-07-19 devnull s = s+" height="+ht
220 2b6c15d8 2005-07-19 devnull s = s+" style=\"background-image: url("+url+");\""
221 2b6c15d8 2005-07-19 devnull s = s+">"+textofname(name)+text+"</td>"
222 2b6c15d8 2005-07-19 devnull row.innerHTML = s
223 2b6c15d8 2005-07-19 devnull }
224 2b6c15d8 2005-07-19 devnull
225 2b6c15d8 2005-07-19 devnull
226 2b6c15d8 2005-07-19 devnull function graphcell(cell, name, dt, wid, ht, fill) {
227 2b6c15d8 2005-07-19 devnull cell.vAlign = "bottom"
228 2b6c15d8 2005-07-19 devnull cell.align = "center"
229 2b6c15d8 2005-07-19 devnull cell.width = wid
230 2b6c15d8 2005-07-19 devnull cell.height = ht
231 2b6c15d8 2005-07-19 devnull }
232 2b6c15d8 2005-07-19 devnull
233 2b6c15d8 2005-07-19 devnull function redraw() {
234 2b6c15d8 2005-07-19 devnull redrawgraphs()
235 2b6c15d8 2005-07-19 devnull redrawsettings()
236 2b6c15d8 2005-07-19 devnull }
237 2b6c15d8 2005-07-19 devnull
238 2b6c15d8 2005-07-19 devnull function redrawgraphs() {
239 2b6c15d8 2005-07-19 devnull var t = document.getElementById("statgraphs")
240 2b6c15d8 2005-07-19 devnull
241 2b6c15d8 2005-07-19 devnull cleartable(t)
242 2b6c15d8 2005-07-19 devnull for(var i=0; i<4; i++)
243 2b6c15d8 2005-07-19 devnull t.insertRow(i)
244 2b6c15d8 2005-07-19 devnull
245 2b6c15d8 2005-07-19 devnull graphrow(t.rows[0], 3, biggraph, 86400, 900, 30, 0, " &ndash; showing 24 hours")
246 2b6c15d8 2005-07-19 devnull graphrow(t.rows[1], 3, biggraph, 3600, 900, 30, 1, " &ndash; showing 1 hour")
247 2b6c15d8 2005-07-19 devnull t.rows[2].innerHTML = "<td height=10></td>"
248 2b6c15d8 2005-07-19 devnull
249 2b6c15d8 2005-07-19 devnull var r = t.rows[3]
250 2b6c15d8 2005-07-19 devnull graphtable(r.insertCell(0), column0, col0info, 0)
251 2b6c15d8 2005-07-19 devnull graphtable(r.insertCell(1), column1, col1info, 2)
252 2b6c15d8 2005-07-19 devnull graphtable(r.insertCell(2), column2, col2info, 4)
253 2b6c15d8 2005-07-19 devnull }
254 2b6c15d8 2005-07-19 devnull
255 2b6c15d8 2005-07-19 devnull function graphtable(bigcell, list, infolist, fill) {
256 2b6c15d8 2005-07-19 devnull bigcell.innerHTML = "<table id=\""+list[0]+"\"></table>"
257 2b6c15d8 2005-07-19 devnull bigcell.vAlign = "top"
258 2b6c15d8 2005-07-19 devnull var t = document.getElementById(list[0])
259 2b6c15d8 2005-07-19 devnull t.onclick = columnclick
260 2b6c15d8 2005-07-19 devnull
261 2b6c15d8 2005-07-19 devnull for(var i=1; i<list.length; i++){
262 2b6c15d8 2005-07-19 devnull var r = t.insertRow(t.rows.length)
263 2b6c15d8 2005-07-19 devnull name = list[i]
264 2b6c15d8 2005-07-19 devnull infolist[i] = Ginfo(t.offsetHeight, fill, name)
265 2b6c15d8 2005-07-19 devnull if(name == "END")
266 2b6c15d8 2005-07-19 devnull break
267 2b6c15d8 2005-07-19 devnull if(name.substring(0,1) == "!"){
268 2b6c15d8 2005-07-19 devnull name = name.substring(1)
269 2b6c15d8 2005-07-19 devnull if(i > 1){
270 2b6c15d8 2005-07-19 devnull r.innerHTML = "<td height=10></td>"
271 2b6c15d8 2005-07-19 devnull r = t.insertRow(t.rows.length)
272 2b6c15d8 2005-07-19 devnull }
273 2b6c15d8 2005-07-19 devnull r.innerHTML = "<td align=center><b>"+name+"</b>"
274 2b6c15d8 2005-07-19 devnull }else{
275 2b6c15d8 2005-07-19 devnull graphrow(r, 1, name, 600, 300, 30, fill++, "")
276 2b6c15d8 2005-07-19 devnull }
277 2b6c15d8 2005-07-19 devnull }
278 2b6c15d8 2005-07-19 devnull }
279 2b6c15d8 2005-07-19 devnull
280 2b6c15d8 2005-07-19 devnull function xpos(obj) {
281 2b6c15d8 2005-07-19 devnull var x = 0
282 2b6c15d8 2005-07-19 devnull if(obj.fixedx)
283 2b6c15d8 2005-07-19 devnull return obj.fixedx
284 2b6c15d8 2005-07-19 devnull if(obj.offsetParent){
285 2b6c15d8 2005-07-19 devnull while(obj.offsetParent){
286 2b6c15d8 2005-07-19 devnull x += obj.offsetLeft
287 2b6c15d8 2005-07-19 devnull obj = obj.offsetParent
288 2b6c15d8 2005-07-19 devnull }
289 2b6c15d8 2005-07-19 devnull }else if(obj.x)
290 2b6c15d8 2005-07-19 devnull x = obj.x
291 2b6c15d8 2005-07-19 devnull return x
292 2b6c15d8 2005-07-19 devnull }
293 2b6c15d8 2005-07-19 devnull
294 2b6c15d8 2005-07-19 devnull function ypos(obj) {
295 2b6c15d8 2005-07-19 devnull var y = 0
296 2b6c15d8 2005-07-19 devnull if(obj.fixedy)
297 2b6c15d8 2005-07-19 devnull return obj.fixedy
298 2b6c15d8 2005-07-19 devnull if(obj.offsetParent){
299 2b6c15d8 2005-07-19 devnull while(obj.offsetParent){
300 2b6c15d8 2005-07-19 devnull y += obj.offsetTop
301 2b6c15d8 2005-07-19 devnull obj = obj.offsetParent
302 2b6c15d8 2005-07-19 devnull }
303 2b6c15d8 2005-07-19 devnull }else if(obj.y)
304 2b6c15d8 2005-07-19 devnull y = obj.y
305 2b6c15d8 2005-07-19 devnull return y
306 2b6c15d8 2005-07-19 devnull }
307 2b6c15d8 2005-07-19 devnull
308 2b6c15d8 2005-07-19 devnull function scrollleft() {
309 2b6c15d8 2005-07-19 devnull return document.body.scrollLeft
310 2b6c15d8 2005-07-19 devnull }
311 2b6c15d8 2005-07-19 devnull
312 2b6c15d8 2005-07-19 devnull function scrolltop() {
313 2b6c15d8 2005-07-19 devnull return document.body.scrollTop
314 2b6c15d8 2005-07-19 devnull }
315 2b6c15d8 2005-07-19 devnull
316 2b6c15d8 2005-07-19 devnull function columnclick(e) {
317 2b6c15d8 2005-07-19 devnull if(e.which && e.which != 1)
318 d392fc77 2007-04-21 devnull return;
319 2b6c15d8 2005-07-19 devnull var g = findgraph(scrollleft()+e.clientX, scrolltop()+e.clientY)
320 2b6c15d8 2005-07-19 devnull if(g && g.name.substring(0,1) != "!"){
321 2b6c15d8 2005-07-19 devnull biggraph = g.name
322 2b6c15d8 2005-07-19 devnull var t = document.getElementById("statgraphs")
323 2b6c15d8 2005-07-19 devnull graphrow(t.rows[0], 3, biggraph, 86400, 900, 30, 0, " &ndash; showing 24 hours")
324 2b6c15d8 2005-07-19 devnull graphrow(t.rows[1], 3, biggraph, 3600, 900, 30, 1, " &ndash; showing 1 hour")
325 2b6c15d8 2005-07-19 devnull }
326 2b6c15d8 2005-07-19 devnull }
327 2b6c15d8 2005-07-19 devnull
328 2b6c15d8 2005-07-19 devnull function findgraph(x, y) {
329 2b6c15d8 2005-07-19 devnull var g
330 2b6c15d8 2005-07-19 devnull
331 2b6c15d8 2005-07-19 devnull if(g = findgraphin(x, y, "column2", col2info))
332 2b6c15d8 2005-07-19 devnull return g
333 2b6c15d8 2005-07-19 devnull if(g = findgraphin(x, y, "column1", col1info))
334 2b6c15d8 2005-07-19 devnull return g
335 2b6c15d8 2005-07-19 devnull if(g = findgraphin(x, y, "column0", col0info))
336 2b6c15d8 2005-07-19 devnull return g
337 2b6c15d8 2005-07-19 devnull return
338 2b6c15d8 2005-07-19 devnull }
339 2b6c15d8 2005-07-19 devnull
340 2b6c15d8 2005-07-19 devnull function findgraphin(x, y, tname, info) {
341 2b6c15d8 2005-07-19 devnull var t = document.getElementById(tname)
342 2b6c15d8 2005-07-19 devnull if(x < xpos(t))
343 2b6c15d8 2005-07-19 devnull return
344 2b6c15d8 2005-07-19 devnull y = y - ypos(t)
345 d392fc77 2007-04-21 devnull for(var i=info.length-2; i>=1; i--){
346 2b6c15d8 2005-07-19 devnull if(y > info[i].y)
347 2b6c15d8 2005-07-19 devnull return info[i]
348 d392fc77 2007-04-21 devnull }
349 2b6c15d8 2005-07-19 devnull return
350 2b6c15d8 2005-07-19 devnull }
351 2b6c15d8 2005-07-19 devnull
352 2b6c15d8 2005-07-19 devnull function setof(name, val, list) {
353 2b6c15d8 2005-07-19 devnull var s = ""
354 2b6c15d8 2005-07-19 devnull for(var i=0; i<list.length; i++){
355 2b6c15d8 2005-07-19 devnull if(val == list[i])
356 2b6c15d8 2005-07-19 devnull s = s+" <b>"+val+"</b>"
357 2b6c15d8 2005-07-19 devnull else
358 2b6c15d8 2005-07-19 devnull s = s+" <a href=\"javascript:set('"+name+"', '"+list[i]+"')\">"+list[i]+"</a>"
359 2b6c15d8 2005-07-19 devnull }
360 2b6c15d8 2005-07-19 devnull return s
361 2b6c15d8 2005-07-19 devnull }
362 2b6c15d8 2005-07-19 devnull
363 2b6c15d8 2005-07-19 devnull function loglinks(list) {
364 2b6c15d8 2005-07-19 devnull var s = ""
365 2b6c15d8 2005-07-19 devnull for(var i=0; i<list.length; i++){
366 2b6c15d8 2005-07-19 devnull s = s+" <a href=\"/log/"+list[i]+"\">"+list[i]+"</a>"
367 2b6c15d8 2005-07-19 devnull }
368 2b6c15d8 2005-07-19 devnull return s
369 2b6c15d8 2005-07-19 devnull }
370 2b6c15d8 2005-07-19 devnull
371 2b6c15d8 2005-07-19 devnull first = 1
372 2b6c15d8 2005-07-19 devnull function redrawsettings() {
373 2b6c15d8 2005-07-19 devnull if(first){
374 2b6c15d8 2005-07-19 devnull loadsettings()
375 2b6c15d8 2005-07-19 devnull first = 0
376 2b6c15d8 2005-07-19 devnull }
377 2b6c15d8 2005-07-19 devnull var s = ""
378 2b6c15d8 2005-07-19 devnull s = s+"<font size=-1>\n"
379 2b6c15d8 2005-07-19 devnull s = s+"logging:"+setof("logging", logging, loggingchoices)
380 2b6c15d8 2005-07-19 devnull s = s+" &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "
381 2b6c15d8 2005-07-19 devnull s = s+"stats:"+setof("stats", stats, statschoices)
382 2b6c15d8 2005-07-19 devnull s = s+"\n<p/>\n"
383 2b6c15d8 2005-07-19 devnull s = s+"compression:"+setof("compress", compress, compresschoices1)
384 2b6c15d8 2005-07-19 devnull s = s+"<br>"+setof("compress", compress, compresschoices2)
385 2b6c15d8 2005-07-19 devnull s = s+"\n<p/>\n"
386 2b6c15d8 2005-07-19 devnull s = s+"<a href=/index>index</a> | <a href=/storage>storage</a> | "
387 2b6c15d8 2005-07-19 devnull s = s+"log:"+loglinks(logs)
388 2b6c15d8 2005-07-19 devnull s = s+"</font>"
389 2b6c15d8 2005-07-19 devnull document.getElementById("settings").innerHTML = s
390 2b6c15d8 2005-07-19 devnull }
391 2b6c15d8 2005-07-19 devnull
392 2b6c15d8 2005-07-19 devnull function set(name, value) {
393 2b6c15d8 2005-07-19 devnull eval(name+"= \""+value+"\"")
394 2b6c15d8 2005-07-19 devnull redrawsettings()
395 2b6c15d8 2005-07-19 devnull // Works in FireFox, not in Safari
396 2b6c15d8 2005-07-19 devnull parent.hidden.location.href = "/set/"+name+"/"+value
397 2b6c15d8 2005-07-19 devnull }