scripts/grabGLRMJenkinRunResults.py
def main(argv):
    """
    Main program.

    @return: none
    """
    global g_log_base_dir
    global g_airline_java
    global g_milsongs_java
    global g_airline_python
    global g_milsongs_python

    if len(argv) < 2:
        print "python grabGLRMrunLogs logsBaseDirectory\n"
        sys.exit(1)
    else:   # we may be in business
        g_log_base_dir = argv[1]

        if (os.path.isdir(g_log_base_dir)):     # open directory and start to process logs in each one
            airline_java_dict = init_java_dict()
            milsongs_java_dict = init_java_dict()
            airline_py_dict = init_python_dict()
            milsongs_py_dict = init_python_dict()

            allBuilds = os.listdir(g_log_base_dir)
            for dirName in allBuilds:
                airline_java_dict = grab_java_results(dirName, g_airline_java, airline_java_dict)
                milsongs_java_dict = grab_java_results(dirName, g_milsongs_java, milsongs_java_dict)
                airline_py_dict = grab_py_results(dirName, g_airline_python, airline_py_dict)
                milsongs_py_dict = grab_py_results(dirName, g_milsongs_python, milsongs_py_dict)

        airline_py_dict = transform_time_python(airline_py_dict)    # calculate time taken per iteration
        milsongs_py_dict = transform_time_python(milsongs_py_dict)

        print("Airline Java log results: \n {0}".format(airline_java_dict))
        print("Airline Python log results: \n {0}".format(airline_py_dict))
        print("Milsongs Java log results: \n {0}".format(milsongs_java_dict))
        print("Milsongs Python log results: \n {0}".format(milsongs_py_dict))

        # dump dictionary into json files for later analysis
        with open(os.path.join(g_log_base_dir, "airline_java_dict"),'wb') as test_file:
            json.dump(airline_java_dict, test_file)

        with open(os.path.join(g_log_base_dir, "airline_py_dict"),'wb') as test_file:
            json.dump(airline_py_dict, test_file)

        with open(os.path.join(g_log_base_dir, "milsongs_java_dict"),'wb') as test_file:
            json.dump(milsongs_java_dict, test_file)

        with open(os.path.join(g_log_base_dir, "milsongs_py_dict"),'wb') as test_file:
            json.dump(milsongs_py_dict, test_file)

        # dump analysis results into json format that octave can understand and process
        generate_octave_java_ascii(airline_java_dict, "airline_java_octave")
        generate_octave_java_ascii(milsongs_java_dict, "milsongs_java_octave")
        generate_octave_py_ascii(airline_py_dict, "airline_py_octave")
        generate_octave_py_ascii(milsongs_py_dict, "milsongs_py_octave")
def main(argv):
    """
    Main program.

    @return: none
    """
    global g_log_base_dir
    global g_airline_java
    global g_milsongs_java
    global g_airline_python
    global g_milsongs_python

    if len(argv) < 2:
        print "python grabGLRMrunLogs logsBaseDirectory\n"
        sys.exit(1)
    else:   # we may be in business
        g_log_base_dir = argv[1]

        if (os.path.isdir(g_log_base_dir)):     # open directory and start to process logs in each one
            airline_java_dict = init_java_dict()
            milsongs_java_dict = init_java_dict()
            airline_py_dict = init_python_dict()
            milsongs_py_dict = init_python_dict()

            allBuilds = os.listdir(g_log_base_dir)
            for dirName in allBuilds:
                airline_java_dict = grab_java_results(dirName, g_airline_java, airline_java_dict)
                milsongs_java_dict = grab_java_results(dirName, g_milsongs_java, milsongs_java_dict)
                airline_py_dict = grab_py_results(dirName, g_airline_python, airline_py_dict)
                milsongs_py_dict = grab_py_results(dirName, g_milsongs_python, milsongs_py_dict)

        airline_py_dict = transform_time_python(airline_py_dict)    # calculate time taken per iteration
        milsongs_py_dict = transform_time_python(milsongs_py_dict)

        print("Airline Java log results: \n {0}".format(airline_java_dict))
        print("Airline Python log results: \n {0}".format(airline_py_dict))
        print("Milsongs Java log results: \n {0}".format(milsongs_java_dict))
        print("Milsongs Python log results: \n {0}".format(milsongs_py_dict))

        # dump dictionary into json files for later analysis
        with open(os.path.join(g_log_base_dir, "airline_java_dict"),'wb') as test_file:
            json.dump(airline_java_dict, test_file)

        with open(os.path.join(g_log_base_dir, "airline_py_dict"),'wb') as test_file:
            json.dump(airline_py_dict, test_file)

        with open(os.path.join(g_log_base_dir, "milsongs_java_dict"),'wb') as test_file:
            json.dump(milsongs_java_dict, test_file)

        with open(os.path.join(g_log_base_dir, "milsongs_py_dict"),'wb') as test_file:
            json.dump(milsongs_py_dict, test_file)

        # dump analysis results into json format that octave can understand and process
        generate_octave_java_ascii(airline_java_dict, "airline_java_octave")
        generate_octave_java_ascii(milsongs_java_dict, "milsongs_java_octave")
        generate_octave_py_ascii(airline_py_dict, "airline_py_octave")
        generate_octave_py_ascii(milsongs_py_dict, "milsongs_py_octave")
