|
10 | 10 |
|
11 | 11 | def log_file_count_summary_table(derived_metrics, |
12 | 12 | mod_name: str): |
| 13 | + data_type = "files" if mod_name != "DAOS" else "objects" |
13 | 14 | # the darshan_file_category enum is not really |
14 | 15 | # exposed in CFFI/Python layer, so we effectively |
15 | 16 | # re-export the content indices we need here |
16 | 17 | # so that we can properly index the C-level data |
17 | | - darshan_file_category = {"total files":0, |
18 | | - "read-only files":1, |
19 | | - "write-only files":2, |
20 | | - "read/write files":3} |
| 18 | + darshan_file_category = {f"total {data_type}":0, |
| 19 | + f"read-only {data_type}":1, |
| 20 | + f"write-only {data_type}":2, |
| 21 | + f"read/write {data_type}":3} |
21 | 22 | df = pd.DataFrame.from_dict(darshan_file_category, orient="index") |
22 | 23 | df.rename(columns={0:"index"}, inplace=True) |
23 | 24 | df.index.rename('type', inplace=True) |
24 | | - df["number of files"] = np.zeros(4, dtype=int) |
| 25 | + df[f"number of {data_type}"] = np.zeros(4, dtype=int) |
25 | 26 | df["avg. size"] = np.zeros(4, dtype=str) |
26 | 27 | df["max size"] = np.zeros(4, dtype=str) |
27 | 28 |
|
@@ -59,9 +60,10 @@ def log_module_overview_table(derived_metrics, |
59 | 60 | mod_overview = [] |
60 | 61 | total_cat = derived_metrics.category_counters[0] |
61 | 62 |
|
62 | | - total_files = total_cat.count |
63 | | - indices = ["files accessed", "bytes read", "bytes written", "I/O performance estimate"] |
64 | | - mod_overview.append(f"{total_files}") |
| 63 | + total_count = total_cat.count |
| 64 | + data_type = "files" if mod_name != "DAOS" else "objects" |
| 65 | + indices = [f"{data_type} accessed", "bytes read", "bytes written", "I/O performance estimate"] |
| 66 | + mod_overview.append(f"{total_count}") |
65 | 67 | total_bytes_read = total_cat.total_read_volume_bytes |
66 | 68 | total_bytes_read_str = humanize.naturalsize(total_bytes_read, binary=True, format="%.2f") |
67 | 69 | total_bytes_written = total_cat.total_write_volume_bytes |
|
0 commit comments