Beispiel #1
0
    def __init__(self):

        self.anime = Animation()

        host = ''  # Bind server to all interfaces
        self.s = socket.socket(
            socket.AF_INET,
            socket.SOCK_DGRAM)  # Creating the socket using IPv4, UDP
        self.s.bind(
            (host,
             PORT))  # Binding Server to all interfaces and the chosen port.

        self.setup_tool = SetupTool()
        self.paths = self.setup_tool.parse_file('../config/paths.dat')
        self.setup_tool.get_setup_data('../config/session-setup.dat')

        self.clients_list = self.setup_tool.get_clients_list()

        self.query_type = self.setup_tool.get_query_type().split()
        self.repetitions = int(self.setup_tool.get_repetitions())

        fLog = open(
            self.paths['LOG_FOLDER_PATH'] + 'enum-bench-tool-master.log', 'w')
        fLog.close()

        # Refreshing results folder and temp folder
        for s in self.setup_tool.get_scenario_list():
            self.setup_tool.refresh_folder(self.setup_tool.get_save_dir() +
                                           self.setup_tool.get_session_name() +
                                           '/' + s + '/')
        self.setup_tool.refresh_folder(self.paths['TEMP_FOLDER_PATH'])
 def __init__ (self):
     
     setup = SetupTool()
     self.paths = setup.parse_file('../config/paths.dat')
     
     # Refresh import.sql file
     setup.refresh_file(self.paths['PDNS_OUTPUT_FOLDER_PATH'] + 'import.sql')
      
     self.fSql = open (self.paths['PDNS_OUTPUT_FOLDER_PATH'] + 'import.sql', 'a') 
     self.domainCounter = 0
