2004-08-10 03:20:52 +02:00
|
|
|
#!/usr/bin/env python
|
2005-06-05 10:08:05 +02:00
|
|
|
|
|
|
|
# Copyright (c) 2003-2004 The Regents of The University of Michigan
|
|
|
|
# All rights reserved.
|
|
|
|
#
|
|
|
|
# Redistribution and use in source and binary forms, with or without
|
|
|
|
# modification, are permitted provided that the following conditions are
|
|
|
|
# met: redistributions of source code must retain the above copyright
|
|
|
|
# notice, this list of conditions and the following disclaimer;
|
|
|
|
# redistributions in binary form must reproduce the above copyright
|
|
|
|
# notice, this list of conditions and the following disclaimer in the
|
|
|
|
# documentation and/or other materials provided with the distribution;
|
|
|
|
# neither the name of the copyright holders nor the names of its
|
|
|
|
# contributors may be used to endorse or promote products derived from
|
|
|
|
# this software without specific prior written permission.
|
|
|
|
#
|
|
|
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
|
|
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
|
|
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
|
|
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
|
|
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
|
|
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
|
|
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
|
2004-08-10 03:20:52 +02:00
|
|
|
from __future__ import division
|
2005-01-18 19:34:58 +01:00
|
|
|
import re, sys, math
|
2004-08-10 03:20:52 +02:00
|
|
|
|
|
|
|
def usage():
|
|
|
|
print '''\
|
2005-09-17 22:51:26 +02:00
|
|
|
Usage: %s [-E] [-F] [ -G <get> ] [-d <db> ] [-g <graphdir> ] [-h <host>] [-p]
|
2005-01-20 00:40:02 +01:00
|
|
|
[-s <system>] [-r <runs> ] [-T <samples>] [-u <username>]
|
|
|
|
<command> [command args]
|
|
|
|
|
|
|
|
commands extra parameters description
|
|
|
|
----------- ------------------ ---------------------------------------
|
|
|
|
bins [regex] List bins (only matching regex)
|
|
|
|
formula <formula> Evaluated formula specified
|
|
|
|
formulas [regex] List formulas (only matching regex)
|
|
|
|
runs none List all runs in database
|
|
|
|
samples none List samples present in database
|
|
|
|
stability <pairnum> <stats> Calculated statistical info about stats
|
|
|
|
stat <regex> Show stat data (only matching regex)
|
|
|
|
stats [regex] List all stats (only matching regex)
|
2005-03-23 21:55:09 +01:00
|
|
|
|
|
|
|
database <command> Where command is drop, init, or clean
|
|
|
|
|
2004-08-10 03:20:52 +02:00
|
|
|
''' % sys.argv[0]
|
|
|
|
sys.exit(1)
|
|
|
|
|
|
|
|
def getopts(list, flags):
|
|
|
|
import getopt
|
|
|
|
try:
|
|
|
|
opts, args = getopt.getopt(list, flags)
|
|
|
|
except getopt.GetoptError:
|
|
|
|
usage()
|
|
|
|
|
|
|
|
return opts, args
|
|
|
|
|
|
|
|
class CommandException(Exception):
|
|
|
|
pass
|
|
|
|
|
|
|
|
def commands(options, command, args):
|
|
|
|
if command == 'database':
|
|
|
|
if len(args) == 0: raise CommandException
|
|
|
|
|
|
|
|
import dbinit
|
|
|
|
mydb = dbinit.MyDB(options)
|
|
|
|
|
|
|
|
if args[0] == 'drop':
|
|
|
|
if len(args) > 2: raise CommandException
|
|
|
|
mydb.admin()
|
|
|
|
mydb.drop()
|
|
|
|
if len(args) == 2 and args[1] == 'init':
|
|
|
|
mydb.create()
|
|
|
|
mydb.connect()
|
|
|
|
mydb.populate()
|
|
|
|
mydb.close()
|
|
|
|
return
|
|
|
|
|
|
|
|
if args[0] == 'init':
|
|
|
|
if len(args) > 1: raise CommandException
|
|
|
|
mydb.admin()
|
|
|
|
mydb.create()
|
|
|
|
mydb.connect()
|
|
|
|
mydb.populate()
|
|
|
|
mydb.close()
|
|
|
|
return
|
|
|
|
|
|
|
|
if args[0] == 'clean':
|
|
|
|
if len(args) > 1: raise CommandException
|
|
|
|
mydb.connect()
|
|
|
|
mydb.clean()
|
|
|
|
return
|
|
|
|
|
|
|
|
raise CommandException
|
|
|
|
|
Major cleanup of the statistics handling code
util/stats/db.py:
Build a result object as the result of a query operation so it is
easier to populate and contains a bit more information than just
a big dict. Also change the next level data into a matrix instead
of a dict of dicts.
Move the "get" function into the Database object. (The get function
is used by the output parsing function as the interface for accessing
backend storage, same interface for profile stuff.)
Change the old get variable to the method variable, it describes how
the get works, (whether using sum, stdev, etc.)
util/stats/display.py:
Clean up the display functions, mostly formatting.
Handle values the way they should be now.
util/stats/info.py:
Totally re-work how values are accessed from their data store.
Access individual values on demand instead of calculating everything
and passing up a huge result from the bottom.
This impacts the way that proxying works, and in general, everything
is now esentially a proxy for the lower level database. Provide new
operators: unproxy, scalar, vector, value, values, total, and len which
retrieve the proper result from the object they are called on.
Move the ProxyGroup stuff (proxies of proxies!) here from the now gone
proxy.py file and integrate the shared parts of the code. The ProxyGroup
stuff allows you to write formulas without specifying the statistics
until evaluation time.
Get rid of global variables!
util/stats/output.py:
Move the dbinfo stuff into the Database itself. Each source should
have it's own get() function for accessing it's data.
This get() function behaves a bit differently than before in that it
can return vectors as well, deal with these vectors and with no result
conditions better.
util/stats/stats.py:
the info module no longer has the source global variable, just
create the database source and pass it around as necessary
--HG--
extra : convert_revision : 8e5aa228e5d3ae8068ef9c40f65b3a2f9e7c0cff
2005-10-21 22:29:13 +02:00
|
|
|
import db
|
|
|
|
source = db.Database()
|
|
|
|
source.host = options.host
|
|
|
|
source.db = options.db
|
|
|
|
source.passwd = options.passwd
|
|
|
|
source.user = options.user
|
|
|
|
source.connect()
|
|
|
|
#source.update_dict(globals())
|
|
|
|
|
|
|
|
if type(options.method) is str:
|
|
|
|
source.method = options.method
|
2004-08-10 03:20:52 +02:00
|
|
|
|
|
|
|
if options.runs is None:
|
Major cleanup of the statistics handling code
util/stats/db.py:
Build a result object as the result of a query operation so it is
easier to populate and contains a bit more information than just
a big dict. Also change the next level data into a matrix instead
of a dict of dicts.
Move the "get" function into the Database object. (The get function
is used by the output parsing function as the interface for accessing
backend storage, same interface for profile stuff.)
Change the old get variable to the method variable, it describes how
the get works, (whether using sum, stdev, etc.)
util/stats/display.py:
Clean up the display functions, mostly formatting.
Handle values the way they should be now.
util/stats/info.py:
Totally re-work how values are accessed from their data store.
Access individual values on demand instead of calculating everything
and passing up a huge result from the bottom.
This impacts the way that proxying works, and in general, everything
is now esentially a proxy for the lower level database. Provide new
operators: unproxy, scalar, vector, value, values, total, and len which
retrieve the proper result from the object they are called on.
Move the ProxyGroup stuff (proxies of proxies!) here from the now gone
proxy.py file and integrate the shared parts of the code. The ProxyGroup
stuff allows you to write formulas without specifying the statistics
until evaluation time.
Get rid of global variables!
util/stats/output.py:
Move the dbinfo stuff into the Database itself. Each source should
have it's own get() function for accessing it's data.
This get() function behaves a bit differently than before in that it
can return vectors as well, deal with these vectors and with no result
conditions better.
util/stats/stats.py:
the info module no longer has the source global variable, just
create the database source and pass it around as necessary
--HG--
extra : convert_revision : 8e5aa228e5d3ae8068ef9c40f65b3a2f9e7c0cff
2005-10-21 22:29:13 +02:00
|
|
|
runs = source.allRuns
|
2004-08-10 03:20:52 +02:00
|
|
|
else:
|
|
|
|
rx = re.compile(options.runs)
|
|
|
|
runs = []
|
Major cleanup of the statistics handling code
util/stats/db.py:
Build a result object as the result of a query operation so it is
easier to populate and contains a bit more information than just
a big dict. Also change the next level data into a matrix instead
of a dict of dicts.
Move the "get" function into the Database object. (The get function
is used by the output parsing function as the interface for accessing
backend storage, same interface for profile stuff.)
Change the old get variable to the method variable, it describes how
the get works, (whether using sum, stdev, etc.)
util/stats/display.py:
Clean up the display functions, mostly formatting.
Handle values the way they should be now.
util/stats/info.py:
Totally re-work how values are accessed from their data store.
Access individual values on demand instead of calculating everything
and passing up a huge result from the bottom.
This impacts the way that proxying works, and in general, everything
is now esentially a proxy for the lower level database. Provide new
operators: unproxy, scalar, vector, value, values, total, and len which
retrieve the proper result from the object they are called on.
Move the ProxyGroup stuff (proxies of proxies!) here from the now gone
proxy.py file and integrate the shared parts of the code. The ProxyGroup
stuff allows you to write formulas without specifying the statistics
until evaluation time.
Get rid of global variables!
util/stats/output.py:
Move the dbinfo stuff into the Database itself. Each source should
have it's own get() function for accessing it's data.
This get() function behaves a bit differently than before in that it
can return vectors as well, deal with these vectors and with no result
conditions better.
util/stats/stats.py:
the info module no longer has the source global variable, just
create the database source and pass it around as necessary
--HG--
extra : convert_revision : 8e5aa228e5d3ae8068ef9c40f65b3a2f9e7c0cff
2005-10-21 22:29:13 +02:00
|
|
|
for run in source.allRuns:
|
2004-08-10 03:20:52 +02:00
|
|
|
if rx.match(run.name):
|
|
|
|
runs.append(run)
|
|
|
|
|
|
|
|
if command == 'runs':
|
|
|
|
user = None
|
|
|
|
opts, args = getopts(args, '-u')
|
|
|
|
if len(args):
|
|
|
|
raise CommandException
|
|
|
|
for o,a in opts:
|
|
|
|
if o == '-u':
|
|
|
|
user = a
|
Major cleanup of the statistics handling code
util/stats/db.py:
Build a result object as the result of a query operation so it is
easier to populate and contains a bit more information than just
a big dict. Also change the next level data into a matrix instead
of a dict of dicts.
Move the "get" function into the Database object. (The get function
is used by the output parsing function as the interface for accessing
backend storage, same interface for profile stuff.)
Change the old get variable to the method variable, it describes how
the get works, (whether using sum, stdev, etc.)
util/stats/display.py:
Clean up the display functions, mostly formatting.
Handle values the way they should be now.
util/stats/info.py:
Totally re-work how values are accessed from their data store.
Access individual values on demand instead of calculating everything
and passing up a huge result from the bottom.
This impacts the way that proxying works, and in general, everything
is now esentially a proxy for the lower level database. Provide new
operators: unproxy, scalar, vector, value, values, total, and len which
retrieve the proper result from the object they are called on.
Move the ProxyGroup stuff (proxies of proxies!) here from the now gone
proxy.py file and integrate the shared parts of the code. The ProxyGroup
stuff allows you to write formulas without specifying the statistics
until evaluation time.
Get rid of global variables!
util/stats/output.py:
Move the dbinfo stuff into the Database itself. Each source should
have it's own get() function for accessing it's data.
This get() function behaves a bit differently than before in that it
can return vectors as well, deal with these vectors and with no result
conditions better.
util/stats/stats.py:
the info module no longer has the source global variable, just
create the database source and pass it around as necessary
--HG--
extra : convert_revision : 8e5aa228e5d3ae8068ef9c40f65b3a2f9e7c0cff
2005-10-21 22:29:13 +02:00
|
|
|
source.listRuns(user)
|
2004-08-10 03:20:52 +02:00
|
|
|
return
|
|
|
|
|
2005-09-17 22:51:26 +02:00
|
|
|
if command == 'stats':
|
|
|
|
if len(args) == 0:
|
Major cleanup of the statistics handling code
util/stats/db.py:
Build a result object as the result of a query operation so it is
easier to populate and contains a bit more information than just
a big dict. Also change the next level data into a matrix instead
of a dict of dicts.
Move the "get" function into the Database object. (The get function
is used by the output parsing function as the interface for accessing
backend storage, same interface for profile stuff.)
Change the old get variable to the method variable, it describes how
the get works, (whether using sum, stdev, etc.)
util/stats/display.py:
Clean up the display functions, mostly formatting.
Handle values the way they should be now.
util/stats/info.py:
Totally re-work how values are accessed from their data store.
Access individual values on demand instead of calculating everything
and passing up a huge result from the bottom.
This impacts the way that proxying works, and in general, everything
is now esentially a proxy for the lower level database. Provide new
operators: unproxy, scalar, vector, value, values, total, and len which
retrieve the proper result from the object they are called on.
Move the ProxyGroup stuff (proxies of proxies!) here from the now gone
proxy.py file and integrate the shared parts of the code. The ProxyGroup
stuff allows you to write formulas without specifying the statistics
until evaluation time.
Get rid of global variables!
util/stats/output.py:
Move the dbinfo stuff into the Database itself. Each source should
have it's own get() function for accessing it's data.
This get() function behaves a bit differently than before in that it
can return vectors as well, deal with these vectors and with no result
conditions better.
util/stats/stats.py:
the info module no longer has the source global variable, just
create the database source and pass it around as necessary
--HG--
extra : convert_revision : 8e5aa228e5d3ae8068ef9c40f65b3a2f9e7c0cff
2005-10-21 22:29:13 +02:00
|
|
|
source.listStats()
|
2005-09-17 22:51:26 +02:00
|
|
|
elif len(args) == 1:
|
Major cleanup of the statistics handling code
util/stats/db.py:
Build a result object as the result of a query operation so it is
easier to populate and contains a bit more information than just
a big dict. Also change the next level data into a matrix instead
of a dict of dicts.
Move the "get" function into the Database object. (The get function
is used by the output parsing function as the interface for accessing
backend storage, same interface for profile stuff.)
Change the old get variable to the method variable, it describes how
the get works, (whether using sum, stdev, etc.)
util/stats/display.py:
Clean up the display functions, mostly formatting.
Handle values the way they should be now.
util/stats/info.py:
Totally re-work how values are accessed from their data store.
Access individual values on demand instead of calculating everything
and passing up a huge result from the bottom.
This impacts the way that proxying works, and in general, everything
is now esentially a proxy for the lower level database. Provide new
operators: unproxy, scalar, vector, value, values, total, and len which
retrieve the proper result from the object they are called on.
Move the ProxyGroup stuff (proxies of proxies!) here from the now gone
proxy.py file and integrate the shared parts of the code. The ProxyGroup
stuff allows you to write formulas without specifying the statistics
until evaluation time.
Get rid of global variables!
util/stats/output.py:
Move the dbinfo stuff into the Database itself. Each source should
have it's own get() function for accessing it's data.
This get() function behaves a bit differently than before in that it
can return vectors as well, deal with these vectors and with no result
conditions better.
util/stats/stats.py:
the info module no longer has the source global variable, just
create the database source and pass it around as necessary
--HG--
extra : convert_revision : 8e5aa228e5d3ae8068ef9c40f65b3a2f9e7c0cff
2005-10-21 22:29:13 +02:00
|
|
|
source.listStats(args[0])
|
2005-09-17 22:51:26 +02:00
|
|
|
else:
|
|
|
|
raise CommandException
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
if command == 'bins':
|
|
|
|
if len(args) == 0:
|
Major cleanup of the statistics handling code
util/stats/db.py:
Build a result object as the result of a query operation so it is
easier to populate and contains a bit more information than just
a big dict. Also change the next level data into a matrix instead
of a dict of dicts.
Move the "get" function into the Database object. (The get function
is used by the output parsing function as the interface for accessing
backend storage, same interface for profile stuff.)
Change the old get variable to the method variable, it describes how
the get works, (whether using sum, stdev, etc.)
util/stats/display.py:
Clean up the display functions, mostly formatting.
Handle values the way they should be now.
util/stats/info.py:
Totally re-work how values are accessed from their data store.
Access individual values on demand instead of calculating everything
and passing up a huge result from the bottom.
This impacts the way that proxying works, and in general, everything
is now esentially a proxy for the lower level database. Provide new
operators: unproxy, scalar, vector, value, values, total, and len which
retrieve the proper result from the object they are called on.
Move the ProxyGroup stuff (proxies of proxies!) here from the now gone
proxy.py file and integrate the shared parts of the code. The ProxyGroup
stuff allows you to write formulas without specifying the statistics
until evaluation time.
Get rid of global variables!
util/stats/output.py:
Move the dbinfo stuff into the Database itself. Each source should
have it's own get() function for accessing it's data.
This get() function behaves a bit differently than before in that it
can return vectors as well, deal with these vectors and with no result
conditions better.
util/stats/stats.py:
the info module no longer has the source global variable, just
create the database source and pass it around as necessary
--HG--
extra : convert_revision : 8e5aa228e5d3ae8068ef9c40f65b3a2f9e7c0cff
2005-10-21 22:29:13 +02:00
|
|
|
source.listBins()
|
2005-09-17 22:51:26 +02:00
|
|
|
elif len(args) == 1:
|
Major cleanup of the statistics handling code
util/stats/db.py:
Build a result object as the result of a query operation so it is
easier to populate and contains a bit more information than just
a big dict. Also change the next level data into a matrix instead
of a dict of dicts.
Move the "get" function into the Database object. (The get function
is used by the output parsing function as the interface for accessing
backend storage, same interface for profile stuff.)
Change the old get variable to the method variable, it describes how
the get works, (whether using sum, stdev, etc.)
util/stats/display.py:
Clean up the display functions, mostly formatting.
Handle values the way they should be now.
util/stats/info.py:
Totally re-work how values are accessed from their data store.
Access individual values on demand instead of calculating everything
and passing up a huge result from the bottom.
This impacts the way that proxying works, and in general, everything
is now esentially a proxy for the lower level database. Provide new
operators: unproxy, scalar, vector, value, values, total, and len which
retrieve the proper result from the object they are called on.
Move the ProxyGroup stuff (proxies of proxies!) here from the now gone
proxy.py file and integrate the shared parts of the code. The ProxyGroup
stuff allows you to write formulas without specifying the statistics
until evaluation time.
Get rid of global variables!
util/stats/output.py:
Move the dbinfo stuff into the Database itself. Each source should
have it's own get() function for accessing it's data.
This get() function behaves a bit differently than before in that it
can return vectors as well, deal with these vectors and with no result
conditions better.
util/stats/stats.py:
the info module no longer has the source global variable, just
create the database source and pass it around as necessary
--HG--
extra : convert_revision : 8e5aa228e5d3ae8068ef9c40f65b3a2f9e7c0cff
2005-10-21 22:29:13 +02:00
|
|
|
source.listBins(args[0])
|
2005-09-17 22:51:26 +02:00
|
|
|
else:
|
|
|
|
raise CommandException
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
if command == 'formulas':
|
|
|
|
if len(args) == 0:
|
Major cleanup of the statistics handling code
util/stats/db.py:
Build a result object as the result of a query operation so it is
easier to populate and contains a bit more information than just
a big dict. Also change the next level data into a matrix instead
of a dict of dicts.
Move the "get" function into the Database object. (The get function
is used by the output parsing function as the interface for accessing
backend storage, same interface for profile stuff.)
Change the old get variable to the method variable, it describes how
the get works, (whether using sum, stdev, etc.)
util/stats/display.py:
Clean up the display functions, mostly formatting.
Handle values the way they should be now.
util/stats/info.py:
Totally re-work how values are accessed from their data store.
Access individual values on demand instead of calculating everything
and passing up a huge result from the bottom.
This impacts the way that proxying works, and in general, everything
is now esentially a proxy for the lower level database. Provide new
operators: unproxy, scalar, vector, value, values, total, and len which
retrieve the proper result from the object they are called on.
Move the ProxyGroup stuff (proxies of proxies!) here from the now gone
proxy.py file and integrate the shared parts of the code. The ProxyGroup
stuff allows you to write formulas without specifying the statistics
until evaluation time.
Get rid of global variables!
util/stats/output.py:
Move the dbinfo stuff into the Database itself. Each source should
have it's own get() function for accessing it's data.
This get() function behaves a bit differently than before in that it
can return vectors as well, deal with these vectors and with no result
conditions better.
util/stats/stats.py:
the info module no longer has the source global variable, just
create the database source and pass it around as necessary
--HG--
extra : convert_revision : 8e5aa228e5d3ae8068ef9c40f65b3a2f9e7c0cff
2005-10-21 22:29:13 +02:00
|
|
|
source.listFormulas()
|
2005-09-17 22:51:26 +02:00
|
|
|
elif len(args) == 1:
|
Major cleanup of the statistics handling code
util/stats/db.py:
Build a result object as the result of a query operation so it is
easier to populate and contains a bit more information than just
a big dict. Also change the next level data into a matrix instead
of a dict of dicts.
Move the "get" function into the Database object. (The get function
is used by the output parsing function as the interface for accessing
backend storage, same interface for profile stuff.)
Change the old get variable to the method variable, it describes how
the get works, (whether using sum, stdev, etc.)
util/stats/display.py:
Clean up the display functions, mostly formatting.
Handle values the way they should be now.
util/stats/info.py:
Totally re-work how values are accessed from their data store.
Access individual values on demand instead of calculating everything
and passing up a huge result from the bottom.
This impacts the way that proxying works, and in general, everything
is now esentially a proxy for the lower level database. Provide new
operators: unproxy, scalar, vector, value, values, total, and len which
retrieve the proper result from the object they are called on.
Move the ProxyGroup stuff (proxies of proxies!) here from the now gone
proxy.py file and integrate the shared parts of the code. The ProxyGroup
stuff allows you to write formulas without specifying the statistics
until evaluation time.
Get rid of global variables!
util/stats/output.py:
Move the dbinfo stuff into the Database itself. Each source should
have it's own get() function for accessing it's data.
This get() function behaves a bit differently than before in that it
can return vectors as well, deal with these vectors and with no result
conditions better.
util/stats/stats.py:
the info module no longer has the source global variable, just
create the database source and pass it around as necessary
--HG--
extra : convert_revision : 8e5aa228e5d3ae8068ef9c40f65b3a2f9e7c0cff
2005-10-21 22:29:13 +02:00
|
|
|
source.listFormulas(args[0])
|
2005-09-17 22:51:26 +02:00
|
|
|
else:
|
|
|
|
raise CommandException
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
if command == 'samples':
|
|
|
|
if len(args):
|
|
|
|
raise CommandException
|
|
|
|
|
Major cleanup of the statistics handling code
util/stats/db.py:
Build a result object as the result of a query operation so it is
easier to populate and contains a bit more information than just
a big dict. Also change the next level data into a matrix instead
of a dict of dicts.
Move the "get" function into the Database object. (The get function
is used by the output parsing function as the interface for accessing
backend storage, same interface for profile stuff.)
Change the old get variable to the method variable, it describes how
the get works, (whether using sum, stdev, etc.)
util/stats/display.py:
Clean up the display functions, mostly formatting.
Handle values the way they should be now.
util/stats/info.py:
Totally re-work how values are accessed from their data store.
Access individual values on demand instead of calculating everything
and passing up a huge result from the bottom.
This impacts the way that proxying works, and in general, everything
is now esentially a proxy for the lower level database. Provide new
operators: unproxy, scalar, vector, value, values, total, and len which
retrieve the proper result from the object they are called on.
Move the ProxyGroup stuff (proxies of proxies!) here from the now gone
proxy.py file and integrate the shared parts of the code. The ProxyGroup
stuff allows you to write formulas without specifying the statistics
until evaluation time.
Get rid of global variables!
util/stats/output.py:
Move the dbinfo stuff into the Database itself. Each source should
have it's own get() function for accessing it's data.
This get() function behaves a bit differently than before in that it
can return vectors as well, deal with these vectors and with no result
conditions better.
util/stats/stats.py:
the info module no longer has the source global variable, just
create the database source and pass it around as necessary
--HG--
extra : convert_revision : 8e5aa228e5d3ae8068ef9c40f65b3a2f9e7c0cff
2005-10-21 22:29:13 +02:00
|
|
|
source.listTicks(runs)
|
2005-09-17 22:51:26 +02:00
|
|
|
return
|
|
|
|
|
2005-01-14 23:50:36 +01:00
|
|
|
if command == 'stability':
|
2005-01-20 00:40:02 +01:00
|
|
|
if len(args) < 2:
|
|
|
|
raise CommandException
|
|
|
|
|
|
|
|
try:
|
|
|
|
merge = int(args[0])
|
|
|
|
except ValueError:
|
|
|
|
usage()
|
Major cleanup of the statistics handling code
util/stats/db.py:
Build a result object as the result of a query operation so it is
easier to populate and contains a bit more information than just
a big dict. Also change the next level data into a matrix instead
of a dict of dicts.
Move the "get" function into the Database object. (The get function
is used by the output parsing function as the interface for accessing
backend storage, same interface for profile stuff.)
Change the old get variable to the method variable, it describes how
the get works, (whether using sum, stdev, etc.)
util/stats/display.py:
Clean up the display functions, mostly formatting.
Handle values the way they should be now.
util/stats/info.py:
Totally re-work how values are accessed from their data store.
Access individual values on demand instead of calculating everything
and passing up a huge result from the bottom.
This impacts the way that proxying works, and in general, everything
is now esentially a proxy for the lower level database. Provide new
operators: unproxy, scalar, vector, value, values, total, and len which
retrieve the proper result from the object they are called on.
Move the ProxyGroup stuff (proxies of proxies!) here from the now gone
proxy.py file and integrate the shared parts of the code. The ProxyGroup
stuff allows you to write formulas without specifying the statistics
until evaluation time.
Get rid of global variables!
util/stats/output.py:
Move the dbinfo stuff into the Database itself. Each source should
have it's own get() function for accessing it's data.
This get() function behaves a bit differently than before in that it
can return vectors as well, deal with these vectors and with no result
conditions better.
util/stats/stats.py:
the info module no longer has the source global variable, just
create the database source and pass it around as necessary
--HG--
extra : convert_revision : 8e5aa228e5d3ae8068ef9c40f65b3a2f9e7c0cff
2005-10-21 22:29:13 +02:00
|
|
|
stats = source.getStat(args[1])
|
|
|
|
source.method = 'sum'
|
2005-01-20 00:40:02 +01:00
|
|
|
|
2005-09-17 22:51:26 +02:00
|
|
|
def disp(*args):
|
2005-11-02 20:55:05 +01:00
|
|
|
print "%-35s %12s %12s %4s %5s %5s %5s %10s" % args
|
2005-09-17 22:51:26 +02:00
|
|
|
|
|
|
|
# temporary variable containing a bunch of dashes
|
|
|
|
d = '-' * 100
|
2005-01-14 23:50:36 +01:00
|
|
|
|
|
|
|
#loop through all the stats selected
|
|
|
|
for stat in stats:
|
2005-01-18 19:25:55 +01:00
|
|
|
print "%s:" % stat.name
|
2005-09-17 22:51:26 +02:00
|
|
|
disp("run name", "average", "stdev", ">10%", ">1SDV", ">2SDV",
|
|
|
|
"SAMP", "CV")
|
2005-11-02 20:55:05 +01:00
|
|
|
disp(d[:35], d[:12], d[:12], d[:4], d[:5], d[:5], d[:5], d[:10])
|
2005-09-17 22:51:26 +02:00
|
|
|
|
2005-01-14 23:50:36 +01:00
|
|
|
#loop through all the selected runs
|
|
|
|
for run in runs:
|
Major cleanup of the statistics handling code
util/stats/db.py:
Build a result object as the result of a query operation so it is
easier to populate and contains a bit more information than just
a big dict. Also change the next level data into a matrix instead
of a dict of dicts.
Move the "get" function into the Database object. (The get function
is used by the output parsing function as the interface for accessing
backend storage, same interface for profile stuff.)
Change the old get variable to the method variable, it describes how
the get works, (whether using sum, stdev, etc.)
util/stats/display.py:
Clean up the display functions, mostly formatting.
Handle values the way they should be now.
util/stats/info.py:
Totally re-work how values are accessed from their data store.
Access individual values on demand instead of calculating everything
and passing up a huge result from the bottom.
This impacts the way that proxying works, and in general, everything
is now esentially a proxy for the lower level database. Provide new
operators: unproxy, scalar, vector, value, values, total, and len which
retrieve the proper result from the object they are called on.
Move the ProxyGroup stuff (proxies of proxies!) here from the now gone
proxy.py file and integrate the shared parts of the code. The ProxyGroup
stuff allows you to write formulas without specifying the statistics
until evaluation time.
Get rid of global variables!
util/stats/output.py:
Move the dbinfo stuff into the Database itself. Each source should
have it's own get() function for accessing it's data.
This get() function behaves a bit differently than before in that it
can return vectors as well, deal with these vectors and with no result
conditions better.
util/stats/stats.py:
the info module no longer has the source global variable, just
create the database source and pass it around as necessary
--HG--
extra : convert_revision : 8e5aa228e5d3ae8068ef9c40f65b3a2f9e7c0cff
2005-10-21 22:29:13 +02:00
|
|
|
runTicks = source.retTicks([ run ])
|
2005-01-14 23:50:36 +01:00
|
|
|
#throw away the first one, it's 0
|
|
|
|
runTicks.pop(0)
|
Major cleanup of the statistics handling code
util/stats/db.py:
Build a result object as the result of a query operation so it is
easier to populate and contains a bit more information than just
a big dict. Also change the next level data into a matrix instead
of a dict of dicts.
Move the "get" function into the Database object. (The get function
is used by the output parsing function as the interface for accessing
backend storage, same interface for profile stuff.)
Change the old get variable to the method variable, it describes how
the get works, (whether using sum, stdev, etc.)
util/stats/display.py:
Clean up the display functions, mostly formatting.
Handle values the way they should be now.
util/stats/info.py:
Totally re-work how values are accessed from their data store.
Access individual values on demand instead of calculating everything
and passing up a huge result from the bottom.
This impacts the way that proxying works, and in general, everything
is now esentially a proxy for the lower level database. Provide new
operators: unproxy, scalar, vector, value, values, total, and len which
retrieve the proper result from the object they are called on.
Move the ProxyGroup stuff (proxies of proxies!) here from the now gone
proxy.py file and integrate the shared parts of the code. The ProxyGroup
stuff allows you to write formulas without specifying the statistics
until evaluation time.
Get rid of global variables!
util/stats/output.py:
Move the dbinfo stuff into the Database itself. Each source should
have it's own get() function for accessing it's data.
This get() function behaves a bit differently than before in that it
can return vectors as well, deal with these vectors and with no result
conditions better.
util/stats/stats.py:
the info module no longer has the source global variable, just
create the database source and pass it around as necessary
--HG--
extra : convert_revision : 8e5aa228e5d3ae8068ef9c40f65b3a2f9e7c0cff
2005-10-21 22:29:13 +02:00
|
|
|
source.ticks = runTicks
|
2005-01-20 00:40:02 +01:00
|
|
|
avg = 0
|
2005-01-18 19:25:55 +01:00
|
|
|
stdev = 0
|
|
|
|
numoutsideavg = 0
|
2005-01-18 19:34:58 +01:00
|
|
|
numoutside1std = 0
|
|
|
|
numoutside2std = 0
|
2005-01-20 00:40:02 +01:00
|
|
|
pairRunTicks = []
|
Major cleanup of the statistics handling code
util/stats/db.py:
Build a result object as the result of a query operation so it is
easier to populate and contains a bit more information than just
a big dict. Also change the next level data into a matrix instead
of a dict of dicts.
Move the "get" function into the Database object. (The get function
is used by the output parsing function as the interface for accessing
backend storage, same interface for profile stuff.)
Change the old get variable to the method variable, it describes how
the get works, (whether using sum, stdev, etc.)
util/stats/display.py:
Clean up the display functions, mostly formatting.
Handle values the way they should be now.
util/stats/info.py:
Totally re-work how values are accessed from their data store.
Access individual values on demand instead of calculating everything
and passing up a huge result from the bottom.
This impacts the way that proxying works, and in general, everything
is now esentially a proxy for the lower level database. Provide new
operators: unproxy, scalar, vector, value, values, total, and len which
retrieve the proper result from the object they are called on.
Move the ProxyGroup stuff (proxies of proxies!) here from the now gone
proxy.py file and integrate the shared parts of the code. The ProxyGroup
stuff allows you to write formulas without specifying the statistics
until evaluation time.
Get rid of global variables!
util/stats/output.py:
Move the dbinfo stuff into the Database itself. Each source should
have it's own get() function for accessing it's data.
This get() function behaves a bit differently than before in that it
can return vectors as well, deal with these vectors and with no result
conditions better.
util/stats/stats.py:
the info module no longer has the source global variable, just
create the database source and pass it around as necessary
--HG--
extra : convert_revision : 8e5aa228e5d3ae8068ef9c40f65b3a2f9e7c0cff
2005-10-21 22:29:13 +02:00
|
|
|
if value(stat, run.run) == 1e300*1e300:
|
2005-01-20 00:40:02 +01:00
|
|
|
continue
|
|
|
|
for t in range(0, len(runTicks)-(merge-1), merge):
|
|
|
|
tempPair = []
|
|
|
|
for p in range(0,merge):
|
|
|
|
tempPair.append(runTicks[t+p])
|
|
|
|
pairRunTicks.append(tempPair)
|
2005-01-14 23:50:36 +01:00
|
|
|
#loop through all the various ticks for each run
|
2005-01-20 00:40:02 +01:00
|
|
|
for tick in pairRunTicks:
|
Major cleanup of the statistics handling code
util/stats/db.py:
Build a result object as the result of a query operation so it is
easier to populate and contains a bit more information than just
a big dict. Also change the next level data into a matrix instead
of a dict of dicts.
Move the "get" function into the Database object. (The get function
is used by the output parsing function as the interface for accessing
backend storage, same interface for profile stuff.)
Change the old get variable to the method variable, it describes how
the get works, (whether using sum, stdev, etc.)
util/stats/display.py:
Clean up the display functions, mostly formatting.
Handle values the way they should be now.
util/stats/info.py:
Totally re-work how values are accessed from their data store.
Access individual values on demand instead of calculating everything
and passing up a huge result from the bottom.
This impacts the way that proxying works, and in general, everything
is now esentially a proxy for the lower level database. Provide new
operators: unproxy, scalar, vector, value, values, total, and len which
retrieve the proper result from the object they are called on.
Move the ProxyGroup stuff (proxies of proxies!) here from the now gone
proxy.py file and integrate the shared parts of the code. The ProxyGroup
stuff allows you to write formulas without specifying the statistics
until evaluation time.
Get rid of global variables!
util/stats/output.py:
Move the dbinfo stuff into the Database itself. Each source should
have it's own get() function for accessing it's data.
This get() function behaves a bit differently than before in that it
can return vectors as well, deal with these vectors and with no result
conditions better.
util/stats/stats.py:
the info module no longer has the source global variable, just
create the database source and pass it around as necessary
--HG--
extra : convert_revision : 8e5aa228e5d3ae8068ef9c40f65b3a2f9e7c0cff
2005-10-21 22:29:13 +02:00
|
|
|
source.ticks = tick
|
|
|
|
avg += value(stat, run.run)
|
2005-01-20 00:40:02 +01:00
|
|
|
avg /= len(pairRunTicks)
|
|
|
|
for tick in pairRunTicks:
|
Major cleanup of the statistics handling code
util/stats/db.py:
Build a result object as the result of a query operation so it is
easier to populate and contains a bit more information than just
a big dict. Also change the next level data into a matrix instead
of a dict of dicts.
Move the "get" function into the Database object. (The get function
is used by the output parsing function as the interface for accessing
backend storage, same interface for profile stuff.)
Change the old get variable to the method variable, it describes how
the get works, (whether using sum, stdev, etc.)
util/stats/display.py:
Clean up the display functions, mostly formatting.
Handle values the way they should be now.
util/stats/info.py:
Totally re-work how values are accessed from their data store.
Access individual values on demand instead of calculating everything
and passing up a huge result from the bottom.
This impacts the way that proxying works, and in general, everything
is now esentially a proxy for the lower level database. Provide new
operators: unproxy, scalar, vector, value, values, total, and len which
retrieve the proper result from the object they are called on.
Move the ProxyGroup stuff (proxies of proxies!) here from the now gone
proxy.py file and integrate the shared parts of the code. The ProxyGroup
stuff allows you to write formulas without specifying the statistics
until evaluation time.
Get rid of global variables!
util/stats/output.py:
Move the dbinfo stuff into the Database itself. Each source should
have it's own get() function for accessing it's data.
This get() function behaves a bit differently than before in that it
can return vectors as well, deal with these vectors and with no result
conditions better.
util/stats/stats.py:
the info module no longer has the source global variable, just
create the database source and pass it around as necessary
--HG--
extra : convert_revision : 8e5aa228e5d3ae8068ef9c40f65b3a2f9e7c0cff
2005-10-21 22:29:13 +02:00
|
|
|
source.ticks = tick
|
|
|
|
val = value(stat, run.run)
|
2005-01-18 19:25:55 +01:00
|
|
|
stdev += pow((val-avg),2)
|
2005-01-20 00:40:02 +01:00
|
|
|
stdev = math.sqrt(stdev / len(pairRunTicks))
|
|
|
|
for tick in pairRunTicks:
|
Major cleanup of the statistics handling code
util/stats/db.py:
Build a result object as the result of a query operation so it is
easier to populate and contains a bit more information than just
a big dict. Also change the next level data into a matrix instead
of a dict of dicts.
Move the "get" function into the Database object. (The get function
is used by the output parsing function as the interface for accessing
backend storage, same interface for profile stuff.)
Change the old get variable to the method variable, it describes how
the get works, (whether using sum, stdev, etc.)
util/stats/display.py:
Clean up the display functions, mostly formatting.
Handle values the way they should be now.
util/stats/info.py:
Totally re-work how values are accessed from their data store.
Access individual values on demand instead of calculating everything
and passing up a huge result from the bottom.
This impacts the way that proxying works, and in general, everything
is now esentially a proxy for the lower level database. Provide new
operators: unproxy, scalar, vector, value, values, total, and len which
retrieve the proper result from the object they are called on.
Move the ProxyGroup stuff (proxies of proxies!) here from the now gone
proxy.py file and integrate the shared parts of the code. The ProxyGroup
stuff allows you to write formulas without specifying the statistics
until evaluation time.
Get rid of global variables!
util/stats/output.py:
Move the dbinfo stuff into the Database itself. Each source should
have it's own get() function for accessing it's data.
This get() function behaves a bit differently than before in that it
can return vectors as well, deal with these vectors and with no result
conditions better.
util/stats/stats.py:
the info module no longer has the source global variable, just
create the database source and pass it around as necessary
--HG--
extra : convert_revision : 8e5aa228e5d3ae8068ef9c40f65b3a2f9e7c0cff
2005-10-21 22:29:13 +02:00
|
|
|
source.ticks = tick
|
|
|
|
val = value(stat, run.run)
|
2005-01-20 00:40:02 +01:00
|
|
|
if (val < (avg * .9)) or (val > (avg * 1.1)):
|
|
|
|
numoutsideavg += 1
|
2005-01-18 19:25:55 +01:00
|
|
|
if (val < (avg - stdev)) or (val > (avg + stdev)):
|
2005-01-18 19:34:58 +01:00
|
|
|
numoutside1std += 1
|
|
|
|
if (val < (avg - (2*stdev))) or (val > (avg + (2*stdev))):
|
|
|
|
numoutside2std += 1
|
2005-01-20 00:40:02 +01:00
|
|
|
if avg > 1000:
|
2005-09-17 22:51:26 +02:00
|
|
|
disp(run.name, "%.1f" % avg, "%.1f" % stdev,
|
|
|
|
"%d" % numoutsideavg, "%d" % numoutside1std,
|
|
|
|
"%d" % numoutside2std, "%d" % len(pairRunTicks),
|
|
|
|
"%.3f" % (stdev/avg*100))
|
2005-01-20 00:40:02 +01:00
|
|
|
elif avg > 100:
|
2005-09-17 22:51:26 +02:00
|
|
|
disp(run.name, "%.1f" % avg, "%.1f" % stdev,
|
|
|
|
"%d" % numoutsideavg, "%d" % numoutside1std,
|
|
|
|
"%d" % numoutside2std, "%d" % len(pairRunTicks),
|
|
|
|
"%.5f" % (stdev/avg*100))
|
2005-01-20 00:40:02 +01:00
|
|
|
else:
|
2005-09-17 22:51:26 +02:00
|
|
|
disp(run.name, "%.5f" % avg, "%.5f" % stdev,
|
|
|
|
"%d" % numoutsideavg, "%d" % numoutside1std,
|
|
|
|
"%d" % numoutside2std, "%d" % len(pairRunTicks),
|
|
|
|
"%.7f" % (stdev/avg*100))
|
2005-01-14 23:50:36 +01:00
|
|
|
return
|
|
|
|
|
2005-09-17 22:51:26 +02:00
|
|
|
if command == 'all':
|
|
|
|
if len(args):
|
2004-08-10 03:20:52 +02:00
|
|
|
raise CommandException
|
|
|
|
|
2005-11-23 03:20:36 +01:00
|
|
|
all = [ 'bps', 'misses', 'mpkb', 'ipkb', 'pps', 'bpt' ]
|
2005-09-17 22:51:26 +02:00
|
|
|
for command in all:
|
|
|
|
commands(options, command, args)
|
2004-08-10 03:20:52 +02:00
|
|
|
|
2005-09-17 22:51:26 +02:00
|
|
|
if options.ticks:
|
|
|
|
if not options.graph:
|
|
|
|
print 'only displaying sample %s' % options.ticks
|
Major cleanup of the statistics handling code
util/stats/db.py:
Build a result object as the result of a query operation so it is
easier to populate and contains a bit more information than just
a big dict. Also change the next level data into a matrix instead
of a dict of dicts.
Move the "get" function into the Database object. (The get function
is used by the output parsing function as the interface for accessing
backend storage, same interface for profile stuff.)
Change the old get variable to the method variable, it describes how
the get works, (whether using sum, stdev, etc.)
util/stats/display.py:
Clean up the display functions, mostly formatting.
Handle values the way they should be now.
util/stats/info.py:
Totally re-work how values are accessed from their data store.
Access individual values on demand instead of calculating everything
and passing up a huge result from the bottom.
This impacts the way that proxying works, and in general, everything
is now esentially a proxy for the lower level database. Provide new
operators: unproxy, scalar, vector, value, values, total, and len which
retrieve the proper result from the object they are called on.
Move the ProxyGroup stuff (proxies of proxies!) here from the now gone
proxy.py file and integrate the shared parts of the code. The ProxyGroup
stuff allows you to write formulas without specifying the statistics
until evaluation time.
Get rid of global variables!
util/stats/output.py:
Move the dbinfo stuff into the Database itself. Each source should
have it's own get() function for accessing it's data.
This get() function behaves a bit differently than before in that it
can return vectors as well, deal with these vectors and with no result
conditions better.
util/stats/stats.py:
the info module no longer has the source global variable, just
create the database source and pass it around as necessary
--HG--
extra : convert_revision : 8e5aa228e5d3ae8068ef9c40f65b3a2f9e7c0cff
2005-10-21 22:29:13 +02:00
|
|
|
source.ticks = [ int(x) for x in options.ticks.split() ]
|
2004-11-18 22:23:29 +01:00
|
|
|
|
2005-11-23 03:50:34 +01:00
|
|
|
from output import StatOutput
|
|
|
|
output = StatOutput(options.jobfile, source)
|
|
|
|
output.xlabel = 'System Configuration'
|
2004-08-10 03:20:52 +02:00
|
|
|
|
2005-09-17 22:51:26 +02:00
|
|
|
if command == 'stat' or command == 'formula':
|
|
|
|
if len(args) != 1:
|
2004-08-10 03:20:52 +02:00
|
|
|
raise CommandException
|
|
|
|
|
2005-09-17 22:51:26 +02:00
|
|
|
if command == 'stat':
|
Major cleanup of the statistics handling code
util/stats/db.py:
Build a result object as the result of a query operation so it is
easier to populate and contains a bit more information than just
a big dict. Also change the next level data into a matrix instead
of a dict of dicts.
Move the "get" function into the Database object. (The get function
is used by the output parsing function as the interface for accessing
backend storage, same interface for profile stuff.)
Change the old get variable to the method variable, it describes how
the get works, (whether using sum, stdev, etc.)
util/stats/display.py:
Clean up the display functions, mostly formatting.
Handle values the way they should be now.
util/stats/info.py:
Totally re-work how values are accessed from their data store.
Access individual values on demand instead of calculating everything
and passing up a huge result from the bottom.
This impacts the way that proxying works, and in general, everything
is now esentially a proxy for the lower level database. Provide new
operators: unproxy, scalar, vector, value, values, total, and len which
retrieve the proper result from the object they are called on.
Move the ProxyGroup stuff (proxies of proxies!) here from the now gone
proxy.py file and integrate the shared parts of the code. The ProxyGroup
stuff allows you to write formulas without specifying the statistics
until evaluation time.
Get rid of global variables!
util/stats/output.py:
Move the dbinfo stuff into the Database itself. Each source should
have it's own get() function for accessing it's data.
This get() function behaves a bit differently than before in that it
can return vectors as well, deal with these vectors and with no result
conditions better.
util/stats/stats.py:
the info module no longer has the source global variable, just
create the database source and pass it around as necessary
--HG--
extra : convert_revision : 8e5aa228e5d3ae8068ef9c40f65b3a2f9e7c0cff
2005-10-21 22:29:13 +02:00
|
|
|
stats = source.getStat(args[0])
|
2005-09-17 22:51:26 +02:00
|
|
|
if command == 'formula':
|
|
|
|
stats = eval(args[0])
|
2004-08-10 03:20:52 +02:00
|
|
|
|
2005-09-17 22:51:26 +02:00
|
|
|
for stat in stats:
|
|
|
|
output.stat = stat
|
2005-11-23 03:50:34 +01:00
|
|
|
output.ylabel = stat.name
|
|
|
|
if options.graph:
|
|
|
|
output.graph(stat.name, options.graphdir)
|
|
|
|
else:
|
|
|
|
output.display(stat.name, options.binned, options.printmode)
|
2004-08-10 03:20:52 +02:00
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
if len(args):
|
|
|
|
raise CommandException
|
|
|
|
|
Major cleanup of the statistics handling code
util/stats/db.py:
Build a result object as the result of a query operation so it is
easier to populate and contains a bit more information than just
a big dict. Also change the next level data into a matrix instead
of a dict of dicts.
Move the "get" function into the Database object. (The get function
is used by the output parsing function as the interface for accessing
backend storage, same interface for profile stuff.)
Change the old get variable to the method variable, it describes how
the get works, (whether using sum, stdev, etc.)
util/stats/display.py:
Clean up the display functions, mostly formatting.
Handle values the way they should be now.
util/stats/info.py:
Totally re-work how values are accessed from their data store.
Access individual values on demand instead of calculating everything
and passing up a huge result from the bottom.
This impacts the way that proxying works, and in general, everything
is now esentially a proxy for the lower level database. Provide new
operators: unproxy, scalar, vector, value, values, total, and len which
retrieve the proper result from the object they are called on.
Move the ProxyGroup stuff (proxies of proxies!) here from the now gone
proxy.py file and integrate the shared parts of the code. The ProxyGroup
stuff allows you to write formulas without specifying the statistics
until evaluation time.
Get rid of global variables!
util/stats/output.py:
Move the dbinfo stuff into the Database itself. Each source should
have it's own get() function for accessing it's data.
This get() function behaves a bit differently than before in that it
can return vectors as well, deal with these vectors and with no result
conditions better.
util/stats/stats.py:
the info module no longer has the source global variable, just
create the database source and pass it around as necessary
--HG--
extra : convert_revision : 8e5aa228e5d3ae8068ef9c40f65b3a2f9e7c0cff
2005-10-21 22:29:13 +02:00
|
|
|
from info import ProxyGroup
|
|
|
|
sim_seconds = source['sim_seconds']
|
|
|
|
proxy = ProxyGroup(system = source[options.system])
|
2005-09-17 22:51:26 +02:00
|
|
|
system = proxy.system
|
|
|
|
|
|
|
|
etherdev = system.tsunami.etherdev0
|
|
|
|
bytes = etherdev.rxBytes + etherdev.txBytes
|
|
|
|
kbytes = bytes / 1024
|
|
|
|
packets = etherdev.rxPackets + etherdev.txPackets
|
|
|
|
bps = etherdev.rxBandwidth + etherdev.txBandwidth
|
|
|
|
|
2005-11-23 03:50:34 +01:00
|
|
|
def display():
|
|
|
|
if options.graph:
|
|
|
|
output.graph(command, options.graphdir, proxy)
|
|
|
|
else:
|
|
|
|
output.display(command, options.binned, options.printmode)
|
2005-09-17 22:51:26 +02:00
|
|
|
|
2004-08-10 03:20:52 +02:00
|
|
|
if command == 'usertime':
|
|
|
|
import copy
|
2005-11-23 03:05:02 +01:00
|
|
|
user = copy.copy(system.run0.numCycles)
|
2004-08-10 03:20:52 +02:00
|
|
|
user.bins = 'user'
|
|
|
|
|
2005-11-23 03:05:02 +01:00
|
|
|
output.stat = user / system.run0.numCycles
|
2005-11-23 03:50:34 +01:00
|
|
|
output.ylabel = 'User Fraction'
|
2005-09-17 22:51:26 +02:00
|
|
|
|
|
|
|
display()
|
2004-08-10 03:20:52 +02:00
|
|
|
return
|
|
|
|
|
|
|
|
if command == 'ticks':
|
2005-11-23 03:05:02 +01:00
|
|
|
output.stat = system.run0.numCycles
|
|
|
|
output.binstats = [ system.run0.numCycles ]
|
2004-08-10 03:20:52 +02:00
|
|
|
|
2005-09-17 22:51:26 +02:00
|
|
|
display()
|
|
|
|
return
|
2004-08-10 03:20:52 +02:00
|
|
|
|
2005-09-17 22:51:26 +02:00
|
|
|
if command == 'bytes':
|
|
|
|
output.stat = bytes
|
|
|
|
display()
|
2004-08-10 03:20:52 +02:00
|
|
|
return
|
|
|
|
|
|
|
|
if command == 'packets':
|
2005-09-17 22:51:26 +02:00
|
|
|
output.stat = packets
|
|
|
|
display()
|
2004-08-10 03:20:52 +02:00
|
|
|
return
|
|
|
|
|
|
|
|
if command == 'ppt' or command == 'tpp':
|
2005-11-23 03:05:02 +01:00
|
|
|
output.stat = packets / system.run0.numCycles
|
2005-09-17 22:51:26 +02:00
|
|
|
output.invert = command == 'tpp'
|
|
|
|
display()
|
2004-08-10 03:20:52 +02:00
|
|
|
return
|
|
|
|
|
|
|
|
if command == 'pps':
|
2005-09-17 22:51:26 +02:00
|
|
|
output.stat = packets / sim_seconds
|
2005-11-23 03:50:34 +01:00
|
|
|
output.ylabel = 'Packets/s'
|
2005-09-17 22:51:26 +02:00
|
|
|
display()
|
2004-08-10 03:20:52 +02:00
|
|
|
return
|
|
|
|
|
|
|
|
if command == 'bpt' or command == 'tpb':
|
2005-11-23 03:05:02 +01:00
|
|
|
output.stat = bytes / system.run0.numCycles * 8
|
2005-11-23 03:50:34 +01:00
|
|
|
output.ylabel = 'bps / Hz'
|
2005-09-17 22:51:26 +02:00
|
|
|
output.invert = command == 'tpb'
|
|
|
|
display()
|
2004-08-10 03:20:52 +02:00
|
|
|
return
|
|
|
|
|
2005-11-23 03:05:02 +01:00
|
|
|
if command in ('rxbps', 'txbps', 'bps'):
|
|
|
|
if command == 'rxbps':
|
|
|
|
output.stat = etherdev.rxBandwidth / 1e9
|
|
|
|
if command == 'txbps':
|
|
|
|
output.stat = etherdev.txBandwidth / 1e9
|
|
|
|
if command == 'bps':
|
|
|
|
output.stat = bps / 1e9
|
2004-08-10 03:20:52 +02:00
|
|
|
|
2005-11-23 03:50:34 +01:00
|
|
|
output.ylabel = 'Bandwidth (Gbps)'
|
|
|
|
output.ylim = [ 0.0, 10.0 ]
|
2005-09-17 22:51:26 +02:00
|
|
|
display()
|
2004-08-10 03:20:52 +02:00
|
|
|
return
|
|
|
|
|
2005-09-17 22:51:26 +02:00
|
|
|
if command == 'bpp':
|
|
|
|
output.stat = bytes / packets
|
2005-11-23 03:50:34 +01:00
|
|
|
output.ylabel = 'Bytes / Packet'
|
2005-09-17 22:51:26 +02:00
|
|
|
display()
|
2004-08-10 03:20:52 +02:00
|
|
|
return
|
|
|
|
|
2005-09-17 22:51:26 +02:00
|
|
|
if command == 'rxbpp':
|
|
|
|
output.stat = etherdev.rxBytes / etherdev.rxPackets
|
2005-11-23 03:50:34 +01:00
|
|
|
output.ylabel = 'Receive Bytes / Packet'
|
2005-09-17 22:51:26 +02:00
|
|
|
display()
|
2004-08-10 03:20:52 +02:00
|
|
|
return
|
|
|
|
|
2005-09-17 22:51:26 +02:00
|
|
|
if command == 'txbpp':
|
|
|
|
output.stat = etherdev.txBytes / etherdev.txPackets
|
2005-11-23 03:50:34 +01:00
|
|
|
output.ylabel = 'Transmit Bytes / Packet'
|
2005-09-17 22:51:26 +02:00
|
|
|
display()
|
|
|
|
return
|
2004-08-10 03:20:52 +02:00
|
|
|
|
2005-09-17 22:51:26 +02:00
|
|
|
if command == 'rtp':
|
|
|
|
output.stat = etherdev.rxPackets / etherdev.txPackets
|
2005-11-23 03:50:34 +01:00
|
|
|
output.ylabel = 'rxPackets / txPackets'
|
2005-09-17 22:51:26 +02:00
|
|
|
display()
|
|
|
|
return
|
2004-08-10 03:20:52 +02:00
|
|
|
|
2005-09-17 22:51:26 +02:00
|
|
|
if command == 'rtb':
|
|
|
|
output.stat = etherdev.rxBytes / etherdev.txBytes
|
2005-11-23 03:50:34 +01:00
|
|
|
output.ylabel = 'rxBytes / txBytes'
|
2005-09-17 22:51:26 +02:00
|
|
|
display()
|
|
|
|
return
|
2004-08-10 03:20:52 +02:00
|
|
|
|
2005-09-17 22:51:26 +02:00
|
|
|
misses = system.l2.overall_mshr_misses
|
2004-08-10 03:20:52 +02:00
|
|
|
|
2005-09-17 22:51:26 +02:00
|
|
|
if command == 'misses':
|
|
|
|
output.stat = misses
|
2005-11-23 03:50:34 +01:00
|
|
|
output.ylabel = 'Overall MSHR Misses'
|
2005-09-17 22:51:26 +02:00
|
|
|
display()
|
2004-08-10 03:20:52 +02:00
|
|
|
return
|
|
|
|
|
|
|
|
if command == 'mpkb':
|
2005-09-17 22:51:26 +02:00
|
|
|
output.stat = misses / (bytes / 1024)
|
|
|
|
output.binstats = [ misses ]
|
2005-11-23 03:50:34 +01:00
|
|
|
output.ylabel = 'Misses / KB'
|
2005-09-17 22:51:26 +02:00
|
|
|
display()
|
2004-08-10 03:20:52 +02:00
|
|
|
return
|
|
|
|
|
2004-11-18 22:23:29 +01:00
|
|
|
if command == 'ipkb':
|
2005-11-23 03:05:02 +01:00
|
|
|
interrupts = system.run0.kern.faults[4]
|
2005-09-17 22:51:26 +02:00
|
|
|
output.stat = interrupts / kbytes
|
|
|
|
output.binstats = [ interrupts ]
|
2005-11-23 03:50:34 +01:00
|
|
|
output.ylabel = 'Interrupts / KB'
|
2005-09-17 22:51:26 +02:00
|
|
|
display()
|
2004-11-18 22:23:29 +01:00
|
|
|
return
|
|
|
|
|
2004-08-10 03:20:52 +02:00
|
|
|
if command == 'execute':
|
2005-11-23 03:05:02 +01:00
|
|
|
output.stat = system.run0.ISSUE__count
|
2005-09-17 22:51:26 +02:00
|
|
|
display()
|
2004-08-10 03:20:52 +02:00
|
|
|
return
|
|
|
|
|
|
|
|
if command == 'commit':
|
2005-11-23 03:05:02 +01:00
|
|
|
output.stat = system.run0.COM__count
|
2005-09-17 22:51:26 +02:00
|
|
|
display()
|
2004-08-10 03:20:52 +02:00
|
|
|
return
|
|
|
|
|
|
|
|
if command == 'fetch':
|
2005-11-23 03:05:02 +01:00
|
|
|
output.stat = system.run0.FETCH__count
|
2005-09-17 22:51:26 +02:00
|
|
|
display()
|
2004-08-10 03:20:52 +02:00
|
|
|
return
|
|
|
|
|
|
|
|
raise CommandException
|
|
|
|
|
|
|
|
|
|
|
|
class Options: pass
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
import getpass
|
2005-09-17 22:51:26 +02:00
|
|
|
from jobfile import JobFile
|
2004-08-10 03:20:52 +02:00
|
|
|
|
|
|
|
options = Options()
|
2005-09-17 22:51:26 +02:00
|
|
|
options.host = None
|
2004-08-10 03:20:52 +02:00
|
|
|
options.db = None
|
|
|
|
options.passwd = ''
|
|
|
|
options.user = getpass.getuser()
|
|
|
|
options.runs = None
|
|
|
|
options.system = 'client'
|
Major cleanup of the statistics handling code
util/stats/db.py:
Build a result object as the result of a query operation so it is
easier to populate and contains a bit more information than just
a big dict. Also change the next level data into a matrix instead
of a dict of dicts.
Move the "get" function into the Database object. (The get function
is used by the output parsing function as the interface for accessing
backend storage, same interface for profile stuff.)
Change the old get variable to the method variable, it describes how
the get works, (whether using sum, stdev, etc.)
util/stats/display.py:
Clean up the display functions, mostly formatting.
Handle values the way they should be now.
util/stats/info.py:
Totally re-work how values are accessed from their data store.
Access individual values on demand instead of calculating everything
and passing up a huge result from the bottom.
This impacts the way that proxying works, and in general, everything
is now esentially a proxy for the lower level database. Provide new
operators: unproxy, scalar, vector, value, values, total, and len which
retrieve the proper result from the object they are called on.
Move the ProxyGroup stuff (proxies of proxies!) here from the now gone
proxy.py file and integrate the shared parts of the code. The ProxyGroup
stuff allows you to write formulas without specifying the statistics
until evaluation time.
Get rid of global variables!
util/stats/output.py:
Move the dbinfo stuff into the Database itself. Each source should
have it's own get() function for accessing it's data.
This get() function behaves a bit differently than before in that it
can return vectors as well, deal with these vectors and with no result
conditions better.
util/stats/stats.py:
the info module no longer has the source global variable, just
create the database source and pass it around as necessary
--HG--
extra : convert_revision : 8e5aa228e5d3ae8068ef9c40f65b3a2f9e7c0cff
2005-10-21 22:29:13 +02:00
|
|
|
options.method = None
|
2004-09-10 20:34:23 +02:00
|
|
|
options.binned = False
|
|
|
|
options.graph = False
|
2005-01-14 05:59:39 +01:00
|
|
|
options.ticks = False
|
2005-09-17 22:51:26 +02:00
|
|
|
options.printmode = 'G'
|
2005-10-19 01:17:36 +02:00
|
|
|
jobfilename = 'Test.py'
|
2005-09-17 22:51:26 +02:00
|
|
|
options.jobfile = None
|
|
|
|
options.all = False
|
2004-08-10 03:20:52 +02:00
|
|
|
|
Major cleanup of the statistics handling code
util/stats/db.py:
Build a result object as the result of a query operation so it is
easier to populate and contains a bit more information than just
a big dict. Also change the next level data into a matrix instead
of a dict of dicts.
Move the "get" function into the Database object. (The get function
is used by the output parsing function as the interface for accessing
backend storage, same interface for profile stuff.)
Change the old get variable to the method variable, it describes how
the get works, (whether using sum, stdev, etc.)
util/stats/display.py:
Clean up the display functions, mostly formatting.
Handle values the way they should be now.
util/stats/info.py:
Totally re-work how values are accessed from their data store.
Access individual values on demand instead of calculating everything
and passing up a huge result from the bottom.
This impacts the way that proxying works, and in general, everything
is now esentially a proxy for the lower level database. Provide new
operators: unproxy, scalar, vector, value, values, total, and len which
retrieve the proper result from the object they are called on.
Move the ProxyGroup stuff (proxies of proxies!) here from the now gone
proxy.py file and integrate the shared parts of the code. The ProxyGroup
stuff allows you to write formulas without specifying the statistics
until evaluation time.
Get rid of global variables!
util/stats/output.py:
Move the dbinfo stuff into the Database itself. Each source should
have it's own get() function for accessing it's data.
This get() function behaves a bit differently than before in that it
can return vectors as well, deal with these vectors and with no result
conditions better.
util/stats/stats.py:
the info module no longer has the source global variable, just
create the database source and pass it around as necessary
--HG--
extra : convert_revision : 8e5aa228e5d3ae8068ef9c40f65b3a2f9e7c0cff
2005-10-21 22:29:13 +02:00
|
|
|
opts, args = getopts(sys.argv[1:], '-BEFJad:g:h:j:m:pr:s:u:T:')
|
2004-08-10 03:20:52 +02:00
|
|
|
for o,a in opts:
|
|
|
|
if o == '-B':
|
|
|
|
options.binned = True
|
|
|
|
if o == '-E':
|
2005-09-17 22:51:26 +02:00
|
|
|
options.printmode = 'E'
|
2004-08-10 03:20:52 +02:00
|
|
|
if o == '-F':
|
2005-09-17 22:51:26 +02:00
|
|
|
options.printmode = 'F'
|
|
|
|
if o == '-a':
|
|
|
|
options.all = True
|
2004-08-10 03:20:52 +02:00
|
|
|
if o == '-d':
|
|
|
|
options.db = a
|
|
|
|
if o == '-g':
|
2005-09-17 22:51:26 +02:00
|
|
|
options.graph = True;
|
|
|
|
options.graphdir = a
|
2004-08-10 03:20:52 +02:00
|
|
|
if o == '-h':
|
|
|
|
options.host = a
|
2005-10-19 01:17:36 +02:00
|
|
|
if o == '-J':
|
|
|
|
jobfilename = None
|
2005-09-17 22:51:26 +02:00
|
|
|
if o == '-j':
|
2005-10-19 01:17:36 +02:00
|
|
|
jobfilename = a
|
Major cleanup of the statistics handling code
util/stats/db.py:
Build a result object as the result of a query operation so it is
easier to populate and contains a bit more information than just
a big dict. Also change the next level data into a matrix instead
of a dict of dicts.
Move the "get" function into the Database object. (The get function
is used by the output parsing function as the interface for accessing
backend storage, same interface for profile stuff.)
Change the old get variable to the method variable, it describes how
the get works, (whether using sum, stdev, etc.)
util/stats/display.py:
Clean up the display functions, mostly formatting.
Handle values the way they should be now.
util/stats/info.py:
Totally re-work how values are accessed from their data store.
Access individual values on demand instead of calculating everything
and passing up a huge result from the bottom.
This impacts the way that proxying works, and in general, everything
is now esentially a proxy for the lower level database. Provide new
operators: unproxy, scalar, vector, value, values, total, and len which
retrieve the proper result from the object they are called on.
Move the ProxyGroup stuff (proxies of proxies!) here from the now gone
proxy.py file and integrate the shared parts of the code. The ProxyGroup
stuff allows you to write formulas without specifying the statistics
until evaluation time.
Get rid of global variables!
util/stats/output.py:
Move the dbinfo stuff into the Database itself. Each source should
have it's own get() function for accessing it's data.
This get() function behaves a bit differently than before in that it
can return vectors as well, deal with these vectors and with no result
conditions better.
util/stats/stats.py:
the info module no longer has the source global variable, just
create the database source and pass it around as necessary
--HG--
extra : convert_revision : 8e5aa228e5d3ae8068ef9c40f65b3a2f9e7c0cff
2005-10-21 22:29:13 +02:00
|
|
|
if o == '-m':
|
|
|
|
options.method = a
|
2004-08-10 03:20:52 +02:00
|
|
|
if o == '-p':
|
|
|
|
options.passwd = getpass.getpass()
|
|
|
|
if o == '-r':
|
|
|
|
options.runs = a
|
|
|
|
if o == '-u':
|
|
|
|
options.user = a
|
|
|
|
if o == '-s':
|
|
|
|
options.system = a
|
2005-01-14 05:59:39 +01:00
|
|
|
if o == '-T':
|
|
|
|
options.ticks = a
|
2004-08-10 03:20:52 +02:00
|
|
|
|
2005-10-19 01:17:36 +02:00
|
|
|
if jobfilename:
|
|
|
|
options.jobfile = JobFile(jobfilename)
|
2005-09-17 22:51:26 +02:00
|
|
|
if not options.host:
|
|
|
|
options.host = options.jobfile.dbhost
|
|
|
|
if not options.db:
|
|
|
|
options.db = options.jobfile.statdb
|
|
|
|
|
|
|
|
if not options.host:
|
|
|
|
sys.exit('Database server must be provided from a jobfile or -h')
|
|
|
|
|
|
|
|
if not options.db:
|
|
|
|
sys.exit('Database name must be provided from a jobfile or -d')
|
|
|
|
|
2004-08-10 03:20:52 +02:00
|
|
|
if len(args) == 0:
|
|
|
|
usage()
|
|
|
|
|
|
|
|
command = args[0]
|
|
|
|
args = args[1:]
|
|
|
|
|
|
|
|
try:
|
|
|
|
commands(options, command, args)
|
|
|
|
except CommandException:
|
|
|
|
usage()
|