Ejemplo n.º 1
0
if __name__ == '__main__':

    if len(sys.argv) < 3:
        print "This script will generate the profile for a revision for a testcase."
        print "Usage: python generate_profile_batch.py configFile revision testcase"
        sys.exit(0)

    config = loadConfig(sys.argv[1])

    revision = sys.argv[2]
    testcase = sys.argv[3]

    helper = SessionHelper(config)

    # build profile
    # load all sessions for this revision and testcase
    sessions = helper.loadFromDatabase(revision, testcase)
    if len(sessions) == 0:
        print "No sessions found."
        sys.exit(0)

    p = Profile(revision, testcase, config)
    for s in sessions:
        print "adding session to profile for %s " % revision
        p.addSession(s)

    profileHelper = ProfileHelper(config)
    print "Saving profile for: %s" % revision
    profileHelper.storeInDatabase(p)
    config = loadConfig(sys.argv[1])
    csvPath = sys.argv[2]
    rev = sys.argv[3]
    testcase = sys.argv[4]

    h = MatrixHelper(config)
    i = 0

    print "revision: %s" % rev
    prevRevision = h.getPreviousRevision(rev)
    print "previous revision: %s" % prevRevision
    print "__________________"

    # load profile for revision and testcase
    profileHelper = ProfileHelper(config)
    p = profileHelper.loadFromDatabase(prevRevision, testcase)

    if p != -1:
        output = ""

        matrix = ActivityMatrix(p.getDatabaseId(), 5, Type.BYTESWRITTEN, rev, testcase)

        for i in range(1, 6):
            helper = SessionHelper(config)
            csv = "%s/report_%s_%d/summary_per_stacktrace.csv" % (csvPath, rev, i)
            csvExtra = "%s/report_%s_%d/summary.txt" % (csvPath, rev, i)
            if not os.path.isfile(csv):
                print "Not a valid CSV file: %s" % csv
                continue
            sess = helper.loadSessionFromCSV(rev, testcase, csv)
Ejemplo n.º 3
0
if __name__ == '__main__':

    if len(sys.argv) < 3:
        print "This script will generate the profile for a revision for a testcase."
        print "Usage: python generate_profile_batch.py configFile revision testcase"
        sys.exit(0)

    config = loadConfig(sys.argv[1])

    revision = sys.argv[2]
    testcase = sys.argv[3]

    helper = SessionHelper(config)

    # build profile
    # load all sessions for this revision and testcase
    sessions = helper.loadFromDatabase(revision, testcase)
    if len(sessions) == 0:
        print "No sessions found."
        sys.exit(0)

    p = Profile(revision, testcase, config)
    for s in sessions:
        print "adding session to profile for %s " % revision
        p.addSession(s)

    profileHelper = ProfileHelper(config)
    print "Saving profile for: %s" % revision
    profileHelper.storeInDatabase(p)