/[pdpsoft]/nl.nikhef.ndpf.groupviews/trunk/ndpf-mc-mkplots
ViewVC logotype

Contents of /nl.nikhef.ndpf.groupviews/trunk/ndpf-mc-mkplots

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2700 - (show annotations) (download)
Thu Apr 24 15:16:05 2014 UTC (7 years, 9 months ago) by templon
File size: 2709 byte(s)
check in working version of mkplots for multicore pool;
here separate out what I hope will be common defs from the main code


1 #! /usr/bin/env python
2 # $Id: ndpf-gv-mkplots 2688 2014-01-21 16:20:14Z templon $
3 # Source: $URL: svn+ssh://svn@ndpfsvn.nikhef.nl/repos/pdpsoft/nl.nikhef.ndpf.groupviews/trunk/ndpf-gv-mkplots $
4 # J. A. Templon, NIKHEF/PDP 2011
5
6 import optparse
7
8 p = optparse.OptionParser(description="Program to make rrdtool plots " + \
9 "of performance of multicore pool")
10
11 # p.add_option("-r",action="store",dest="minsize",default='0',help="minimum size of dirs considered; can use suffixes k,M,G for multiples of 1000**{1,2,3} bytes")
12 # p.add_option("--qdel",action="store_true",dest="deljobs",help="delete jobs for which TMPDIR is larger than MINSIZE",default=False)
13
14 p.add_option("-r",action="store",dest="ranges",
15 help="comma-separated list of ranges to plot. Supported: hour, day, week, month, year, alltime",
16 default="day")
17
18 debug = 0
19
20 opts, args = p.parse_args()
21
22 timetags = opts.ranges.split(",")
23 import os
24
25 DATADIR=os.environ['HOME'] + '/ndpfdata/'
26 PLOTDIR='/www/grid/stats/groupviews/mcpool/'
27
28
29 import ndpf_gv_plots_common as plots
30
31 datafile_dict_run = {
32 'unused' : ('unused', DATADIR + 'unused.rrd'),
33 'nonmc' : ('nonmc', DATADIR + 'nonmc.rrd'),
34 'atlb' : ('atlmc', DATADIR + 'atlmc.rrd')
35 }
36
37 datafile_dict_cap = { 'capacity' : ('mcpool', DATADIR + 'mcpool.rrd') }
38 datafile_dict_que = { 'qatlb' : ('mcqueued', DATADIR + 'mcqueued.rrd') }
39
40 tp = plots.Plot()
41 tp.datafile = datafile_dict_run.copy()
42 tp.datafile.update(datafile_dict_cap)
43 tp.datafile.update(datafile_dict_que)
44
45 tp.bands = ['atlb', 'nonmc', 'unused']
46 tp.lines = ['qatlb', 'capacity' ]
47 tp.colors = { 'unused' : plots.colors['stdgray'],
48 'nonmc' : plots.colors['lightorange'],
49 'atlb' : plots.colors['darkorange'],
50 'qatlb' : plots.colors['purple'],
51 'capacity' : plots.colors['black']
52 }
53 tp.labels = dict()
54 for g in tp.bands + tp.lines:
55 tp.labels[g] = g
56
57
58 for t in timetags:
59 if t != 'hour':
60 tgroup, pgroup = plots.getfracs(datafile_dict_run, datafile_dict_cap['capacity'],
61 plots.pdefs[t]['range'],
62 plots.pdefs[t]['res'])
63 for g in pgroup:
64 tp.labels[g] = "%-8s (%4.1f)" % (g, pgroup[g])
65
66 for s in ['small', 'large']:
67
68 tp.width = plots.pdefs[t][s]['width']
69 tp.height = plots.pdefs[t][s]['height']
70 tp.opts = plots.pdefs[t][s]['opts']
71 tp.res = plots.pdefs[t]['res']
72 tp.range = plots.pdefs[t]['range']
73 tp.timeargs = plots.pdefs[t]['timeargs']
74 tp.plotfile = '%s%s-%s-%s.png' % (PLOTDIR, 'mcpool', t, s)
75
76 tp.generate()
77

Properties

Name Value
svn:executable *

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