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)
            sess.isTestRun = 1
            helper.appendData(sess, csvExtra)
            helper.storeInDatabase(sess)

            fits = p.fitsProfile(sess)
            sim = p.similarity(fits)
            metricValue = p.similarity(fits)
            matrix.addFitsVector(fits)
def getAllRevisions():
    s = SessionHelper(config)
    revs = s.getAllRevisions(config['testname'])
    return revs
import sys
import os
from gumby.settings import loadConfig
from gumby.spectraperf.performanceprofile import SessionHelper

if __name__ == '__main__':

    if len(sys.argv) < 5:
        print "Usage: python store_run_in_database.py configFile csvPath revision testcase"
        sys.exit(0)

    config = loadConfig(os.path.abspath(sys.argv[1]))

    # DATABASE = os.path.abspath("../database/performance.db")
    print "Setting database: %s " % config['spectraperf_db_path']
    DATABASE = os.path.abspath(config['spectraperf_db_path'])

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

    if not os.path.isfile(csvPath):
        print "Not a valid CSV file"
        sys.exit(0)

    helper = SessionHelper(config)
    sess1 = helper.loadSessionFromCSV(revision, testcase, csvPath)
    helper.appendData(sess1, csvPath.replace("summary_per_stacktrace.csv", "summary.txt"))
    helper.storeInDatabase(sess1)
    print "Run stored"
Beispiel #4
0
from gumby.settings import loadConfig
from gumby.spectraperf.performanceprofile import SessionHelper, Profile, ProfileHelper

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
import os
from gumby.settings import loadConfig
from gumby.spectraperf.performanceprofile import SessionHelper

if __name__ == '__main__':

    if len(sys.argv) < 5:
        print "Usage: python store_run_in_database.py configFile csvPath revision testcase"
        sys.exit(0)

    config = loadConfig(os.path.abspath(sys.argv[1]))

    # DATABASE = os.path.abspath("../database/performance.db")
    print "Setting database: %s " % config['spectraperf_db_path']
    DATABASE = os.path.abspath(config['spectraperf_db_path'])

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

    if not os.path.isfile(csvPath):
        print "Not a valid CSV file"
        sys.exit(0)

    helper = SessionHelper(config)
    sess1 = helper.loadSessionFromCSV(revision, testcase, csvPath)
    helper.appendData(
        sess1, csvPath.replace("summary_per_stacktrace.csv", "summary.txt"))
    helper.storeInDatabase(sess1)
    print "Run stored"
Beispiel #6
0
from gumby.spectraperf.performanceprofile import SessionHelper, Profile, ProfileHelper


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
from gumby.spectraperf.performanceprofile import SessionHelper, Profile, ProfileHelper


if __name__ == '__main__':

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

    config = loadConfig(sys.argv[1])

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

    helper = SessionHelper(config)
    # get all revisions in the database for this testcase
    revs = helper.getAllRevisions(testcase)

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

        p = Profile(r, testcase, config)
        for s in sessions:
            print "adding session to profile for %s " % r
            p.addSession(s)
Beispiel #8
0
from gumby.settings import loadConfig
from gumby.spectraperf.performanceprofile import SessionHelper, Profile, ProfileHelper

if __name__ == '__main__':

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

    config = loadConfig(sys.argv[1])

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

    helper = SessionHelper(config)
    # get all revisions in the database for this testcase
    revs = helper.getAllRevisions(testcase)

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

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