diff --git a/peticiones.py b/peticiones.py new file mode 100644 index 0000000000000000000000000000000000000000..cec621815293c25f7cf578c98420c4e6fd4c2796 --- /dev/null +++ b/peticiones.py @@ -0,0 +1,19 @@ +import csv +from collections import Counter + +def count_thread_names(csv_file): + thread_names = [] + with open(csv_file, 'r') as file: + reader = csv.DictReader(file) + for row in reader: + thread_names.append(row['threadName']) + + count = Counter(thread_names) + + with open('peticiones2.csv', 'w', newline='') as file: + writer = csv.writer(file) + writer.writerow(['threadName', 'numeroPeticiones']) + for thread_name, count in sorted(count.items(), key=lambda x: x[0]): + writer.writerow([thread_name, count]) + +count_thread_names('medidas2.csv') \ No newline at end of file