/[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 2830 - (show annotations) (download)
Thu Jan 14 12:33:11 2016 UTC (6 years ago) by templon
File size: 4287 byte(s)
Summary: add virgo

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 p.add_option("--rank-only",action="store_true",dest="rankonly",
18 help="don't plot, just print ranking of groups",default=False)
19
20 debug = 0
21
22 opts, args = p.parse_args()
23
24 timetags = opts.ranges.split(",")
25 import os
26
27 DATADIR=os.environ['HOME'] + '/ndpfdata/'
28 PLOTDIR='/www/grid/stats/groupviews/mcpool/'
29
30
31 import ndpf_gv_plots_common as plots
32
33 datafile_dict_run = {
34 'unused' : ('running', DATADIR + 'unused.mcpool.rrd'),
35 }
36
37 import glob
38 running_files = glob.glob(DATADIR+'*.running.mcpool.rrd')
39 for db in running_files:
40 group = db[len(DATADIR):db.find('.running.mcpool.rrd')]
41 datafile_dict_run[group] = ( 'running', db)
42
43 datafile_dict_cap = { 'capacity' : ('running', DATADIR + 'capacity.mcpool.rrd') }
44
45 tmpk = datafile_dict_run.keys()
46 tmpk.remove('unused')
47 tmpk.remove('nonmc')
48
49 datafile_dict_que = dict()
50 for k in tmpk:
51 datafile_dict_que[k] = ('queued', DATADIR + k + '.queued.mcpool.rrd')
52
53 tp = plots.Plot()
54
55 tp.colors = { 'unused' : plots.colors['stdgray'],
56 'nonmc' : plots.colors['lightgreen'],
57 'atlb' : plots.colors['darkorange'],
58 'pbbmri' : plots.colors['lightorange'],
59 'datagrid' : plots.colors['darkred'],
60 'virgo' : plots.colors['lightred'],
61 'capacity' : plots.colors['black']
62 }
63
64 tp.labels = dict()
65 for g in tp.colors:
66 tp.labels[g] = g
67
68 import sys
69 if opts.rankonly:
70 for t in timetags:
71 tgroup, pgroup = plots.getfracs(datafile_dict_run, datafile_dict_cap['capacity'],
72 plots.pdefs[t]['range'],
73 plots.pdefs[t]['res'])
74 groups_sorted = sorted(tgroup, key=tgroup.get, reverse=True) # decreasing useage towards end of list
75 idx = 0
76 print " group av.run %pool"
77 print " ----- ------ -----"
78 for k in groups_sorted:
79 idx += 1
80 print "%2d. %8s %5.1f %5.2f" % (idx, k, tgroup[k], pgroup[k])
81 sys.exit(0)
82
83 for t in timetags:
84 for qr in ['running', 'queued']:
85 if t != 'hour' and qr == 'running':
86 tgroup, pgroup = plots.getfracs(datafile_dict_run, datafile_dict_cap['capacity'],
87 plots.pdefs[t]['range'],
88 plots.pdefs[t]['res'])
89 for g in pgroup:
90 tp.labels[g] = "%-8s (%4.1f)" % (g, pgroup[g])
91 else:
92 for g in tp.colors:
93 tp.labels[g] = g
94 if qr == 'running':
95 tp.datafile = datafile_dict_run.copy()
96 tp.datafile.update(datafile_dict_cap)
97 tp.lines = ['capacity' ]
98 tp.bands = ['atlb', 'pbbmri', 'datagrid', 'nonmc', 'unused']
99 else:
100 tp.datafile = datafile_dict_que.copy()
101 tp.datafile.update(datafile_dict_que)
102 tp.lines = [ ]
103 tp.bands = ['atlb', 'pbbmri', 'datagrid']
104
105 for s in ['small', 'large']:
106
107 tp.width = plots.pdefs[t][s]['width']
108 tp.height = plots.pdefs[t][s]['height']
109 tp.opts = plots.pdefs[t][s]['opts']
110 tp.res = plots.pdefs[t]['res']
111 tp.range = plots.pdefs[t]['range']
112 tp.timeargs = plots.pdefs[t]['timeargs']
113 tp.plotfile = '%s%s-%s-%s-%s.png' % (PLOTDIR, 'mcpool', qr, t, s)
114
115 tp.generate()
116

Properties

Name Value
svn:executable *

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