def test_dataset(self): log_data = reader.linux_input_slack(self.log_data_dir, self.start_date, self.end_date) nicks, nick_same_list = nickTracker.nick_tracker(log_data) message_number_graph = network.message_number_graph( log_data, nicks, nick_same_list, False) expected_output = len(message_number_graph), int( message_number_graph.size('weight')) self.assertEqual(expected_output, self.expected_result)
def test_nick_tracker(self): nicks, nick_same_list = nickTracker.nick_tracker(self.log_data) self.assertEqual(nicks, self.nicks1) self.assertEqual(nick_same_list, self.nick_same_list1)
def test_nick_tracker(self): nicks, nick_same_list = nickTracker.nick_tracker(self.log_data) assert nicks == self.nicks1 assert nick_same_list == self.nick_same_list1
log_directory = config.LOG_DIRECTORY channel_name = config.CHANNEL_NAME starting_date = config.STARTING_DATE ending_date = config.ENDING_DATE output_directory = config.OUTPUT_DIRECTORY exec_times_file = open(output_directory + "execution_times.txt", 'w') degree_type = ["out_degree", "in_degree", "total_degree"] print("begin at: ", datetime.datetime.now(), file=exec_times_file) exec_times_file.flush() # ============== INPUT================== log_data = reader.linux_input_slack(log_directory, starting_date, ending_date) nicks, nick_same_list = nickTracker.nick_tracker(log_data) print("reading log files completed at: ", datetime.datetime.now(), file=exec_times_file) exec_times_file.flush() # ============== MESSAGE BINS HEATMAP ============= bin_matrix, total_messages = network.message_number_bins_csv( log_data, nicks, nick_same_list) data = [[i for i in range(len(bin_matrix[0]))]] data.append([sum(i) for i in zip(*bin_matrix)]) saver.save_csv(bin_matrix, output_directory, "MessageNumber_binsize_" + str(config.BIN_LENGTH_MINS)) vis.plot_data(data, output_directory, "bins") print("msg bins completed at: ", datetime.datetime.now(), file=exec_times_file)