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 {
10
+ "data": {
11
+ "text/html": [
12
+ "<div>\n",
13
+ "<style scoped>\n",
14
+ " .dataframe tbody tr th:only-of-type {\n",
15
+ " vertical-align: middle;\n",
16
+ " }\n",
17
+ "\n",
18
+ " .dataframe tbody tr th {\n",
19
+ " vertical-align: top;\n",
20
+ " }\n",
21
+ "\n",
22
+ " .dataframe thead th {\n",
23
+ " text-align: right;\n",
24
+ " }\n",
25
+ "</style>\n",
26
+ "<table border=\"1\" class=\"dataframe\">\n",
27
+ " <thead>\n",
28
+ " <tr style=\"text-align: right;\">\n",
29
+ " <th></th>\n",
30
+ " <th>source_file</th>\n",
31
+ " <th>n_rows</th>\n",
32
+ " <th>n_cols</th>\n",
33
+ " <th>phase</th>\n",
34
+ " <th>mode</th>\n",
35
+ " <th>model</th>\n",
36
+ " <th>task</th>\n",
37
+ " <th>dataset</th>\n",
38
+ " <th>model_task</th>\n",
39
+ " <th>workload</th>\n",
40
+ " </tr>\n",
41
+ " </thead>\n",
42
+ " <tbody>\n",
43
+ " <tr>\n",
44
+ " <th>0</th>\n",
45
+ " <td>./train_separated/data_DEEPSEEKforTextClassifi...</td>\n",
46
+ " <td>17595</td>\n",
47
+ " <td>678</td>\n",
48
+ " <td>fine-tuning</td>\n",
49
+ " <td>llm</td>\n",
50
+ " <td>DEEPSEEK</td>\n",
51
+ " <td>TextClassification</td>\n",
52
+ " <td>default</td>\n",
53
+ " <td>DEEPSEEK__TextClassification</td>\n",
54
+ " <td>DEEPSEEK__TextClassification__default</td>\n",
55
+ " </tr>\n",
56
+ " <tr>\n",
57
+ " <th>1</th>\n",
58
+ " <td>./train_separated/data_DEEPSEEKforTextClassifi...</td>\n",
59
+ " <td>19203</td>\n",
60
+ " <td>678</td>\n",
61
+ " <td>fine-tuning</td>\n",
62
+ " <td>llm</td>\n",
63
+ " <td>DEEPSEEK</td>\n",
64
+ " <td>TextClassification</td>\n",
65
+ " <td>default</td>\n",
66
+ " <td>DEEPSEEK__TextClassification</td>\n",
67
+ " <td>DEEPSEEK__TextClassification__default</td>\n",
68
+ " </tr>\n",
69
+ " <tr>\n",
70
+ " <th>2</th>\n",
71
+ " <td>./train_separated/data_DEEPSEEKforTextClassifi...</td>\n",
72
+ " <td>18854</td>\n",
73
+ " <td>678</td>\n",
74
+ " <td>fine-tuning</td>\n",
75
+ " <td>llm</td>\n",
76
+ " <td>DEEPSEEK</td>\n",
77
+ " <td>TextClassification</td>\n",
78
+ " <td>default</td>\n",
79
+ " <td>DEEPSEEK__TextClassification</td>\n",
80
+ " <td>DEEPSEEK__TextClassification__default</td>\n",
81
+ " </tr>\n",
82
+ " <tr>\n",
83
+ " <th>3</th>\n",
84
+ " <td>./train_separated/data_DEEPSEEKforTextClassifi...</td>\n",
85
+ " <td>17782</td>\n",
86
+ " <td>678</td>\n",
87
+ " <td>fine-tuning</td>\n",
88
+ " <td>llm</td>\n",
89
+ " <td>DEEPSEEK</td>\n",
90
+ " <td>TextClassification</td>\n",
91
+ " <td>default</td>\n",
92
+ " <td>DEEPSEEK__TextClassification</td>\n",
93
+ " <td>DEEPSEEK__TextClassification__default</td>\n",
94
+ " </tr>\n",
95
+ " <tr>\n",
96
+ " <th>4</th>\n",
97
+ " <td>./train_separated/data_DEEPSEEKforTextClassifi...</td>\n",
98
+ " <td>17700</td>\n",
99
+ " <td>678</td>\n",
100
+ " <td>fine-tuning</td>\n",
101
+ " <td>llm</td>\n",
102
+ " <td>DEEPSEEK</td>\n",
103
+ " <td>TextClassification</td>\n",
104
+ " <td>default</td>\n",
105
+ " <td>DEEPSEEK__TextClassification</td>\n",
106
+ " <td>DEEPSEEK__TextClassification__default</td>\n",
107
+ " </tr>\n",
108
+ " <tr>\n",
109
+ " <th>...</th>\n",
110
+ " <td>...</td>\n",
111
+ " <td>...</td>\n",
112
+ " <td>...</td>\n",
113
+ " <td>...</td>\n",
114
+ " <td>...</td>\n",
115
+ " <td>...</td>\n",
116
+ " <td>...</td>\n",
117
+ " <td>...</td>\n",
118
+ " <td>...</td>\n",
119
+ " <td>...</td>\n",
120
+ " </tr>\n",
121
+ " <tr>\n",
122
+ " <th>675</th>\n",
123
+ " <td>./infer_separated/infer_ViTL16forImageSemantic...</td>\n",
124
+ " <td>93</td>\n",
125
+ " <td>678</td>\n",
126
+ " <td>infer</td>\n",
127
+ " <td>nonllm</td>\n",
128
+ " <td>ViTL16</td>\n",
129
+ " <td>ImageSemanticSegmentation</td>\n",
130
+ " <td>default</td>\n",
131
+ " <td>ViTL16__ImageSemanticSegmentation</td>\n",
132
+ " <td>ViTL16__ImageSemanticSegmentation__default</td>\n",
133
+ " </tr>\n",
134
+ " <tr>\n",
135
+ " <th>676</th>\n",
136
+ " <td>./infer_separated/infer_ViTL16forImageSemantic...</td>\n",
137
+ " <td>94</td>\n",
138
+ " <td>678</td>\n",
139
+ " <td>infer</td>\n",
140
+ " <td>nonllm</td>\n",
141
+ " <td>ViTL16</td>\n",
142
+ " <td>ImageSemanticSegmentation</td>\n",
143
+ " <td>default</td>\n",
144
+ " <td>ViTL16__ImageSemanticSegmentation</td>\n",
145
+ " <td>ViTL16__ImageSemanticSegmentation__default</td>\n",
146
+ " </tr>\n",
147
+ " <tr>\n",
148
+ " <th>677</th>\n",
149
+ " <td>./infer_separated/infer_ViTL16forImageSemantic...</td>\n",
150
+ " <td>106</td>\n",
151
+ " <td>678</td>\n",
152
+ " <td>infer</td>\n",
153
+ " <td>nonllm</td>\n",
154
+ " <td>ViTL16</td>\n",
155
+ " <td>ImageSemanticSegmentation</td>\n",
156
+ " <td>default</td>\n",
157
+ " <td>ViTL16__ImageSemanticSegmentation</td>\n",
158
+ " <td>ViTL16__ImageSemanticSegmentation__default</td>\n",
159
+ " </tr>\n",
160
+ " <tr>\n",
161
+ " <th>678</th>\n",
162
+ " <td>./infer_separated/infer_ViTL16forImageSemantic...</td>\n",
163
+ " <td>114</td>\n",
164
+ " <td>678</td>\n",
165
+ " <td>infer</td>\n",
166
+ " <td>nonllm</td>\n",
167
+ " <td>ViTL16</td>\n",
168
+ " <td>ImageSemanticSegmentation</td>\n",
169
+ " <td>default</td>\n",
170
+ " <td>ViTL16__ImageSemanticSegmentation</td>\n",
171
+ " <td>ViTL16__ImageSemanticSegmentation__default</td>\n",
172
+ " </tr>\n",
173
+ " <tr>\n",
174
+ " <th>679</th>\n",
175
+ " <td>./infer_separated/infer_ViTL16forImageSemantic...</td>\n",
176
+ " <td>105</td>\n",
177
+ " <td>678</td>\n",
178
+ " <td>infer</td>\n",
179
+ " <td>nonllm</td>\n",
180
+ " <td>ViTL16</td>\n",
181
+ " <td>ImageSemanticSegmentation</td>\n",
182
+ " <td>default</td>\n",
183
+ " <td>ViTL16__ImageSemanticSegmentation</td>\n",
184
+ " <td>ViTL16__ImageSemanticSegmentation__default</td>\n",
185
+ " </tr>\n",
186
+ " </tbody>\n",
187
+ "</table>\n",
188
+ "<p>680 rows × 10 columns</p>\n",
189
+ "</div>"
190
+ ],
191
+ "text/plain": [
192
+ " source_file n_rows n_cols \\\n",
193
+ "0 ./train_separated/data_DEEPSEEKforTextClassifi... 17595 678 \n",
194
+ "1 ./train_separated/data_DEEPSEEKforTextClassifi... 19203 678 \n",
195
+ "2 ./train_separated/data_DEEPSEEKforTextClassifi... 18854 678 \n",
196
+ "3 ./train_separated/data_DEEPSEEKforTextClassifi... 17782 678 \n",
197
+ "4 ./train_separated/data_DEEPSEEKforTextClassifi... 17700 678 \n",
198
+ ".. ... ... ... \n",
199
+ "675 ./infer_separated/infer_ViTL16forImageSemantic... 93 678 \n",
200
+ "676 ./infer_separated/infer_ViTL16forImageSemantic... 94 678 \n",
201
+ "677 ./infer_separated/infer_ViTL16forImageSemantic... 106 678 \n",
202
+ "678 ./infer_separated/infer_ViTL16forImageSemantic... 114 678 \n",
203
+ "679 ./infer_separated/infer_ViTL16forImageSemantic... 105 678 \n",
204
+ "\n",
205
+ " phase mode model task dataset \\\n",
206
+ "0 fine-tuning llm DEEPSEEK TextClassification default \n",
207
+ "1 fine-tuning llm DEEPSEEK TextClassification default \n",
208
+ "2 fine-tuning llm DEEPSEEK TextClassification default \n",
209
+ "3 fine-tuning llm DEEPSEEK TextClassification default \n",
210
+ "4 fine-tuning llm DEEPSEEK TextClassification default \n",
211
+ ".. ... ... ... ... ... \n",
212
+ "675 infer nonllm ViTL16 ImageSemanticSegmentation default \n",
213
+ "676 infer nonllm ViTL16 ImageSemanticSegmentation default \n",
214
+ "677 infer nonllm ViTL16 ImageSemanticSegmentation default \n",
215
+ "678 infer nonllm ViTL16 ImageSemanticSegmentation default \n",
216
+ "679 infer nonllm ViTL16 ImageSemanticSegmentation default \n",
217
+ "\n",
218
+ " model_task \\\n",
219
+ "0 DEEPSEEK__TextClassification \n",
220
+ "1 DEEPSEEK__TextClassification \n",
221
+ "2 DEEPSEEK__TextClassification \n",
222
+ "3 DEEPSEEK__TextClassification \n",
223
+ "4 DEEPSEEK__TextClassification \n",
224
+ ".. ... \n",
225
+ "675 ViTL16__ImageSemanticSegmentation \n",
226
+ "676 ViTL16__ImageSemanticSegmentation \n",
227
+ "677 ViTL16__ImageSemanticSegmentation \n",
228
+ "678 ViTL16__ImageSemanticSegmentation \n",
229
+ "679 ViTL16__ImageSemanticSegmentation \n",
230
+ "\n",
231
+ " workload \n",
232
+ "0 DEEPSEEK__TextClassification__default \n",
233
+ "1 DEEPSEEK__TextClassification__default \n",
234
+ "2 DEEPSEEK__TextClassification__default \n",
235
+ "3 DEEPSEEK__TextClassification__default \n",
236
+ "4 DEEPSEEK__TextClassification__default \n",
237
+ ".. ... \n",
238
+ "675 ViTL16__ImageSemanticSegmentation__default \n",
239
+ "676 ViTL16__ImageSemanticSegmentation__default \n",
240
+ "677 ViTL16__ImageSemanticSegmentation__default \n",
241
+ "678 ViTL16__ImageSemanticSegmentation__default \n",
242
+ "679 ViTL16__ImageSemanticSegmentation__default \n",
243
+ "\n",
244
+ "[680 rows x 10 columns]"
245
+ ]
246
+ },
247
+ "execution_count": 4,
248
+ "metadata": {},
249
+ "output_type": "execute_result"
250
+ }
251
+ ],
252
+ "source": [
253
+ "import pandas as pd\n",
254
+ "\n",
255
+ "df = pd.read_csv('meta.csv')\n",
256
+ "\n",
257
+ "df"
258
+ ]
259
+ },
260
+ {
261
+ "cell_type": "code",
262
+ "execution_count": 7,
263
+ "id": "2d875356",
264
+ "metadata": {},
265
+ "outputs": [],
266
+ "source": [
267
+ "import re\n",
268
+ "import pandas as pd\n",
269
+ "\n",
270
+ "# ==== Network-size-related Metrics Description Text ====\n",
271
+ "network_size_text = \"\"\"\n",
272
+ "NetworkInterStat_diff:rx_bytes.*.*[Bytes] — Bytes received on <Interface> during sample window (delta).\n",
273
+ "NetworkInterStat_diff:rx_packets.*.*[count] — Packets received during window (delta).\n",
274
+ "NetworkInterStat_diff:tx_bytes.*.*[Bytes] — Bytes transmitted on <Interface> during window (delta).\n",
275
+ "NetworkInterStat_diff:tx_packets.*.*[count] — Packets transmitted during window (delta).\n",
276
+ "\"\"\"\n",
277
+ "\n",
278
+ "# ==== Extract Metrics and Descriptions ====\n",
279
+ "network_size_metrics = re.findall(r\"^([A-Za-z0-9_:.*\\[\\]]+)\\s+—\\s+(.*)$\", network_size_text, flags=re.M)\n",
280
+ "df_metrics = pd.DataFrame(network_size_metrics, columns=[\"metric_pattern\", \"description\"])\n"
281
+ ]
282
+ },
283
+ {
284
+ "cell_type": "code",
285
+ "execution_count": 9,
286
+ "id": "0a1046bd",
287
+ "metadata": {},
288
+ "outputs": [
289
+ {
290
+ "name": "stdout",
291
+ "output_type": "stream",
292
+ "text": [
293
+ "Reading: ./infer_separated/data_DEEPSEEKforInference_default_2025-04-26T09-41-59_htc-g003.txt\n",
294
+ "Matched 8 columns:\n",
295
+ "['NetworkInterStat_diff:rx_bytes.ens1f0.htc-g003[Bytes]', 'NetworkInterStat_diff:rx_bytes.ib0.htc-g003[Bytes]', 'NetworkInterStat_diff:rx_packets.ens1f0.htc-g003[count]', 'NetworkInterStat_diff:rx_packets.ib0.htc-g003[count]', 'NetworkInterStat_diff:tx_bytes.ens1f0.htc-g003[Bytes]', 'NetworkInterStat_diff:tx_bytes.ib0.htc-g003[Bytes]', 'NetworkInterStat_diff:tx_packets.ens1f0.htc-g003[count]', 'NetworkInterStat_diff:tx_packets.ib0.htc-g003[count]']\n"
296
+ ]
297
+ },
298
+ {
299
+ "data": {
300
+ "text/html": [
301
+ "<div>\n",
302
+ "<style scoped>\n",
303
+ " .dataframe tbody tr th:only-of-type {\n",
304
+ " vertical-align: middle;\n",
305
+ " }\n",
306
+ "\n",
307
+ " .dataframe tbody tr th {\n",
308
+ " vertical-align: top;\n",
309
+ " }\n",
310
+ "\n",
311
+ " .dataframe thead th {\n",
312
+ " text-align: right;\n",
313
+ " }\n",
314
+ "</style>\n",
315
+ "<table border=\"1\" class=\"dataframe\">\n",
316
+ " <thead>\n",
317
+ " <tr style=\"text-align: right;\">\n",
318
+ " <th></th>\n",
319
+ " <th>NetworkInterStat_diff:rx_bytes.ens1f0.htc-g003[Bytes]</th>\n",
320
+ " <th>NetworkInterStat_diff:rx_bytes.ib0.htc-g003[Bytes]</th>\n",
321
+ " <th>NetworkInterStat_diff:rx_packets.ens1f0.htc-g003[count]</th>\n",
322
+ " <th>NetworkInterStat_diff:rx_packets.ib0.htc-g003[count]</th>\n",
323
+ " <th>NetworkInterStat_diff:tx_bytes.ens1f0.htc-g003[Bytes]</th>\n",
324
+ " <th>NetworkInterStat_diff:tx_bytes.ib0.htc-g003[Bytes]</th>\n",
325
+ " <th>NetworkInterStat_diff:tx_packets.ens1f0.htc-g003[count]</th>\n",
326
+ " <th>NetworkInterStat_diff:tx_packets.ib0.htc-g003[count]</th>\n",
327
+ " </tr>\n",
328
+ " </thead>\n",
329
+ " <tbody>\n",
330
+ " <tr>\n",
331
+ " <th>0</th>\n",
332
+ " <td>21504048.0</td>\n",
333
+ " <td>5662.0</td>\n",
334
+ " <td>14657.00</td>\n",
335
+ " <td>23.0</td>\n",
336
+ " <td>267176.0</td>\n",
337
+ " <td>6536.0</td>\n",
338
+ " <td>1562.0</td>\n",
339
+ " <td>16.00</td>\n",
340
+ " </tr>\n",
341
+ " <tr>\n",
342
+ " <th>1</th>\n",
343
+ " <td>31028162.0</td>\n",
344
+ " <td>4602.5</td>\n",
345
+ " <td>20905.75</td>\n",
346
+ " <td>19.5</td>\n",
347
+ " <td>305426.0</td>\n",
348
+ " <td>16161.0</td>\n",
349
+ " <td>1954.0</td>\n",
350
+ " <td>15.25</td>\n",
351
+ " </tr>\n",
352
+ " <tr>\n",
353
+ " <th>2</th>\n",
354
+ " <td>40552276.0</td>\n",
355
+ " <td>3543.0</td>\n",
356
+ " <td>27154.50</td>\n",
357
+ " <td>16.0</td>\n",
358
+ " <td>343676.0</td>\n",
359
+ " <td>25786.0</td>\n",
360
+ " <td>2346.0</td>\n",
361
+ " <td>14.50</td>\n",
362
+ " </tr>\n",
363
+ " <tr>\n",
364
+ " <th>3</th>\n",
365
+ " <td>50076390.0</td>\n",
366
+ " <td>2483.5</td>\n",
367
+ " <td>33403.25</td>\n",
368
+ " <td>12.5</td>\n",
369
+ " <td>381926.0</td>\n",
370
+ " <td>35411.0</td>\n",
371
+ " <td>2738.0</td>\n",
372
+ " <td>13.75</td>\n",
373
+ " </tr>\n",
374
+ " <tr>\n",
375
+ " <th>4</th>\n",
376
+ " <td>59600504.0</td>\n",
377
+ " <td>1424.0</td>\n",
378
+ " <td>39652.00</td>\n",
379
+ " <td>9.0</td>\n",
380
+ " <td>420176.0</td>\n",
381
+ " <td>45036.0</td>\n",
382
+ " <td>3130.0</td>\n",
383
+ " <td>13.00</td>\n",
384
+ " </tr>\n",
385
+ " </tbody>\n",
386
+ "</table>\n",
387
+ "</div>"
388
+ ],
389
+ "text/plain": [
390
+ " NetworkInterStat_diff:rx_bytes.ens1f0.htc-g003[Bytes] \\\n",
391
+ "0 21504048.0 \n",
392
+ "1 31028162.0 \n",
393
+ "2 40552276.0 \n",
394
+ "3 50076390.0 \n",
395
+ "4 59600504.0 \n",
396
+ "\n",
397
+ " NetworkInterStat_diff:rx_bytes.ib0.htc-g003[Bytes] \\\n",
398
+ "0 5662.0 \n",
399
+ "1 4602.5 \n",
400
+ "2 3543.0 \n",
401
+ "3 2483.5 \n",
402
+ "4 1424.0 \n",
403
+ "\n",
404
+ " NetworkInterStat_diff:rx_packets.ens1f0.htc-g003[count] \\\n",
405
+ "0 14657.00 \n",
406
+ "1 20905.75 \n",
407
+ "2 27154.50 \n",
408
+ "3 33403.25 \n",
409
+ "4 39652.00 \n",
410
+ "\n",
411
+ " NetworkInterStat_diff:rx_packets.ib0.htc-g003[count] \\\n",
412
+ "0 23.0 \n",
413
+ "1 19.5 \n",
414
+ "2 16.0 \n",
415
+ "3 12.5 \n",
416
+ "4 9.0 \n",
417
+ "\n",
418
+ " NetworkInterStat_diff:tx_bytes.ens1f0.htc-g003[Bytes] \\\n",
419
+ "0 267176.0 \n",
420
+ "1 305426.0 \n",
421
+ "2 343676.0 \n",
422
+ "3 381926.0 \n",
423
+ "4 420176.0 \n",
424
+ "\n",
425
+ " NetworkInterStat_diff:tx_bytes.ib0.htc-g003[Bytes] \\\n",
426
+ "0 6536.0 \n",
427
+ "1 16161.0 \n",
428
+ "2 25786.0 \n",
429
+ "3 35411.0 \n",
430
+ "4 45036.0 \n",
431
+ "\n",
432
+ " NetworkInterStat_diff:tx_packets.ens1f0.htc-g003[count] \\\n",
433
+ "0 1562.0 \n",
434
+ "1 1954.0 \n",
435
+ "2 2346.0 \n",
436
+ "3 2738.0 \n",
437
+ "4 3130.0 \n",
438
+ "\n",
439
+ " NetworkInterStat_diff:tx_packets.ib0.htc-g003[count] \n",
440
+ "0 16.00 \n",
441
+ "1 15.25 \n",
442
+ "2 14.50 \n",
443
+ "3 13.75 \n",
444
+ "4 13.00 "
445
+ ]
446
+ },
447
+ "metadata": {},
448
+ "output_type": "display_data"
449
+ }
450
+ ],
451
+ "source": [
452
+ "# ==== Only focus on 'llm' mode and 'infer' phase ====\n",
453
+ "for file in df[(df['mode'] == 'llm') & (df['phase'] == 'infer')]['source_file'].tolist():\n",
454
+ " print(f\"Reading: {file}\")\n",
455
+ " data = pd.read_csv(file, sep='\\t', header=0)\n",
456
+ "\n",
457
+ " # ==== Find matching columns based on the memory patterns ====\n",
458
+ " matched_cols = []\n",
459
+ " for pattern in df_metrics[\"metric_pattern\"]:\n",
460
+ " # Replace .* in the regular expression with the actual regular expression matching pattern\n",
461
+ " regex = pattern.replace(\".*\", \".*\")\n",
462
+ " matched = [col for col in data.columns if re.match(regex, col)]\n",
463
+ " matched_cols.extend(matched)\n",
464
+ "\n",
465
+ " # Deduplication and sorting\n",
466
+ " matched_cols = list(sorted(set(matched_cols)))\n",
467
+ "\n",
468
+ " print(f\"Matched {len(matched_cols)} columns:\")\n",
469
+ " print(matched_cols)\n",
470
+ "\n",
471
+ " # ==== Extract data from these columns ====\n",
472
+ " data_selected = data[matched_cols]\n",
473
+ "\n",
474
+ " # ==== Optional: Merge description information (matching by regular expression pattern) ====\n",
475
+ " # Create a mapping for metric_name -> description (using the first matching rule)\n",
476
+ " desc_map = {}\n",
477
+ " for _, row in df_metrics.iterrows():\n",
478
+ " regex = row['metric_pattern'].replace(\".*\", \".*\")\n",
479
+ " for col in matched_cols:\n",
480
+ " if re.match(regex, col):\n",
481
+ " desc_map[col] = row['description']\n",
482
+ "\n",
483
+ " desc_df = pd.DataFrame(list(desc_map.items()), columns=[\"metric_name\", \"description\"])\n",
484
+ "\n",
485
+ " # display(desc_df.head())\n",
486
+ " display(data_selected.head())\n",
487
+ "\n",
488
+ " break"
489
+ ]
490
+ },
491
+ {
492
+ "cell_type": "code",
493
+ "execution_count": 10,
494
+ "id": "f92fd087",
495
+ "metadata": {},
496
+ "outputs": [
497
+ {
498
+ "data": {
499
+ "text/html": [
500
+ "<div>\n",
501
+ "<style scoped>\n",
502
+ " .dataframe tbody tr th:only-of-type {\n",
503
+ " vertical-align: middle;\n",
504
+ " }\n",
505
+ "\n",
506
+ " .dataframe tbody tr th {\n",
507
+ " vertical-align: top;\n",
508
+ " }\n",
509
+ "\n",
510
+ " .dataframe thead th {\n",
511
+ " text-align: right;\n",
512
+ " }\n",
513
+ "</style>\n",
514
+ "<table border=\"1\" class=\"dataframe\">\n",
515
+ " <thead>\n",
516
+ " <tr style=\"text-align: right;\">\n",
517
+ " <th></th>\n",
518
+ " <th>NetworkInterStat_diff:rx_bytes.ens1f0.htc-g003[Bytes]</th>\n",
519
+ " <th>NetworkInterStat_diff:rx_bytes.ib0.htc-g003[Bytes]</th>\n",
520
+ " <th>NetworkInterStat_diff:rx_packets.ens1f0.htc-g003[count]</th>\n",
521
+ " <th>NetworkInterStat_diff:rx_packets.ib0.htc-g003[count]</th>\n",
522
+ " <th>NetworkInterStat_diff:tx_bytes.ens1f0.htc-g003[Bytes]</th>\n",
523
+ " <th>NetworkInterStat_diff:tx_bytes.ib0.htc-g003[Bytes]</th>\n",
524
+ " <th>NetworkInterStat_diff:tx_packets.ens1f0.htc-g003[count]</th>\n",
525
+ " <th>NetworkInterStat_diff:tx_packets.ib0.htc-g003[count]</th>\n",
526
+ " </tr>\n",
527
+ " </thead>\n",
528
+ " <tbody>\n",
529
+ " <tr>\n",
530
+ " <th>0</th>\n",
531
+ " <td>21504048.0</td>\n",
532
+ " <td>5662.0</td>\n",
533
+ " <td>14657.00</td>\n",
534
+ " <td>23.0</td>\n",
535
+ " <td>267176.0</td>\n",
536
+ " <td>6536.0</td>\n",
537
+ " <td>1562.0</td>\n",
538
+ " <td>16.00</td>\n",
539
+ " </tr>\n",
540
+ " <tr>\n",
541
+ " <th>1</th>\n",
542
+ " <td>31028162.0</td>\n",
543
+ " <td>4602.5</td>\n",
544
+ " <td>20905.75</td>\n",
545
+ " <td>19.5</td>\n",
546
+ " <td>305426.0</td>\n",
547
+ " <td>16161.0</td>\n",
548
+ " <td>1954.0</td>\n",
549
+ " <td>15.25</td>\n",
550
+ " </tr>\n",
551
+ " <tr>\n",
552
+ " <th>2</th>\n",
553
+ " <td>40552276.0</td>\n",
554
+ " <td>3543.0</td>\n",
555
+ " <td>27154.50</td>\n",
556
+ " <td>16.0</td>\n",
557
+ " <td>343676.0</td>\n",
558
+ " <td>25786.0</td>\n",
559
+ " <td>2346.0</td>\n",
560
+ " <td>14.50</td>\n",
561
+ " </tr>\n",
562
+ " <tr>\n",
563
+ " <th>3</th>\n",
564
+ " <td>50076390.0</td>\n",
565
+ " <td>2483.5</td>\n",
566
+ " <td>33403.25</td>\n",
567
+ " <td>12.5</td>\n",
568
+ " <td>381926.0</td>\n",
569
+ " <td>35411.0</td>\n",
570
+ " <td>2738.0</td>\n",
571
+ " <td>13.75</td>\n",
572
+ " </tr>\n",
573
+ " <tr>\n",
574
+ " <th>4</th>\n",
575
+ " <td>59600504.0</td>\n",
576
+ " <td>1424.0</td>\n",
577
+ " <td>39652.00</td>\n",
578
+ " <td>9.0</td>\n",
579
+ " <td>420176.0</td>\n",
580
+ " <td>45036.0</td>\n",
581
+ " <td>3130.0</td>\n",
582
+ " <td>13.00</td>\n",
583
+ " </tr>\n",
584
+ " <tr>\n",
585
+ " <th>...</th>\n",
586
+ " <td>...</td>\n",
587
+ " <td>...</td>\n",
588
+ " <td>...</td>\n",
589
+ " <td>...</td>\n",
590
+ " <td>...</td>\n",
591
+ " <td>...</td>\n",
592
+ " <td>...</td>\n",
593
+ " <td>...</td>\n",
594
+ " </tr>\n",
595
+ " <tr>\n",
596
+ " <th>938</th>\n",
597
+ " <td>13003982.0</td>\n",
598
+ " <td>13888.0</td>\n",
599
+ " <td>8675.00</td>\n",
600
+ " <td>40.0</td>\n",
601
+ " <td>178826.0</td>\n",
602
+ " <td>58460.0</td>\n",
603
+ " <td>925.0</td>\n",
604
+ " <td>38.00</td>\n",
605
+ " </tr>\n",
606
+ " <tr>\n",
607
+ " <th>939</th>\n",
608
+ " <td>6512100.0</td>\n",
609
+ " <td>7336.0</td>\n",
610
+ " <td>4385.50</td>\n",
611
+ " <td>22.0</td>\n",
612
+ " <td>120400.5</td>\n",
613
+ " <td>29952.0</td>\n",
614
+ " <td>512.5</td>\n",
615
+ " <td>20.50</td>\n",
616
+ " </tr>\n",
617
+ " <tr>\n",
618
+ " <th>940</th>\n",
619
+ " <td>20218.0</td>\n",
620
+ " <td>784.0</td>\n",
621
+ " <td>96.00</td>\n",
622
+ " <td>4.0</td>\n",
623
+ " <td>61975.0</td>\n",
624
+ " <td>1444.0</td>\n",
625
+ " <td>100.0</td>\n",
626
+ " <td>3.00</td>\n",
627
+ " </tr>\n",
628
+ " <tr>\n",
629
+ " <th>941</th>\n",
630
+ " <td>20210.0</td>\n",
631
+ " <td>2831.0</td>\n",
632
+ " <td>90.50</td>\n",
633
+ " <td>11.5</td>\n",
634
+ " <td>71827.5</td>\n",
635
+ " <td>3268.0</td>\n",
636
+ " <td>101.0</td>\n",
637
+ " <td>8.00</td>\n",
638
+ " </tr>\n",
639
+ " <tr>\n",
640
+ " <th>942</th>\n",
641
+ " <td>20202.0</td>\n",
642
+ " <td>4878.0</td>\n",
643
+ " <td>85.00</td>\n",
644
+ " <td>19.0</td>\n",
645
+ " <td>81680.0</td>\n",
646
+ " <td>5092.0</td>\n",
647
+ " <td>102.0</td>\n",
648
+ " <td>13.00</td>\n",
649
+ " </tr>\n",
650
+ " </tbody>\n",
651
+ "</table>\n",
652
+ "<p>943 rows × 8 columns</p>\n",
653
+ "</div>"
654
+ ],
655
+ "text/plain": [
656
+ " NetworkInterStat_diff:rx_bytes.ens1f0.htc-g003[Bytes] \\\n",
657
+ "0 21504048.0 \n",
658
+ "1 31028162.0 \n",
659
+ "2 40552276.0 \n",
660
+ "3 50076390.0 \n",
661
+ "4 59600504.0 \n",
662
+ ".. ... \n",
663
+ "938 13003982.0 \n",
664
+ "939 6512100.0 \n",
665
+ "940 20218.0 \n",
666
+ "941 20210.0 \n",
667
+ "942 20202.0 \n",
668
+ "\n",
669
+ " NetworkInterStat_diff:rx_bytes.ib0.htc-g003[Bytes] \\\n",
670
+ "0 5662.0 \n",
671
+ "1 4602.5 \n",
672
+ "2 3543.0 \n",
673
+ "3 2483.5 \n",
674
+ "4 1424.0 \n",
675
+ ".. ... \n",
676
+ "938 13888.0 \n",
677
+ "939 7336.0 \n",
678
+ "940 784.0 \n",
679
+ "941 2831.0 \n",
680
+ "942 4878.0 \n",
681
+ "\n",
682
+ " NetworkInterStat_diff:rx_packets.ens1f0.htc-g003[count] \\\n",
683
+ "0 14657.00 \n",
684
+ "1 20905.75 \n",
685
+ "2 27154.50 \n",
686
+ "3 33403.25 \n",
687
+ "4 39652.00 \n",
688
+ ".. ... \n",
689
+ "938 8675.00 \n",
690
+ "939 4385.50 \n",
691
+ "940 96.00 \n",
692
+ "941 90.50 \n",
693
+ "942 85.00 \n",
694
+ "\n",
695
+ " NetworkInterStat_diff:rx_packets.ib0.htc-g003[count] \\\n",
696
+ "0 23.0 \n",
697
+ "1 19.5 \n",
698
+ "2 16.0 \n",
699
+ "3 12.5 \n",
700
+ "4 9.0 \n",
701
+ ".. ... \n",
702
+ "938 40.0 \n",
703
+ "939 22.0 \n",
704
+ "940 4.0 \n",
705
+ "941 11.5 \n",
706
+ "942 19.0 \n",
707
+ "\n",
708
+ " NetworkInterStat_diff:tx_bytes.ens1f0.htc-g003[Bytes] \\\n",
709
+ "0 267176.0 \n",
710
+ "1 305426.0 \n",
711
+ "2 343676.0 \n",
712
+ "3 381926.0 \n",
713
+ "4 420176.0 \n",
714
+ ".. ... \n",
715
+ "938 178826.0 \n",
716
+ "939 120400.5 \n",
717
+ "940 61975.0 \n",
718
+ "941 71827.5 \n",
719
+ "942 81680.0 \n",
720
+ "\n",
721
+ " NetworkInterStat_diff:tx_bytes.ib0.htc-g003[Bytes] \\\n",
722
+ "0 6536.0 \n",
723
+ "1 16161.0 \n",
724
+ "2 25786.0 \n",
725
+ "3 35411.0 \n",
726
+ "4 45036.0 \n",
727
+ ".. ... \n",
728
+ "938 58460.0 \n",
729
+ "939 29952.0 \n",
730
+ "940 1444.0 \n",
731
+ "941 3268.0 \n",
732
+ "942 5092.0 \n",
733
+ "\n",
734
+ " NetworkInterStat_diff:tx_packets.ens1f0.htc-g003[count] \\\n",
735
+ "0 1562.0 \n",
736
+ "1 1954.0 \n",
737
+ "2 2346.0 \n",
738
+ "3 2738.0 \n",
739
+ "4 3130.0 \n",
740
+ ".. ... \n",
741
+ "938 925.0 \n",
742
+ "939 512.5 \n",
743
+ "940 100.0 \n",
744
+ "941 101.0 \n",
745
+ "942 102.0 \n",
746
+ "\n",
747
+ " NetworkInterStat_diff:tx_packets.ib0.htc-g003[count] \n",
748
+ "0 16.00 \n",
749
+ "1 15.25 \n",
750
+ "2 14.50 \n",
751
+ "3 13.75 \n",
752
+ "4 13.00 \n",
753
+ ".. ... \n",
754
+ "938 38.00 \n",
755
+ "939 20.50 \n",
756
+ "940 3.00 \n",
757
+ "941 8.00 \n",
758
+ "942 13.00 \n",
759
+ "\n",
760
+ "[943 rows x 8 columns]"
761
+ ]
762
+ },
763
+ "execution_count": 10,
764
+ "metadata": {},
765
+ "output_type": "execute_result"
766
+ }
767
+ ],
768
+ "source": [
769
+ "data_selected"
770
+ ]
771
+ },
772
+ {
773
+ "cell_type": "markdown",
774
+ "id": "74012855",
775
+ "metadata": {},
776
+ "source": [
777
+ "Divide the \"bytes received\" by the \"packets received\" to get the average/estimated bytes per packet for each sampling window."
778
+ ]
779
+ },
780
+ {
781
+ "cell_type": "code",
782
+ "execution_count": 12,
783
+ "id": "57d6d3b5",
784
+ "metadata": {},
785
+ "outputs": [
786
+ {
787
+ "data": {
788
+ "text/plain": [
789
+ "0 1467.152078\n",
790
+ "1 1484.192722\n",
791
+ "2 1493.390635\n",
792
+ "3 1499.147239\n",
793
+ "4 1503.089478\n",
794
+ " ... \n",
795
+ "938 1499.018098\n",
796
+ "939 1484.916201\n",
797
+ "940 210.604167\n",
798
+ "941 223.314917\n",
799
+ "942 237.670588\n",
800
+ "Length: 943, dtype: float64"
801
+ ]
802
+ },
803
+ "execution_count": 12,
804
+ "metadata": {},
805
+ "output_type": "execute_result"
806
+ }
807
+ ],
808
+ "source": [
809
+ "estimated_size_bytes = data_selected['NetworkInterStat_diff:rx_bytes.ens1f0.htc-g003[Bytes]']/data_selected['NetworkInterStat_diff:rx_packets.ens1f0.htc-g003[count]']\n",
810
+ "estimated_size_bytes"
811
+ ]
812
+ },
813
+ {
814
+ "cell_type": "code",
815
+ "execution_count": 13,
816
+ "id": "ccc13ee9",
817
+ "metadata": {},
818
+ "outputs": [
819
+ {
820
+ "data": {
821
+ "text/plain": [
822
+ "0 171.047375\n",
823
+ "1 156.308086\n",
824
+ "2 146.494459\n",
825
+ "3 139.490869\n",
826
+ "4 134.241534\n",
827
+ " ... \n",
828
+ "938 193.325405\n",
829
+ "939 234.927805\n",
830
+ "940 619.750000\n",
831
+ "941 711.163366\n",
832
+ "942 800.784314\n",
833
+ "Length: 943, dtype: float64"
834
+ ]
835
+ },
836
+ "execution_count": 13,
837
+ "metadata": {},
838
+ "output_type": "execute_result"
839
+ }
840
+ ],
841
+ "source": [
842
+ "estimated_size_bytes = data_selected['NetworkInterStat_diff:tx_bytes.ens1f0.htc-g003[Bytes]']/data_selected['NetworkInterStat_diff:tx_packets.ens1f0.htc-g003[count]']\n",
843
+ "estimated_size_bytes"
844
+ ]
845
+ },
846
+ {
847
+ "cell_type": "code",
848
+ "execution_count": 14,
849
+ "id": "62efe14a",
850
+ "metadata": {},
851
+ "outputs": [
852
+ {
853
+ "data": {
854
+ "text/plain": [
855
+ "0 246.173913\n",
856
+ "1 236.025641\n",
857
+ "2 221.437500\n",
858
+ "3 198.680000\n",
859
+ "4 158.222222\n",
860
+ " ... \n",
861
+ "938 347.200000\n",
862
+ "939 333.454545\n",
863
+ "940 196.000000\n",
864
+ "941 246.173913\n",
865
+ "942 256.736842\n",
866
+ "Length: 943, dtype: float64"
867
+ ]
868
+ },
869
+ "execution_count": 14,
870
+ "metadata": {},
871
+ "output_type": "execute_result"
872
+ }
873
+ ],
874
+ "source": [
875
+ "estimated_size_bytes = data_selected['NetworkInterStat_diff:rx_bytes.ib0.htc-g003[Bytes]']/data_selected['NetworkInterStat_diff:rx_packets.ib0.htc-g003[count]']\n",
876
+ "estimated_size_bytes"
877
+ ]
878
+ },
879
+ {
880
+ "cell_type": "code",
881
+ "execution_count": 15,
882
+ "id": "e976cc06",
883
+ "metadata": {},
884
+ "outputs": [
885
+ {
886
+ "data": {
887
+ "text/plain": [
888
+ "0 408.500000\n",
889
+ "1 1059.737705\n",
890
+ "2 1778.344828\n",
891
+ "3 2575.345455\n",
892
+ "4 3464.307692\n",
893
+ " ... \n",
894
+ "938 1538.421053\n",
895
+ "939 1461.073171\n",
896
+ "940 481.333333\n",
897
+ "941 408.500000\n",
898
+ "942 391.692308\n",
899
+ "Length: 943, dtype: float64"
900
+ ]
901
+ },
902
+ "execution_count": 15,
903
+ "metadata": {},
904
+ "output_type": "execute_result"
905
+ }
906
+ ],
907
+ "source": [
908
+ "estimated_size_bytes = data_selected['NetworkInterStat_diff:tx_bytes.ib0.htc-g003[Bytes]']/data_selected['NetworkInterStat_diff:tx_packets.ib0.htc-g003[count]']\n",
909
+ "estimated_size_bytes"
910
+ ]
911
+ }
912
+ ],
913
+ "metadata": {
914
+ "kernelspec": {
915
+ "display_name": "base",
916
+ "language": "python",
917
+ "name": "python3"
918
+ },
919
+ "language_info": {
920
+ "codemirror_mode": {
921
+ "name": "ipython",
922
+ "version": 3
923
+ },
924
+ "file_extension": ".py",
925
+ "mimetype": "text/x-python",
926
+ "name": "python",
927
+ "nbconvert_exporter": "python",
928
+ "pygments_lexer": "ipython3",
929
+ "version": "3.13.5"
930
+ }
931
+ },
932
+ "nbformat": 4,
933
+ "nbformat_minor": 5
934
+ }
meta.csv ADDED
The diff for this file is too large to render. See raw diff
 
read_memory_example.ipynb ADDED
The diff for this file is too large to render. See raw diff
 
read_network_example.ipynb ADDED
The diff for this file is too large to render. See raw diff