def main ( argv ) : global g_log_base_dir global g_airline_java global g_milsongs_java global g_airline_python global g_milsongs_python if len ( argv ) < 2 : print "python grabGLRMrunLogs logsBaseDirectory\n" sys . exit ( 1 ) else : # we may be in business g_log_base_dir = argv [ 1 ] if ( os . path . isdir ( g_log_base_dir ) ) : # open directory and start to process logs in each one airline_java_dict = init_java_dict ( ) milsongs_java_dict = init_java_dict ( ) airline_py_dict = init_python_dict ( ) milsongs_py_dict = init_python_dict ( ) allBuilds = os . listdir ( g_log_base_dir ) for dirName in allBuilds : airline_java_dict = grab_java_results ( dirName , g_airline_java , airline_java_dict ) milsongs_java_dict = grab_java_results ( dirName , g_milsongs_java , milsongs_java_dict ) airline_py_dict = grab_py_results ( dirName , g_airline_python , airline_py_dict ) milsongs_py_dict = grab_py_results ( dirName , g_milsongs_python , milsongs_py_dict ) airline_py_dict = transform_time_python ( airline_py_dict ) # calculate time taken per iteration milsongs_py_dict = transform_time_python ( milsongs_py_dict ) print ( "Airline Java log results: \n {0}" . format ( airline_java_dict ) ) print ( "Airline Python log results: \n {0}" . format ( airline_py_dict ) ) print ( "Milsongs Java log results: \n {0}" . format ( milsongs_java_dict ) ) print ( "Milsongs Python log results: \n {0}" . format ( milsongs_py_dict ) ) # dump dictionary into json files for later analysis with open ( os . path . join ( g_log_base_dir , "airline_java_dict" ) , 'wb' ) as test_file : json . dump ( airline_java_dict , test_file ) with open ( os . path . join ( g_log_base_dir , "airline_py_dict" ) , 'wb' ) as test_file : json . dump ( airline_py_dict , test_file ) with open ( os . path . join ( g_log_base_dir , "milsongs_java_dict" ) , 'wb' ) as test_file : json . dump ( milsongs_java_dict , test_file ) with open ( os . path . join ( g_log_base_dir , "milsongs_py_dict" ) , 'wb' ) as test_file : json . dump ( milsongs_py_dict , test_file ) # dump analysis results into json format that octave can understand and process generate_octave_java_ascii ( airline_java_dict , "airline_java_octave" ) generate_octave_java_ascii ( milsongs_java_dict , "milsongs_java_octave" ) generate_octave_py_ascii ( airline_py_dict , "airline_py_octave" ) generate_octave_py_ascii ( milsongs_py_dict , "milsongs_py_octave" )
Main program.

    @return: none
Main program .