|
帮BOINC 做个备份吧.
http://boinc.berkeley.edu/trac/b ... /doc/stripchart.txt
Stripchart version 2.0
2 ----------------------
3 Author: Matt Lebofsky
4 BOINC/SETI@home - University of California, Berkeley
5 [email protected]
6
7 Date of recent version: November 4, 2002
8
9 Requirements:
10 * a gnuplot with the ability to generate gifs
11 * perl
12 * apache or other cgi-enabled web browser
13
14 Send all thoughts and queries to: [email protected]
15
16 This software is free to edit, distribute and use by anybody, as long as
17 I get credit for it in some form or another. Thanks.
18 ----------------------
19
20 Contents:
21
22 I. Some questions and answers
23 II. So how does it work?
24 III. Known bugs, things to do, etc.
25
26 ----------------------
27 I. Some questions and answers
28
29 Q: What is stripchart?
30
31 A: Well, it's actually two relatively small perl programs:
32
33 1. stripchart
34
35 stripchart reads in time-based user data and, depending on a flurry of
36 command line options, generates a web-friendly .gif plotting the data.
37 The user can supply the time range, the y axis range, even the color
38 scheme, and more.
39
40 2. stripchart.cgi
41
42 stripchart.cgi is a web-based GUI interface that allows users to easily
43 select multiple data sources and various parameters to plot, allowing
44 fast comparisons without having to deal with a command line interface.
45
46 Q: Why do you bother writing this program?
47
48 A: Working as a systems administrator (amongst other things) for SETI@home,
49 we kept finding ourselves in dire problem-solving situations, i.e. Why
50 did the database stop working? Why is load on our web server so high?
51
52 So we started collecting data in flat files, keeping track of server
53 loads, database checkpoint times, even CPU temperatures. When these files
54 grew too large and unwieldy, I found myself writing (and rewriting) simple
55 scripts to generate plots on this data. Sick of constant revision whenever
56 a new problem arose, I wrote stripchart version 1.0.
57
58 Its usefulness became immediately apparent when I added on stripchart.cgi.
59 I couldn't bear to teach everybody the many command line options to
60 stripchart, so I wrote this CGI to do all the dirty work. Suddenly we were
61 able to line up several plots, look for causes and effects, or just enjoy
62 watching the counts in our database tables grow to impossibly high numbers.
63
64 The SETI@home network has proven to be a delicate system, and keeping track
65 of all the data server, user, and web statistics has proven to be quite a
66 life saver. So when BOINC came around we felt that any project aiming to
67 embark on a similar project may need this tool. So I rewrote stripchart to
68 be a bit more friendly and general.
69
70 Q: Why don't you make .pngs or .jpgs instead of .gifs? The latest gnuplot
71 doesn't support .gifs.
72
73 A: Basically gnuplot support for other graphic file formats isn't as good. For
74 example, you cannot control exact window size, font size, and colors unless
75 you make .gifs. I'm not exactly sure why this is the case, but there you have it.
76 Anywho, you can find older gnuplot distributions out there - you'll need to
77 get the gd libs first, by the way.
78
79 ----------------------
80 II. So how does it work?
81
82 You can use stripchart as a stand alone command-line program to produce plots
83 whenever you like, but we highly recommend using it in conjunction with the
84 stripchart.cgi for ease of use. But here's how to do it both ways.
85
86 stripchart (stand alone)
87
88 Before anything, look at the section GLOBAL/DEFAULT VARS in the program
89 stripchart and see if you need to edit anything (usually pathnames to
90 executables and such).
91
92 Let's just start with the usage (obtained by typing "stripchart -h"):
93
94 stripchart: creates stripchart .gif graphic based on data in flat files
95 options:
96 -i: input FILE - name of input data file (mandatory)
97 -o: output FILE - name of output .gif file (default: STDOUT)
98 -O: output FILE - name of output .gif file and dump to STDOUT as well
99 -f: from TIME - stripchart with data starting at TIME
100 (default: 24 hours ago)
101 -t: to TIME - stripchart with data ending at TIME (default: now)
102 -r: range RANGE - stripchart data centered around "from" time the size
103 of RANGE (overrides -t)
104 -l: last LINES - stripchart last number of LINES in data file
105 (overrides -f and -t and -r)
106 -T: title TITLE - title to put on graphic (default: FILE RANGE)
107 -x: column X - time or "x" column (default: 2)
108 -y: column Y - value or "y" column (default: 3)
109 -Y: column Y' - overplot second "y" column (default: none)
110 -b: baseline VALUE - overplot baseline of arbitrary value VALUE
111 -B: baseline-avg - overrides -b, it plots baseline of computed average
112 -d: dump low VALUE - ignore data less than VALUE
113 -D: dump high VALUE - ignore data higher than VALUE
114 -v: verbose - puts verbose runtime output to STDERR
115 -L: log - makes y axis log scale
116 -c: colors "COLORS" - set gnuplot colors for graph/axis/fonts/data (default:
117 "xffffff x000000 xc0c0c0 x00a000 x0000a0 x2020c0"
118 in order: bground, axis/fonts, grids, pointcolor1,2,3)
119 -C: cgi - output CGI header to STDOUT if being called as CGI
120 -s: stats - turn extra plot stats on (current, avg, min, max)
121 -j: julian times - time columns is in local julian date (legacy stuff)
122
123 notes:
124 * TIME either unix date, julian date, or civil date in the form:
125 YYYY:MM:DD:HH:MM (year, month, day, hour, minute)
126 If you enter something with colons, it assumes it is civil date
127 If you have a decimal point, it assumes it is julian date
128 If it is an integer, it assumes it is unix date (epoch seconds)
129 If it is a negative number, it is in decimal days from current time
130 (i.e. -2.5 = two and a half days ago)
131 * All times on command line are assumed to be "local" times
132 * All times in the data file must be in unix date (epoch seconds)
133 * RANGE is given in decimal days (i.e. 1.25 = 1 day, 6 hours)
134 * if LINES == 0, (i.e. -l 0) then the whole data file is read in
135 * columns (given with -x, -y, -Y flags) start at 1
136 * titles given with -T can contain the following key words which will
137 be converted:
138 FILE - basename of input file
139 RANGE - pretty civil date range (in local time zone)
140 the default title is: FILE RANGE
141
142 ...okay that's a lot to ingest, but it's really simple. Let's take a look at an
143 example (you'll find in the samples directory two files get_load and crontab).
144
145 You have a machine that you want to monitor it's load. Here's a script that
146 will output a single line containing two fields for time and the third with the
147 actual data. For example:
148
149 2002:11:05:12:51 1036529480 0.25
150
151 The first field is time in an arbitrary human readable format
152 (year:month:day:hour:minute), the second in epoch seconds (standard
153 unix time format - the number of seconds since 00:00 1/1/1970 GMT),
154 and the third is the load at this time.
155
156 And we'll start collecting data every five minutes on this particular machine
157 by add such a line to the crontab:
158
159 0,5,10,15,20,25,30,35,40,45,50,55 * * * * /usr/local/stripchart/samples/get_load >> /disks/matt/data/machine_load
160
161 So the file "machine_load" will quickly fill with lines such as the above.
162 Now you may ask yourself - why two columns representing time in two different
163 formats? Well sometime you just want to look at the data file itself, in which
164 case the human-readable first column is quite handy to have around, but when
165 making linear time plots, having time in epoch seconds is much faster to
166 manipulate. So generally, we like to have at least the two time fields first,
167 and the actual data in the third column. That's what stripchart expects by
168 default.
169
170 Note: stripchart will understand time in both epoch seconds and julian date.
171 If the second time field is in julian date, you should supply the command line
172 flag "-j" to warn stripchart so it knows how to handle it.
173
174 Okay. So you have this data file now. A very common thing to plot would be the
175 data over the past 24 hours. Turns out that's the default! If you type on the
176 command line:
177
178 stripchart -i machine_load -o machine_load.gif
179
180 you will quickly get a new file "machine_load.gif" with all the goods.
181
182 Note: you always have to supply an input file via -i. If you don't supply
183 an output file via "-o" it .gif gets dumped to stdout. If you supply an
184 output file via "-O" the output is stored in both the file and to stdout.
185
186 Now let's play with the time ranges. You can supply times in a variety of
187 formats on the command line:
188
189 "civil date" i.e. 2002:11:05:12:51 (YYYY:MM:DD:hh:mm)
190 "epoch seconds" i.e. 1036529480
191 "julian date" i.e. 2452583.52345
192
193 You can supply a date range using the -f and -t flags (from and to):
194
195 stripchart -i machine_load -f 2002:11:01:00:00 -t 2002:11:04:00:00
196
197 Usually the "to" time is right now, so you can quickly tell stripchart
198 to plot starting at some arbitrary time "ago." This is done also via the
199 "-f" flag - if it's negative it will assume you mean that many decimal
200 days from now as a starting point. So "-f -3.5" will plot from 3 and a
201 half days ago until now.
202
203 You can also supply a "range" centered around the from time. For example,
204 to plot the 24 hours centered around 2002:11:01:13:40:
205
206 stripchart -i machine_load -f 2002:11:01:13:40 -r 1
207
208 On some rare occasions you might want to plot the last number of lines
209 in a file, regardless of what time they were. If you supply the number
210 of lines via the "-l" flag, it overrides any time ranges you may have
211 supplied.
212
213 Moving on to some other useful flags in no particular order:
214
215 To change the default title (which is the basename of the file and
216 the time range being plotted), you can do so via the "-T" command.
217 Make sure to put the title in quotes. Within the title string the
218 all-uppercase string "FILE" will be replaced with the file basename,
219 and the string "RANGE" will be replaced by the time range. So in
220 essence, the default title string is "FILE RANGE".
221
222 If you have data files in different formats, you can specify the data
223 columns using the "-x" and "-y" flags. By default -x is 2 and -y is 3.
224 Sometimes we have datafiles with many columns so we actively have to tell
225 stripchart which is the correct data column.
226
227 However, you might want to overplot one column on top of another. If your
228 data file has a second data column, you can specify what that is via the
229 -Y flag, and this data will be overplotted onto the data from the first
230 data column.
231
232 Sometime you want to plot a horizontal rule or a "baseline". You can
233 turn this feature on by specifying the value with the "-b" flag. If you
234 use the "-B" flag (without any values) it automatically computes the
235 average over the time range and plots that as the baseline. Simple!
236
237 If you want to excise certain y values, you can do so with the dump
238 flags, i.e. "-d" and "-D". In particular, any values lower than the one
239 supplied with "-d" will be dumped, and any values higher supplied by
240 "-D" will be dumped.
241
242 To log the y axis, use the "-L" flag. Quite straightforward.
243
244 A very useful flag is "-s" which outputs a line of stats underneath
245 the plot title. It shows the current value, and the minimum, maximum
246 and average values during the plot range.
247
248 For verbose output to stderr, use the "-v" flag. It may not make much
249 sense, but it's useful for debugging.
250
251 Using the "-C" flag causes stripchart to spit out the "Content-type"
252 lines necessary for incorporating stripchart plots into CGIs. This
253 doesn't work so well now, but there it is.
254
255 Okay. That's enough about the flags, and hopefully enough to get you
256 playing around with stripchart and plotting some stuff. Now onto:
257
258 stripchart.cgi
259
260 First and foremost, you need to do the following before running the
261 CGI version of stripchart:
262
263 1. Put stripchart.cgi in a cgi-enabled web-accessible directory
264 2. Make a "lib" directory somewhere that the web server can read/write to
265 3. Edit stripchart.cgi GLOBAL/DEFAULT VARS to point to proper paths, including
266 the files "querylist" and "datafiles" in the aforementioned "lib" directory.
267 4. Edit the "lib/datafiles" file to contain entries for all your data files.
268 You can find an example datafiles in the samples directory. Follow the
269 instructions in the comment lines, adding your entries below the header.
270
271 That should be it, I think. Now go to the URL wherever your stripchart.cgi
272 is sitting. If all is well..
273
274 You will be immediately presented with a web form. Ignore the "select query"
275 pulldown menu for now. Underneath that you will see a line:
276
277 Number of stripcharts: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
278
279 By default stripchart.cgi presents you with the ability to plot 4 simultaneous
280 stripcharts, but you can select any number 1-20 by clicking on those numbers.
281 The less plots, the faster a web page gets generated.
282
283 For each plot, you get a pull down menu which should contain all the entries
284 you already put in "datafiles". Here you are selecting your data source.
285
286 Then you can select the time of time range: last x hours, last x days, or
287 an arbitrary date range. By default the last x hours radio button is selected -
288 to pick another type of time range make sure you select the radio button
289 before it. Then enter the range via the pull down menus.
290
291 Then you get a simple list of checkbox/input options. You can check to log
292 the y axis, baseline the average, baseline an arbitrary value (which you
293 enter in the window, enter a y minimum, or enter a maximum.
294
295 When everything is selected, click on the "click here" button to plot.
296 Depending on the speed of your machine, you should soon be presented with
297 all the plots your desired, and the form underneath the plots which can
298 edit to your heart's content. If you want to reset the form values, click
299 on the "reset form" link.
300
301 Note the "save images in /tmp" checkbox. If that is checked and you plot
302 the stripcharts, numbered .gif files will be placed in /tmp on the web
303 server machine so you can copy them elsewhere (files will be named:
304 stripchart_plot_1.gif, etc.).
305
306 On the topmost "click here" button you will note an "enter name to save
307 query" balloon. If you enter a name here (any old string) this exact query
308 will be saved into the "querylist" file which will then later appear in the
309 pulldown menu at the top. That way if you have a favorite set of diagnostic
310 plots which you check every morning, you don't have to enter the entire form
311 every time.
312
313 If you want to delete a query, enter the name in that same field but click
314 the "delete" checkbox next to it. Next time you "click here" the query will
315 be deleted.
316
317 ----------------------
318 III. Known bugs, things to do, etc.
319
320 * stripchart -C flag is kind of pointless and doesn't work in practice.
321 * plots on data collected over small time ranges (points every few seconds, for
322 example) hasn't been tested.
323 * plots that don't work via stripchart.cgi either show ugly broken image icons
324 or nothing at all - either way it's ungraceful.
325 * pulldown menus and various plots sometimes need to be refreshed via a hard
326 refresh (i.e. shift-refresh).
327 * this readme kinda stinks.
328 * and many many other issues I'm failing to detail now!
329
330 If you have any problems using the product, feel free to e-mail me at:
331
332 [email protected]
回复1楼:不好意思,刚才复制错了没检查.
这篇文章还有问答,有个介绍.但是其他的就不好理解了
加上这一篇http://boinc.berkeley.edu/trac/b ... inc/doc/project.fig
这两篇文章提交于6年前.是DOC目录下唯一没有改过的文章,这种原始信息对于看内部结果来说有一定意
义.
Revision 583, 15.0 kB (checked in by eheien, 6 years ago) \\\
收集一些其他长达6年的文章
http://boinc.berkeley.edu/trac/browser/trunk/boinc/notes
http://boinc.berkeley.edu/trac/b ... client/test_fx_out1
http://boinc.berkeley.edu/trac/b ... c/client/install-sh
[ 本帖最后由 duligavin 于 2008-6-29 21:20 编辑 ] |
|