DAS tools¶
DAS provides a useful set of tools.
DAS config tools¶
DAS config generator
-
class
DAS.tools.create_das_config.ConfigOptionParser¶ option parser
-
get_opt()¶ Returns parse list of options
-
-
DAS.tools.create_das_config.main()¶ Main function
DAS admin tools¶
DAS stress test module¶
DAS bench tools¶
DAS benchmark tool
-
class
DAS.tools.das_bench.NClientsOptionParser¶ client option parser
-
get_opt()¶ Returns parse list of options
-
-
class
DAS.tools.das_bench.UrlRequest(method, *args, **kwargs)¶ URL requestor class which supports all RESTful request methods. It is based on urllib2.Request class and overwrite request method. Usage: UrlRequest(method, url=url, data=data), where method is GET, POST, PUT, DELETE.
-
get_method()¶ Return request method
-
-
DAS.tools.das_bench.avg_std(input_file)¶ Calculate average and standard deviation
-
DAS.tools.das_bench.gen_passwd(length=8, chars='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789')¶ Random string generator, code based on http://code.activestate.com/recipes/59873-random-password-generation/
-
DAS.tools.das_bench.main()¶ Main routine
-
DAS.tools.das_bench.make_plot(xxx, yyy, std=None, name='das_cache.pdf', xlabel='Number of clients', ylabel='Time/request (sec)', yscale=None, title='')¶ Make standard plot time vs nclients using matplotlib
-
DAS.tools.das_bench.natcasecmp(aaa, bbb)¶ Natural string comparison, ignores case.
-
DAS.tools.das_bench.natcmp(aaa, bbb)¶ Natural string comparison, case sensitive.
-
DAS.tools.das_bench.natsort(seq, icmp=<function natcmp>)¶ In-place natural string sort.
-
DAS.tools.das_bench.natsort_key(sss)¶ Used internally to get a tuple by which s is sorted.
-
DAS.tools.das_bench.natsorted(seq, icmp=<function natcmp>)¶ Returns a copy of seq, sorted by natural string sort.
-
DAS.tools.das_bench.random_index(bound)¶ Generate random number for given upper bound
-
DAS.tools.das_bench.runjob(nclients, host, method, params, headers, idx, limit, debug=0, logname='spammer', dasquery=None)¶ Run spammer for provided number of parralel clients, host name and method (API). The output data are stored into lognameN.log, where logname is an optional parameter with default as spammer.
-
DAS.tools.das_bench.spammer(stream, host, method, params, headers, write_lock, debug=0)¶ start new process for each request
-
DAS.tools.das_bench.try_int(sss)¶ Convert to integer if possible.
-
DAS.tools.das_bench.urlrequest(stream, url, headers, write_lock, debug=0)¶ URL request function
DAS CLI tool¶
DAS client¶
DAS command line tool
-
class
DAS.tools.das_client.DASOptionParser¶ DAS cache client option parser
-
get_opt()¶ Returns parse list of options
-
-
class
DAS.tools.das_client.HTTPSClientAuthHandler(key=None, cert=None, level=0)¶ Simple HTTPS client authentication class based on provided key/ca information
-
get_connection(host, timeout=300)¶ Connection method
-
https_open(req)¶ Open request method
-
-
DAS.tools.das_client.check_auth(key)¶ Check if user runs das_client with key/cert and warn users to switch
-
DAS.tools.das_client.check_glidein()¶ Check glideine environment and exit if it is set
-
DAS.tools.das_client.convert_time(val)¶ Convert given timestamp into human readable format
-
DAS.tools.das_client.extract_value(row, key)¶ Generator which extracts row[key] value
-
DAS.tools.das_client.fullpath(path)¶ Expand path to full path
-
DAS.tools.das_client.get_data(host, query, idx, limit, debug, threshold=300, ckey=None, cert=None, das_headers=True)¶ Contact DAS server and retrieve data for given DAS query
-
DAS.tools.das_client.get_value(data, filters, base=10)¶ Filter data from a row for given list of filters
-
DAS.tools.das_client.keys_attrs(lkey, oformat, host, ckey, cert, debug=0)¶ Contact host for list of key/attributes pairs
-
DAS.tools.das_client.main()¶ Main function
-
DAS.tools.das_client.prim_value(row)¶ Extract primary key value from DAS record
-
DAS.tools.das_client.print_from_cache(cache, query)¶ print the list of files reading it from cache
-
DAS.tools.das_client.print_summary(rec)¶ Print summary record information on stdout
-
DAS.tools.das_client.size_format(uinput, ibase=0)¶ Format file size utility, it converts file size into KB, MB, GB, TB, PB units
-
DAS.tools.das_client.unique_filter(rows)¶ Unique filter drop duplicate rows.
-
DAS.tools.das_client.x509()¶ Helper function to get x509 either from env or tmp file