/[pdpsoft]/nl.nikhef.ndpf.groupviews/trunk/waitplt.py
ViewVC logotype

Annotation of /nl.nikhef.ndpf.groupviews/trunk/waitplt.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2348 - (hide annotations) (download) (as text)
Wed Jul 20 12:02:36 2011 UTC (10 years, 11 months ago) by templon
File MIME type: application/x-python
File size: 5927 byte(s)
working versions, first import


1 templon 2348 #!/usr/bin/env python
2    
3     import glob
4     import os
5    
6     volist = ['alicesgm', 'atlb', 'lhcbpil', 'atlaspil', 'atlas', 'core' ]
7    
8     gplines = [
9     'set xdata time\n',
10     'set timefmt "%b-%d-%Y-%H:%M:%S"\n',
11     '# time range must be in same format as data file\n',
12     'set grid xtics mxtics ytics mytics\n',
13     'set logscale y\n',
14     'set auto fix\n']
15    
16     gplines.append('set key outside samplen 1.3\n')
17     gplines.append('set terminal png size 365,201 font "arial,8"\n')
18     gplines.append('set output "/user/templon/public_html/wait-hr-small.png"\n')
19     gplines.append('set format x "%H:%M"\n')
20     gplines.append('set format y " %.0te+%S"\n')
21     gplines.append('set xtics 3600\n')
22     gplines.append('set mxtics 6\n')
23     gplines.append('set mytics 3\n')
24    
25     ctr = 1
26     for vo in volist:
27     if ctr == 1:
28     pstr = 'plot '
29     datafnam = os.environ['HOME']+'/tmp/'+vo+'.wdata'
30     pstr += '"< tail -75 ' + datafnam + '" using 1:3' + \
31     ' title "' + vo + '"'
32     if ctr < len(volist):
33     pstr += ' with lines lw 3,'
34     ctr += 1
35     else:
36     pstr += ' with lines lw 2'
37     gplines.append(pstr + '\n')
38    
39     gplines.append('set terminal png size 1000,535 font "arial,10"\n')
40     gplines.append('set output "/user/templon/public_html/wait-hr-large.png"\n')
41     gplines.append('set format x "%H:%M"\n')
42     gplines.append('set format y " %.0te+%S"\n')
43     gplines.append('set xtics 3600\n')
44    
45     ctr = 1
46     for vo in volist:
47     if ctr == 1:
48     pstr = 'plot '
49     datafnam = os.environ['HOME']+'/tmp/'+vo+'.wdata'
50     pstr += '"< tail -75 ' + datafnam + '" using 1:3' + \
51     ' title "' + vo + '"'
52     if ctr < len(volist):
53     pstr += ' with lines lw 3,'
54     ctr += 1
55     else:
56     pstr += ' with lines lw 2'
57     gplines.append(pstr + '\n')
58    
59     gplines.append('set terminal png size 365,201 font "arial,8"\n')
60     gplines.append('set output "/user/templon/public_html/wait-day-small.png"\n')
61     gplines.append('set format x "%H:%M"\n')
62     gplines.append('set format y " %.0te+%S"\n')
63     gplines.append('set xtics 21600\n')
64     gplines.append('set mxtics 3\n')
65    
66     ctr = 1
67     for vo in volist:
68     if ctr == 1:
69     pstr = 'plot '
70     datafnam = os.environ['HOME']+'/tmp/'+vo+'.wdata'
71     pstr += '"< tail -720 ' + datafnam + '" using 1:3' + \
72     ' title "' + vo + '"'
73     if ctr < len(volist):
74     pstr += ' with lines lw 3,'
75     ctr += 1
76     else:
77     pstr += ' with lines lw 2'
78     gplines.append(pstr + '\n')
79    
80     gplines.append('set terminal png size 1000,535 font "arial,10"\n')
81     gplines.append('set output "/user/templon/public_html/wait-day-large.png"\n')
82     gplines.append('set format x "%H:%M"\n')
83     gplines.append('set format y " %.0te+%S"\n')
84     gplines.append('set xtics 7200\n')
85     gplines.append('set mxtics 4\n')
86    
87     ctr = 1
88     for vo in volist:
89     if ctr == 1:
90     pstr = 'plot '
91     datafnam = os.environ['HOME']+'/tmp/'+vo+'.wdata'
92     pstr += '"< tail -720 ' + datafnam + '" using 1:3' + \
93     ' title "' + vo + '"'
94     if ctr < len(volist):
95     pstr += ' with lines lw 3,'
96     ctr += 1
97     else:
98     pstr += ' with lines lw 2'
99     gplines.append(pstr + '\n')
100    
101     gplines.append('set terminal png size 365,201 font "arial,8"\n')
102     gplines.append('set output "/user/templon/public_html/wait-week-small.png"\n')
103     gplines.append('set format x "%a"\n')
104     gplines.append('set format y " %.0te+%S"\n')
105     gplines.append('set xtics 86400\n')
106     gplines.append('set nomxtics \n')
107    
108     ctr = 1
109     for vo in volist:
110     if ctr == 1:
111     pstr = 'plot '
112     datafnam = os.environ['HOME']+'/tmp/'+vo+'.wdata'
113     pstr += '"< tail -5760 ' + datafnam + '" every 60 using 1:3' + \
114     ' title "' + vo + '"'
115     if ctr < len(volist):
116     pstr += ' with lines lw 3,'
117     ctr += 1
118     else:
119     pstr += ' with lines lw 2'
120     gplines.append(pstr + '\n')
121    
122     gplines.append('set terminal png size 1000,535 font "arial,10"\n')
123     gplines.append('set output "/user/templon/public_html/wait-week-large.png"\n')
124     gplines.append('set format x "%a %H:%M"\n')
125     gplines.append('set format y " %.0te+%S"\n')
126     gplines.append('set xtics 86400\n')
127     gplines.append('set mxtics 3\n')
128    
129     ctr = 1
130     for vo in volist:
131     if ctr == 1:
132     pstr = 'plot '
133     datafnam = os.environ['HOME']+'/tmp/'+vo+'.wdata'
134     pstr += '"< tail -5760 ' + datafnam + '" every 30 using 1:3' + \
135     ' title "' + vo + '"'
136     if ctr < len(volist):
137     pstr += ' with lines lw 3,'
138     ctr += 1
139     else:
140     pstr += ' with lines lw 2'
141     gplines.append(pstr + '\n')
142    
143     gplines.append('set terminal png size 365,201 font "arial,8"\n')
144     gplines.append('set output "/user/templon/public_html/wait-month-small.png"\n')
145     gplines.append('set format x "%m/%d"\n')
146     gplines.append('set format y " %.0te+%S"\n')
147     gplines.append('set xtics 604800\n')
148     gplines.append('set nomxtics \n')
149    
150     ctr = 1
151     for vo in volist:
152     if ctr == 1:
153     pstr = 'plot '
154     datafnam = os.environ['HOME']+'/tmp/'+vo+'.wdata'
155     pstr += '"< tail -22320 ' + datafnam + '" every 720 using 1:3' + \
156     ' title "' + vo + '"'
157     if ctr < len(volist):
158     pstr += ' with lines lw 3,'
159     ctr += 1
160     else:
161     pstr += ' with lines lw 2'
162     gplines.append(pstr + '\n')
163    
164     gplines.append('set terminal png size 1000,535 font "arial,10"\n')
165     gplines.append('set output "/user/templon/public_html/wait-month-large.png"\n')
166     gplines.append('set format x "%m/%d"\n')
167     gplines.append('set format y " %.0te+%S"\n')
168     gplines.append('set xtics 604800\n')
169     gplines.append('set mxtics 7\n')
170    
171     ctr = 1
172     for vo in volist:
173     if ctr == 1:
174     pstr = 'plot '
175     datafnam = os.environ['HOME']+'/tmp/'+vo+'.wdata'
176     pstr += '"< tail -22320 ' + datafnam + '" every 180 using 1:3' + \
177     ' title "' + vo + '"'
178     if ctr < len(volist):
179     pstr += ' with lines lw 3,'
180     ctr += 1
181     else:
182     pstr += ' with lines lw 2'
183     gplines.append(pstr + '\n')
184    
185     sfnam = os.environ['HOME']+'/tmp/wait.plt'
186     sf = open(sfnam,mode='w')
187     for l in gplines:
188     sf.write(l)
189     sf.close()
190     os.system(os.environ['HOME']+'/bin/gnuplot ' + sfnam)

Properties

Name Value
svn:executable *

grid.support@nikhef.nl
ViewVC Help
Powered by ViewVC 1.1.28