Beispiel #3
0
    def __init__(self):
        """Initializing the configurations at "Client" """ 
        self.setup_tool = SetupTool()        
        self.paths = self.setup_tool.parse_file('../config/paths.dat')
          
        host = ''                                                             # Bind server to all interfaces
        self.s = socket.socket (socket.AF_INET, socket.SOCK_DGRAM)            # Creating the socket using IPv4, UDP
        self.s.bind((host, PORT))                                             # Binding Server to all interfaces and the chosen port.


        fLog = open(self.paths['LOG_FOLDER_PATH'] + 'enum-bench-tool-client.log', 'w')
        fLog.close()
    def __init__ (self):
        
        self.setup = SetupTool()
        self.paths = self.setup.parse_file('../config/paths.dat')
        self.setup.get_setup_data('../config/result-parser-setup.dat')

        y_axis = []
        y_axis.append((self.setup.throughput(), self.setup.get_throughput_label(), self.setup.get_throughput_plot_name(), 4))
        y_axis.append((self.setup.latency_mean(), self.setup.get_latency_mean_label(), self.setup.get_latency_mean_plot_name(), 5))
        y_axis.append((self.setup.network(), self.setup.get_network_label(), self.setup.get_network_plot_name(), 8))
        
        n = 0
        for p in self.setup.get_cpu_utilization_processes_list():
            y_axis.append((self.setup.cpu_utilization(),
                           self.setup.get_cpu_utilization_label(),
                           self.setup.get_cpu_utilization_plot_name() + '-' + p,
                           7 + n))
            n += 2
        

        print '>> Starting plot process...'                
        for i in self.setup.get_session_list():
            for j in self.setup.get_plot_list():
                call(['mkdir', '-p', self.setup.get_img_dir() + i + '/' + j])
                call(['mkdir', '-p', self.setup.get_gp_dir() + i + '/' + j])
                if j.startswith('a') or j.startswith('n'):
                    for q in range(len(y_axis)):
                        if y_axis[q][0]:
                            f_gp = open(self.setup.get_gp_dir() + i + '/' + j + '/' + y_axis[q][2] + '.gp', 'w')
                            if self.setup.get_plot_format() == 'eps':
                                f_gp.write('set terminal postscript eps color enhanced\n')
                            else:
                                f_gp.write('set terminal ' + self.setup.get_plot_format() + '\n') 
                            f_gp.write('set encoding utf8\n' + 
                                       'set output "' + self.setup.get_img_dir() + i + '/' + j + '/' + y_axis[q][2] + '-' + i + '-' + j + '.' + self.setup.get_plot_format() + '"\n' + 
                                       'set grid\n' + 
                                       'set xtics auto\n' + 
                                       'set ytics auto\n' + 
                                       'set mxtics 5\n' + 
                                       'set mytics 5\n' + 
                                       'set xlabel "' + self.setup.get_label_x_axis() + '"\n' + 
                                       'set ylabel "' + y_axis[q][1] + '"\n' + 
                                       'set key bottom\n')
                            for k in self.setup.get_curves_list():
                                f_gp.write('set style line ' + str(self.setup.get_curves_list().index(k) + 1) + ' lt 1 lw 2 lc rgb "' + self.setup.get_curves_colors()[self.setup.get_curves_list().index(k)] + '"\n')
                            f_gp.write('plot ')
                            for k in self.setup.get_curves_list():
                                if k == self.setup.get_curves_list()[-1]:
                                    f_gp.write('"' + self.setup.get_data_dir() + i + '/' + k + '/' + j + '/stats.dat' + 
                                               '" u 1:' + str(y_axis[q][3]) + ' title "' + 
                                               self.setup.get_curves_labels()[self.setup.get_curves_list().index(k)] + 
                                               '" w lp ls ' + str(self.setup.get_curves_list().index(k) + 1))
                                else:
                                    f_gp.write('"' + self.setup.get_data_dir() + i + '/' + k + '/' + j + '/stats.dat' + 
                                               '" u 1:' + str(y_axis[q][3]) + ' title "' + 
                                               self.setup.get_curves_labels()[self.setup.get_curves_list().index(k)] + 
                                               '" w lp ls ' + str(self.setup.get_curves_list().index(k) + 1) + ', \\\n')
                            f_gp.close()
                            call(['gnuplot', self.setup.get_gp_dir() + i + '/' + j + '/' + y_axis[q][2] + '.gp'])
                else:
                    for q in range(len(y_axis)):
                        if y_axis[q][0]:
                            f_gp = open(self.setup.get_gp_dir() + i + '/' + j + '/' + y_axis[q][2] + '.gp', 'w')
                            if self.setup.get_plot_format() == 'eps':
                                f_gp.write('set terminal postscript eps color enhanced\n')
                            else:
                                f_gp.write('set terminal ' + self.setup.get_plot_format() + '\n') 
                            f_gp.write('set encoding utf8\n' + 
                                       'set output "' + self.setup.get_img_dir() + i + '/' + j + '/' + y_axis[q][2] + '-' + i + '-' + j + '.' + self.setup.get_plot_format() + '"\n' + 
                                       'set grid\n' + 
                                       'set xtic auto\n' + 
                                       'set ytic auto\n' + 
                                       'set mxtics 5\n' + 
                                       'set mytics 5\n' + 
                                       'set xlabel "' + self.setup.get_label_x_axis() + '"\n' + 
                                       'set ylabel "' + y_axis[q][1] + '"\n' + 
                                       'set key bottom\n')
                            for k in self.setup.get_curves_list():
                                f_gp.write('set style line ' + str(self.setup.get_curves_list().index(k) + 1) + ' lt 1 lw 2 lc rgb "' + self.setup.get_curves_colors()[self.setup.get_curves_list().index(k)] + '"\n')
                            f_gp.write('plot ')
                            for k in self.setup.get_curves_list():
                                if k == self.setup.get_curves_list()[-1]:
                                    f_gp.write('"' + self.setup.get_data_dir() + i + '/' + j + '/' + k + '/stats.dat' + 
                                               '" u 1:' + str(y_axis[q][3]) + ' title "' + 
                                               self.setup.get_curves_labels()[self.setup.get_curves_list().index(k)] + 
                                               '" w lp ls ' + str(self.setup.get_curves_list().index(k) + 1))
                                else:
                                    f_gp.write('"' + self.setup.get_data_dir() + i + '/' + j + '/' + k + '/stats.dat' + 
                                               '" u 1:' + str(y_axis[q][3]) + ' title "' + 
                                               self.setup.get_curves_labels()[self.setup.get_curves_list().index(k)] + 
                                               '" w lp ls ' + str(self.setup.get_curves_list().index(k) + 1) + ', \\\n')
                            f_gp.close()
                            call(['gnuplot', self.setup.get_gp_dir() + i + '/' + j + '/' + y_axis[q][2] + '.gp'])
        print '>> Plot process successfully completed.'