12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- def develop_stats_plot(delta:str):
- with open(os.path.join(folder_use, get_file_name_json(False)), 'r') as file:
- value_delta = [f.get(delta, -1) for f in json.load(file)]
- value_plot_mean = plt.scatter(
- value_x,
- [
- statistics.mean(value_delta[:i])
- for i in value_x
- ]
- )
-
- if delta == 'delta_full':
- k = "Between send and inserting values"
- elif delta == 'delta_send':
- k = "Between sent and receive of the consumer"
- elif delta == 'delta_proccessed':
- k = "Between receive of the consumer and insert"
-
- plt.title(f'{k}: mean')
- plt.ylabel("Seconds")
- plt.xlabel("Number of elements")
- plt.close()
-
- value_plot_var = plt.scatter(
- value_x,
- [
- statistics.variance(value_delta[:i])
- for i in value_x
- ]
- )
- plt.title(f'{k}: variance')
- plt.ylabel("Seconds")
- plt.xlabel("Number of elements")
- plt.close()
- value_plot_dev = plt.scatter(
- value_x,
- [
- statistics.stdev(value_delta[:i])
- for i in value_x
- ]
- )
- plt.title(f'{k}: deviation')
- plt.ylabel("Seconds")
- plt.xlabel("Number of elements")
- plt.close()
- value_plot_mean.figure.savefig(value_selected_file_plot(delta, 'mean'))
- value_plot_var.figure.savefig(value_selected_file_plot(delta, 'variance'))
- value_plot_dev.figure.savefig(value_selected_file_plot(delta, 'deviation'))
|