def getDst(self): if self.dst != None: return(self.dst) if (self.begin == None) or (self.end == None): return(None) self.dst = Timestamp.dst(self.begin) if (self.dst != Timestamp.dst(self.end.sie)) and (self.Debug == True): self.DebugMessages += "Timestamp.dst(): Warning - The interval spans a change to or from daylight savings time." return(self.dst)
def do_action(args, bulk): scale=1024.0*1024.0 fig = plt.figure() ax = fig.add_subplot(111) steps = bulk.Steps.Steps dates = np.array(steps, dtype=np.float64) if Timestamp.dst(steps[0]) == True: tzAdjust = 7.0 else: tzAdjust = 8.0 dates = (dates - tzAdjust*60.0*60.0)/(24.0*60.0*60.0) + mpl.dates.date2num(datetime.date(1970,1,1)) if len(steps) <= 500: format = '-' else: # the ',' make the point one pixel format = ',' ymax = 0 values = bulk.Read.Values/scale max = np.max(values) if max > ymax: ymax = max ax.plot_date(dates, values, fmt=format, xdate=True, ydate=False, color='r', label="LMT read", zorder=0, drawstyle='steps') #Graph.timeSeries(ax, steps, values, 'r', label='read', # Ave=False) values = bulk.Write.Values/scale max = np.max(values) if max > ymax: ymax = max ax.plot_date(dates, values, fmt=format, xdate=True, ydate=False, color='b', label="LMT write", zorder=0, drawstyle='steps') #Graph.timeSeries(ax, steps, values, 'b', label='write', # Ave=False) IORDates = np.zeros(10) IORRead = np.zeros(10) IORWrite = np.zeros(10) IORDates[0] = dates[0] IORDates[-1] = dates[-1] if ((not args.rbegin is None) and (not args.rend is None)): beginsie = float(steps[0]) + args.rbegin + args.skew beginDate = ((beginsie - tzAdjust*60.0*60.0)/(24.0*60.0*60.0) + mpl.dates.date2num(datetime.date(1970,1,1))) endsie = float(steps[0]) + args.rend + args.skew endDate = ((endsie - tzAdjust*60.0*60.0)/(24.0*60.0*60.0) + mpl.dates.date2num(datetime.date(1970,1,1))) if endsie > beginsie: rate = args.bytes/(endsie - beginsie) for i in range(5): IORDates[i] = dates[0] + i*((beginDate - dates[0])/5) IORDates[5] = beginDate - 0.0000001 IORDates[6] = beginDate IORDates[7] = endDate IORDates[8] = endDate + 0.0000001 IORRead[6] = rate IORRead[7] = rate ax.plot_date(IORDates, IORRead, fmt='--', xdate=True, ydate=False, color='r', label="IOR read", zorder=0) if ymax < rate: ymax = rate if ((not args.wbegin is None) and (not args.wend is None)): beginsie = float(steps[0]) + args.wbegin + args.skew beginDate = ((beginsie - tzAdjust*60.0*60.0)/(24.0*60.0*60.0) + mpl.dates.date2num(datetime.date(1970,1,1))) endsie = float(steps[0]) + args.wend + args.skew endDate = ((endsie - tzAdjust*60.0*60.0)/(24.0*60.0*60.0) + mpl.dates.date2num(datetime.date(1970,1,1))) if endsie > beginsie: rate = args.bytes/(endsie - beginsie) IORDates[1] = beginDate - 0.0000001 IORDates[2] = beginDate IORDates[3] = endDate IORDates[4] = endDate + 0.0000001 IORWrite[2] = rate IORWrite[3] = rate ax.plot_date(IORDates, IORWrite, fmt='--', xdate=True, ydate=False, color='b', label="IOR write", zorder=0) if ymax < rate: ymax = rate plt.xlabel('time') plt.ylabel(r'$MiB/sec$') plt.legend() plt.setp( ax.get_xticklabels(), rotation=30, horizontalalignment='right') dayStr = time.strftime("%Y-%m-%d", time.localtime(bulk.begin.sie)) plt.title("%s %s aggregate I/O" % (dayStr, bulk.name)) if args.ybound is None: args.ybound = ymax ax.set_ybound(lower = 0, upper = args.ybound) if args.plot is None: plt.show() else: plt.savefig(args.plot) plt.cla()