Exemple #1
0
def main(**args):
    plot_type = getattr(sys.modules[plots.__name__],args['plot']) 
    plot = plot_type(processes=args['p'],mode=args['mode'], 
                     header=args['header'],
                     prefix=args['prefix'],outdir=args['o'],
                     aggregate=(not args['full']),wide=args['wide'],
                     save=True)

    try:
        batch_system = args.get('batch_system',cfg.batch_system)
        acct_path = args.get('acct_path',cfg.acct_path)
        host_name_ext = args.get('host_name_ext',cfg.host_name_ext)
        
        acct = batch_acct.factory(batch_system,
                                  acct_path,
                                  host_name_ext)
        reader = acct.find_jobids(args['jobids'])
        filelist = []
        for acct in reader:
            date_dir = os.path.join(cfg.pickles_dir,
                                    datetime.fromtimestamp(acct['end_time']).strftime('%Y-%m-%d'))
            filelist.append(os.path.join(date_dir,acct['id']))

    except:
        filelist = tspl_utils.getfilelist(args['files'])

    plot.run(filelist)
Exemple #2
0
def main(**args):
    plot_type = getattr(sys.modules[plots.__name__], args['plot'])
    plot = plot_type(processes=args['p'],
                     mode=args['mode'],
                     header=args['header'],
                     prefix=args['prefix'],
                     outdir=args['o'],
                     aggregate=(not args['full']),
                     wide=args['wide'],
                     save=True)

    try:
        batch_system = args.get('batch_system', cfg.batch_system)
        acct_path = args.get('acct_path', cfg.acct_path)
        host_name_ext = args.get('host_name_ext', cfg.host_name_ext)

        acct = batch_acct.factory(batch_system, acct_path, host_name_ext)
        reader = acct.find_jobids(args['jobids'])
        filelist = []
        for acct in reader:
            date_dir = os.path.join(
                cfg.pickles_dir,
                datetime.fromtimestamp(acct['end_time']).strftime('%Y-%m-%d'))
            filelist.append(os.path.join(date_dir, acct['id']))

    except:
        filelist = tspl_utils.getfilelist(args['files'])

    plot.run(filelist)
Exemple #3
0
def get_filelist(start, end, pickles_dir=None):
    try:
        start = datetime.strptime(start, "%Y-%m-%d")
        end = datetime.strptime(end, "%Y-%m-%d")
    except:
        start = datetime.now() - timedelta(days=1)
        end = start

    filelist = []
    for root, dirnames, filenames in os.walk(pickles_dir):
        for directory in dirnames:
            try:
                date = datetime.strptime(directory, '%Y-%m-%d')
                if max(date.date(), start.date()) > min(
                        date.date(), end.date()):
                    continue
            except:
                print directory, "does not have date format"
                continue
            filelist.extend(
                tspl_utils.getfilelist(os.path.join(root, directory)))

        break
    print filelist
    return filelist
Exemple #4
0
def main(**args):
    plot_type = getattr(sys.modules[analysis.__name__],args['plot']) 
    plot = plot_type(processes=args['p'],mode=args['mode'], 
                     header=args['header'],
                     prefix=args['prefix'],outdir=args['o'],
                     aggregate=(not args['full']),wide=args['wide'],
                     save=True)

    filelist=tspl_utils.getfilelist(args['files'])
    plot.run(filelist)
Exemple #5
0
def get_filelist(start,end,pickles_dir=None):
    try:
        start = datetime.strptime(start,"%Y-%m-%d")
        end   = datetime.strptime(end,"%Y-%m-%d")
    except:
        start = datetime.now() - timedelta(days=1)
        end   = start

    filelist = []
    for root,dirnames,filenames in os.walk(pickles_dir):
        for directory in dirnames:
            date = datetime.strptime(directory,'%Y-%m-%d')
            if max(date.date(),start.date()) > min(date.date(),end.date()): 
                continue
            print('for date',date.date())
            print(tspl_utils.getfilelist(os.path.join(root,directory)))
            filelist.extend(tspl_utils.getfilelist(os.path.join(root,directory)))
        break
    return filelist