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

Diff of /nl.nikhef.ndpf.groupviews/trunk/ndpf-gv-mkplots

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2622 by templon, Tue Apr 9 12:38:49 2013 UTC revision 2623 by templon, Wed May 22 14:50:02 2013 UTC
# Line 146  def doplot(grouplist, dbtype, psize, tim Line 146  def doplot(grouplist, dbtype, psize, tim
146    
147      for group in (grouplist + ['total']):      for group in (grouplist + ['total']):
148          data_defs.append('DEF:'+group+'='+DATADIR+group+'.'+dbtype+'.rrd:'+dbtype+':AVERAGE')          data_defs.append('DEF:'+group+'='+DATADIR+group+'.'+dbtype+'.rrd:'+dbtype+':AVERAGE')
149        otherstring = 'CDEF:other=total,'
150        for group in grouplist:
151            otherstring += group + ','
152        otherstring += (len(grouplist)-1) * '+,' + '-'
153    
154    #    print otherstring
155        data_defs.append(otherstring)
156        
157      sumshown = 0      sumshown = 0
158      for idx in range(len(grouplist)):      for idx in range(len(grouplist)):
159          group = grouplist[idx]          group = grouplist[idx]
160          pdefstr = 'AREA' ':' + group + colors[idx] + ':' + group          if group == 'unused':
161                acolor = '#858885'
162            elif group == "offline":
163                acolor = "#790ead"
164            else:
165                acolor = colors[idx]
166            pdefstr = 'AREA' ':' + group + acolor + ':' + group
167          if pcents:          if pcents:
168              pdefstr = pdefstr + ' (' + "%4.1f" % (pcents[group]) + ')'              pdefstr = pdefstr + ' (' + "%4.1f" % (pcents[group]) + ')'
169              sumshown += float(pcents[group])              sumshown += float(pcents[group])
170          pdefstr = pdefstr + '\\n'          pdefstr = pdefstr + '\\n'
171          if idx > 0:          pdefstr = pdefstr + ':STACK'
             pdefstr = pdefstr + ':STACK'  
172          plot_defs.append(pdefstr)          plot_defs.append(pdefstr)
173    
174        pdefstr = 'AREA' ':' + 'other' + '#794044' + ':' + 'other'
175      if pcents:      if pcents:
176          plot_defs.append("LINE:total#000000:total (+%2.1f)" % (100 - sumshown))          pdefstr = pdefstr + ' (' + "%4.1f" % (100 - sumshown) + ')'
177      else:      pdefstr = pdefstr + '\\n'
178          plot_defs.append("LINE:total#000000:total")  #    pdefstr = pdefstr + ':STACK'
179    
180        plot_defs.insert(0,pdefstr)
181    #    if pcents:
182    #        plot_defs.append("LINE:total#000000:total (+%2.1f)" % (100 - sumshown))
183    #    else:
184        plot_defs.append("LINE:total#000000") # :total")
185    
186      pargs = [ PLOTDIR + dbtype + '-' + timetag + '-' + psize + '.png'] + \      pargs = [ PLOTDIR + dbtype + '-' + timetag + '-' + psize + '.png'] + \
187              commonargs + ['-l', '0'] + sizeargs[psize] + timeargs + \              commonargs + ['-l', '0'] + sizeargs[psize] + timeargs + \
# Line 182  def doplot_wait(grouplist, dbtype, psize Line 201  def doplot_wait(grouplist, dbtype, psize
201    
202      for idx in range(len(grouplist)):      for idx in range(len(grouplist)):
203          group = grouplist[idx]          group = grouplist[idx]
204          pdefstr = 'LINE3' ':' + group + colors[idx] + ':' + group          if group == 'unused':
205                acolor = '#858885'
206            elif group == "offline":
207                acolor = "#790ead"
208            else:
209                acolor = colors[idx]
210            pdefstr = 'LINE3' ':' + group + acolor + ':' + group
211          pdefstr = pdefstr + '\\n'          pdefstr = pdefstr + '\\n'
212          plot_defs.append(pdefstr)          plot_defs.append(pdefstr)
213    
# Line 237  def makeplots(prangedef): Line 262  def makeplots(prangedef):
262            
263      groups_sorted = sorted(tgroup, key=tgroup.get, reverse=False)      groups_sorted = sorted(tgroup, key=tgroup.get, reverse=False)
264      topgroups=groups_sorted[-NUMGROUPS:]      topgroups=groups_sorted[-NUMGROUPS:]
265        if 'unused' in topgroups:
266            topgroups.remove('unused')
267            topgroups.append('unused')  # makes it always appear at top of plot (except see offline)
268        if 'offline' in topgroups:
269            topgroups.remove('offline')
270            topgroups.append('offline')  # makes it always appear at top of plot
271    
272      if opts.rankonly and prangedef['timetag'] != 'hr' :      if opts.rankonly and prangedef['timetag'] != 'hr' :
273          print "Ranked average running jobs over period", prangedef['timetag']          print "Ranked average running jobs over period", prangedef['timetag']

Legend:
Removed from v.2622  
changed lines
  Added in v.2623

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