In [1]:
import json
import datetime

In [2]:
import pandas

In [3]:
%matplotlib inline
from matplotlib import pyplot as plt
import matplotlib.ticker as mtick

In [4]:
data = [json.loads(s) for s in open("cfjs2017_2017-09-23.json").read().split("\n") if s]
data += [json.loads(s) for s in open("cfjs2017_2017-09-24.json").read().split("\n") if s]

In [5]:
def path_get(obj, *args):
    if obj and args:
        return path_get(obj.get(args[0]), *args[1:])
    if obj or isinstance(obj, (int, float)):
        return obj
    return None

In [6]:
ifaces = ["wwan0"] + ["wlan%d" % s for s in range(8)]
cols = '''ipkts
ierrs
opkts
oerrs
colls
in_octets
out_octets
in_drops
out_discards
in_unknown_protos'''.split()

absolutes = []
counters = []
for n in range(1,11):
    dev = "dev%02d" % n
    absolutes += [(dev, "dialup_device", "signal_quality")]
    for iface in ifaces:
        for field in cols:
            counters += [(dev, "interface", iface, field)]
    for d in range(1, 14):
        absolutes += [(dev, "wlan_ap_scan_force", str(d))]
    for hz in ("2g", "5g"):
        for ssid in "cfjs2017 cfjs2017_5g cfjs_lan".split():
            absolutes += [(dev, "wlan_client_count", hz, ssid)]

In [7]:
amat = [[path_get(row, *p) for p in absolutes] for row in data]
cmat = [[path_get(row, *p) for p in counters] for row in data]

In [8]:
lcol = len(cols)
ldev = len(cols)*9
wlan_io = [k+ldev*i+lcol*j for i in range(10) for j in range(1,9) for k in (5,6)]
[counters[i] for i in wlan_io]


Out[8]:
[('dev01', 'interface', 'wlan0', 'in_octets'),
 ('dev01', 'interface', 'wlan0', 'out_octets'),
 ('dev01', 'interface', 'wlan1', 'in_octets'),
 ('dev01', 'interface', 'wlan1', 'out_octets'),
 ('dev01', 'interface', 'wlan2', 'in_octets'),
 ('dev01', 'interface', 'wlan2', 'out_octets'),
 ('dev01', 'interface', 'wlan3', 'in_octets'),
 ('dev01', 'interface', 'wlan3', 'out_octets'),
 ('dev01', 'interface', 'wlan4', 'in_octets'),
 ('dev01', 'interface', 'wlan4', 'out_octets'),
 ('dev01', 'interface', 'wlan5', 'in_octets'),
 ('dev01', 'interface', 'wlan5', 'out_octets'),
 ('dev01', 'interface', 'wlan6', 'in_octets'),
 ('dev01', 'interface', 'wlan6', 'out_octets'),
 ('dev01', 'interface', 'wlan7', 'in_octets'),
 ('dev01', 'interface', 'wlan7', 'out_octets'),
 ('dev02', 'interface', 'wlan0', 'in_octets'),
 ('dev02', 'interface', 'wlan0', 'out_octets'),
 ('dev02', 'interface', 'wlan1', 'in_octets'),
 ('dev02', 'interface', 'wlan1', 'out_octets'),
 ('dev02', 'interface', 'wlan2', 'in_octets'),
 ('dev02', 'interface', 'wlan2', 'out_octets'),
 ('dev02', 'interface', 'wlan3', 'in_octets'),
 ('dev02', 'interface', 'wlan3', 'out_octets'),
 ('dev02', 'interface', 'wlan4', 'in_octets'),
 ('dev02', 'interface', 'wlan4', 'out_octets'),
 ('dev02', 'interface', 'wlan5', 'in_octets'),
 ('dev02', 'interface', 'wlan5', 'out_octets'),
 ('dev02', 'interface', 'wlan6', 'in_octets'),
 ('dev02', 'interface', 'wlan6', 'out_octets'),
 ('dev02', 'interface', 'wlan7', 'in_octets'),
 ('dev02', 'interface', 'wlan7', 'out_octets'),
 ('dev03', 'interface', 'wlan0', 'in_octets'),
 ('dev03', 'interface', 'wlan0', 'out_octets'),
 ('dev03', 'interface', 'wlan1', 'in_octets'),
 ('dev03', 'interface', 'wlan1', 'out_octets'),
 ('dev03', 'interface', 'wlan2', 'in_octets'),
 ('dev03', 'interface', 'wlan2', 'out_octets'),
 ('dev03', 'interface', 'wlan3', 'in_octets'),
 ('dev03', 'interface', 'wlan3', 'out_octets'),
 ('dev03', 'interface', 'wlan4', 'in_octets'),
 ('dev03', 'interface', 'wlan4', 'out_octets'),
 ('dev03', 'interface', 'wlan5', 'in_octets'),
 ('dev03', 'interface', 'wlan5', 'out_octets'),
 ('dev03', 'interface', 'wlan6', 'in_octets'),
 ('dev03', 'interface', 'wlan6', 'out_octets'),
 ('dev03', 'interface', 'wlan7', 'in_octets'),
 ('dev03', 'interface', 'wlan7', 'out_octets'),
 ('dev04', 'interface', 'wlan0', 'in_octets'),
 ('dev04', 'interface', 'wlan0', 'out_octets'),
 ('dev04', 'interface', 'wlan1', 'in_octets'),
 ('dev04', 'interface', 'wlan1', 'out_octets'),
 ('dev04', 'interface', 'wlan2', 'in_octets'),
 ('dev04', 'interface', 'wlan2', 'out_octets'),
 ('dev04', 'interface', 'wlan3', 'in_octets'),
 ('dev04', 'interface', 'wlan3', 'out_octets'),
 ('dev04', 'interface', 'wlan4', 'in_octets'),
 ('dev04', 'interface', 'wlan4', 'out_octets'),
 ('dev04', 'interface', 'wlan5', 'in_octets'),
 ('dev04', 'interface', 'wlan5', 'out_octets'),
 ('dev04', 'interface', 'wlan6', 'in_octets'),
 ('dev04', 'interface', 'wlan6', 'out_octets'),
 ('dev04', 'interface', 'wlan7', 'in_octets'),
 ('dev04', 'interface', 'wlan7', 'out_octets'),
 ('dev05', 'interface', 'wlan0', 'in_octets'),
 ('dev05', 'interface', 'wlan0', 'out_octets'),
 ('dev05', 'interface', 'wlan1', 'in_octets'),
 ('dev05', 'interface', 'wlan1', 'out_octets'),
 ('dev05', 'interface', 'wlan2', 'in_octets'),
 ('dev05', 'interface', 'wlan2', 'out_octets'),
 ('dev05', 'interface', 'wlan3', 'in_octets'),
 ('dev05', 'interface', 'wlan3', 'out_octets'),
 ('dev05', 'interface', 'wlan4', 'in_octets'),
 ('dev05', 'interface', 'wlan4', 'out_octets'),
 ('dev05', 'interface', 'wlan5', 'in_octets'),
 ('dev05', 'interface', 'wlan5', 'out_octets'),
 ('dev05', 'interface', 'wlan6', 'in_octets'),
 ('dev05', 'interface', 'wlan6', 'out_octets'),
 ('dev05', 'interface', 'wlan7', 'in_octets'),
 ('dev05', 'interface', 'wlan7', 'out_octets'),
 ('dev06', 'interface', 'wlan0', 'in_octets'),
 ('dev06', 'interface', 'wlan0', 'out_octets'),
 ('dev06', 'interface', 'wlan1', 'in_octets'),
 ('dev06', 'interface', 'wlan1', 'out_octets'),
 ('dev06', 'interface', 'wlan2', 'in_octets'),
 ('dev06', 'interface', 'wlan2', 'out_octets'),
 ('dev06', 'interface', 'wlan3', 'in_octets'),
 ('dev06', 'interface', 'wlan3', 'out_octets'),
 ('dev06', 'interface', 'wlan4', 'in_octets'),
 ('dev06', 'interface', 'wlan4', 'out_octets'),
 ('dev06', 'interface', 'wlan5', 'in_octets'),
 ('dev06', 'interface', 'wlan5', 'out_octets'),
 ('dev06', 'interface', 'wlan6', 'in_octets'),
 ('dev06', 'interface', 'wlan6', 'out_octets'),
 ('dev06', 'interface', 'wlan7', 'in_octets'),
 ('dev06', 'interface', 'wlan7', 'out_octets'),
 ('dev07', 'interface', 'wlan0', 'in_octets'),
 ('dev07', 'interface', 'wlan0', 'out_octets'),
 ('dev07', 'interface', 'wlan1', 'in_octets'),
 ('dev07', 'interface', 'wlan1', 'out_octets'),
 ('dev07', 'interface', 'wlan2', 'in_octets'),
 ('dev07', 'interface', 'wlan2', 'out_octets'),
 ('dev07', 'interface', 'wlan3', 'in_octets'),
 ('dev07', 'interface', 'wlan3', 'out_octets'),
 ('dev07', 'interface', 'wlan4', 'in_octets'),
 ('dev07', 'interface', 'wlan4', 'out_octets'),
 ('dev07', 'interface', 'wlan5', 'in_octets'),
 ('dev07', 'interface', 'wlan5', 'out_octets'),
 ('dev07', 'interface', 'wlan6', 'in_octets'),
 ('dev07', 'interface', 'wlan6', 'out_octets'),
 ('dev07', 'interface', 'wlan7', 'in_octets'),
 ('dev07', 'interface', 'wlan7', 'out_octets'),
 ('dev08', 'interface', 'wlan0', 'in_octets'),
 ('dev08', 'interface', 'wlan0', 'out_octets'),
 ('dev08', 'interface', 'wlan1', 'in_octets'),
 ('dev08', 'interface', 'wlan1', 'out_octets'),
 ('dev08', 'interface', 'wlan2', 'in_octets'),
 ('dev08', 'interface', 'wlan2', 'out_octets'),
 ('dev08', 'interface', 'wlan3', 'in_octets'),
 ('dev08', 'interface', 'wlan3', 'out_octets'),
 ('dev08', 'interface', 'wlan4', 'in_octets'),
 ('dev08', 'interface', 'wlan4', 'out_octets'),
 ('dev08', 'interface', 'wlan5', 'in_octets'),
 ('dev08', 'interface', 'wlan5', 'out_octets'),
 ('dev08', 'interface', 'wlan6', 'in_octets'),
 ('dev08', 'interface', 'wlan6', 'out_octets'),
 ('dev08', 'interface', 'wlan7', 'in_octets'),
 ('dev08', 'interface', 'wlan7', 'out_octets'),
 ('dev09', 'interface', 'wlan0', 'in_octets'),
 ('dev09', 'interface', 'wlan0', 'out_octets'),
 ('dev09', 'interface', 'wlan1', 'in_octets'),
 ('dev09', 'interface', 'wlan1', 'out_octets'),
 ('dev09', 'interface', 'wlan2', 'in_octets'),
 ('dev09', 'interface', 'wlan2', 'out_octets'),
 ('dev09', 'interface', 'wlan3', 'in_octets'),
 ('dev09', 'interface', 'wlan3', 'out_octets'),
 ('dev09', 'interface', 'wlan4', 'in_octets'),
 ('dev09', 'interface', 'wlan4', 'out_octets'),
 ('dev09', 'interface', 'wlan5', 'in_octets'),
 ('dev09', 'interface', 'wlan5', 'out_octets'),
 ('dev09', 'interface', 'wlan6', 'in_octets'),
 ('dev09', 'interface', 'wlan6', 'out_octets'),
 ('dev09', 'interface', 'wlan7', 'in_octets'),
 ('dev09', 'interface', 'wlan7', 'out_octets'),
 ('dev10', 'interface', 'wlan0', 'in_octets'),
 ('dev10', 'interface', 'wlan0', 'out_octets'),
 ('dev10', 'interface', 'wlan1', 'in_octets'),
 ('dev10', 'interface', 'wlan1', 'out_octets'),
 ('dev10', 'interface', 'wlan2', 'in_octets'),
 ('dev10', 'interface', 'wlan2', 'out_octets'),
 ('dev10', 'interface', 'wlan3', 'in_octets'),
 ('dev10', 'interface', 'wlan3', 'out_octets'),
 ('dev10', 'interface', 'wlan4', 'in_octets'),
 ('dev10', 'interface', 'wlan4', 'out_octets'),
 ('dev10', 'interface', 'wlan5', 'in_octets'),
 ('dev10', 'interface', 'wlan5', 'out_octets'),
 ('dev10', 'interface', 'wlan6', 'in_octets'),
 ('dev10', 'interface', 'wlan6', 'out_octets'),
 ('dev10', 'interface', 'wlan7', 'in_octets'),
 ('dev10', 'interface', 'wlan7', 'out_octets')]

異常値を除去。


In [9]:
#mat[176][724] = None
#mat[176][726] = None
#mat[176][678] = None
for i in range(len(counters)):
    cmat[120][i] = None
    cmat[124][i] = None
    cmat[177][i] = None
    cmat[287][i] = None
    cmat[329][i] = None
    cmat[387][i] = None
    cmat[409][i] = None
    cmat[463][i] = None
for i in range(550,609):
    cmat[176][i] = None
for i in range(540,609):
    cmat[238][i] = None
for i in range(540,609):
    cmat[239][i] = None
for i in range(540,609):
    cmat[240][i] = None
for i in range(90, 789):
    cmat[462][i] = None
for i in range(90,339):
    cmat[488][i] = None

In [10]:
a = pandas.DataFrame(amat)
c = pandas.DataFrame(cmat)

In [11]:
tm = [datetime.datetime.strptime(row["@timestamp"], "%Y-%m-%dT%H:%M:%S.%f") for row in data]
t = pandas.Series(tm)

素朴にプロット


In [12]:
plt.figure(figsize=(15,8))
plt.gca().yaxis.set_major_formatter(mtick.FormatStrFormatter('%.0f'))
x=plt.plot(t,c)



In [13]:
c2=c.fillna(method="ffill").fillna(0).diff()

In [14]:
for i in range(c2.shape[0]):
    for j in range(c2.shape[1]):
        if c2.iloc[i,j] < 0:
            print(i,j,c2.iloc[i,j])


109 90 -239.0
109 92 -210.0
109 95 -72154.0
109 96 -83902.0
109 98 -1.0
178 540 -4799479.0
178 542 -3641394.0
178 543 -2637.0
178 545 -6079237431.0
178 546 -634842520.0
178 550 -269217.0
178 552 -461293.0
178 555 -51297945.0
178 556 -550300171.0
178 558 -13091.0
178 590 -2813371.0
178 592 -3647929.0
178 595 -501334859.0
178 596 -4641986674.0
178 598 -13355.0
178 600 -612985.0
178 602 -750822.0
178 605 -88386251.0
178 606 -888854074.0
178 608 -8545.0
241 540 -2515461.0
241 542 -2093180.0
241 543 -447.0
241 545 -2378782405.0
241 546 -683006421.0
241 550 -537350.0
241 552 -678602.0
241 555 -182004326.0
241 556 -660569534.0
241 558 -9876.0
241 590 -1383846.0
241 592 -1619606.0
241 595 -447639406.0
241 596 -1506714963.0
241 598 -14177.0
241 600 -223309.0
241 602 -290710.0
241 605 -58949433.0
241 606 -224584514.0
241 608 -11150.0
364 450 -811521.0
364 452 -620352.0
364 455 -879416187.0
364 456 -274964241.0
364 460 -44388.0
364 462 -59029.0
364 465 -15060086.0
364 466 -41246238.0
364 468 -15642.0
364 500 -552569.0
364 502 -712326.0
364 505 -222312195.0
364 506 -826583845.0
364 508 -17128.0
364 510 -38308.0
364 512 -35477.0
364 515 -34505706.0
364 516 -13582003.0
364 518 -20717.0
385 450 -142526.0
385 452 -115973.0
385 455 -156711480.0
385 456 -57620270.0
385 460 -88291.0
385 462 -105576.0
385 465 -52919497.0
385 466 -119166830.0
385 468 -461.0
385 500 -26687.0
385 502 -34508.0
385 505 -4014078.0
385 506 -36640789.0
385 508 -368.0
385 510 -309.0
385 512 -1457.0
385 515 -36579.0
385 516 -287339.0
385 518 -241.0
393 810 -1417.0
393 812 -1304.0
393 815 -643089.0
393 816 -281699.0
393 820 -583.0
393 822 -663.0
393 825 -78586.0
393 826 -337084.0
393 828 -78.0
393 860 -655.0
393 862 -594.0
393 865 -159533.0
393 866 -275876.0
393 868 -32.0
396 190 -61496.0
396 192 -88234.0
396 195 -36126694.0
396 196 -49914069.0
396 198 -99334.0
396 230 -2999405.0
396 232 -3730036.0
396 235 -770282445.0
396 236 -4097267048.0
396 238 -4400.0
396 240 -980398.0
396 242 -1473614.0
396 245 -124459193.0
396 246 -1684805660.0
396 248 -8118.0
397 180 -5158092.0
397 182 -3922207.0
397 185 -5817601553.0
397 186 -928198997.0
397 188 -5.0
397 360 -858114.0
397 362 -684320.0
397 365 -857002173.0
397 366 -288434633.0
397 368 -5.0
397 370 -271561.0
397 372 -332464.0
397 375 -107351012.0
397 376 -361403701.0
397 378 -7679.0
397 410 -351216.0
397 412 -446232.0
397 415 -158886333.0
397 416 -448875168.0
397 418 -8703.0
397 420 -39731.0
397 422 -40800.0
397 425 -8098122.0
397 426 -34703004.0
397 428 -15297.0
398 270 -803213.0
398 272 -737151.0
398 275 -851825355.0
398 276 -206514022.0
398 278 -4.0
398 280 -54427.0
398 282 -47503.0
398 285 -46965718.0
398 286 -30288636.0
398 288 -9011.0
398 320 -590646.0
398 322 -640376.0
398 325 -133230972.0
398 326 -751930601.0
398 328 -3308.0
398 330 -63501.0
398 332 -72746.0
398 335 -11398153.0
398 336 -56788513.0
398 338 -7079.0
402 450 -114476.0
402 452 -110438.0
402 455 -83625920.0
402 456 -64490212.0
402 458 -1.0
402 460 -20710.0
402 462 -19380.0
402 465 -18281533.0
402 466 -8757575.0
402 468 -1090.0
402 500 -94107.0
402 502 -98853.0
402 505 -46963852.0
402 506 -80470681.0
402 508 -1000.0
402 510 -390.0
402 512 -424.0
402 515 -67089.0
402 516 -779067.0
402 518 -3955.0
408 270 -249415.0
408 272 -233503.0
408 275 -224638061.0
408 276 -135968059.0
408 280 -59000.0
408 282 -80213.0
408 285 -21432340.0
408 286 -90392167.0
408 288 -1721.0
408 320 -118211.0
408 322 -114663.0
408 325 -71709330.0
408 326 -85340151.0
408 328 -686.0
408 330 -58966.0
408 332 -58155.0
408 335 -42709848.0
408 336 -48864224.0
408 338 -2967.0
412 360 -798393.0
412 362 -586252.0
412 363 -387.0
412 365 -967453488.0
412 366 -90989617.0
412 370 -220856.0
412 372 -345809.0
412 375 -25795549.0
412 376 -476909038.0
412 378 -1315.0
412 410 -349730.0
412 412 -432552.0
412 415 -60492834.0
412 416 -467162187.0
412 418 -1083.0
412 420 -26515.0
412 422 -33615.0
412 425 -6117958.0
412 426 -28022646.0
412 428 -4038.0
416 540 -70241.0
416 542 -53626.0
416 545 -56359859.0
416 546 -17293944.0
416 548 -7.0
416 550 -4936.0
416 552 -6673.0
416 555 -784009.0
416 556 -6064485.0
416 558 -444.0
416 590 -1123.0
416 592 -8844.0
416 595 -4729795.0
416 596 -8911342.0
416 598 -713.0
416 600 -1026.0
416 602 -836.0
416 605 -189639.0
416 606 -574935.0
416 608 -2258.0
417 270 -386810.0
417 272 -287713.0
417 275 -410781311.0
417 276 -102984634.0
417 278 -1.0
417 280 -70338.0
417 282 -86419.0
417 285 -26788820.0
417 286 -89241592.0
417 288 -2456.0
417 320 -205156.0
417 322 -264668.0
417 325 -72061488.0
417 326 -261403647.0
417 328 -1383.0
417 330 -26214.0
417 332 -57170.0
417 335 -5094131.0
417 336 -61666816.0
417 338 -1789.0
418 556 -11697.0
418 558 -222.0
418 592 -7470.0
418 596 -27963213.0
418 598 -5.0
418 602 -285.0
433 820 -462002.0
433 822 -630110.0
433 825 -82984870.0
433 826 -754291802.0
433 828 -559.0
433 860 -1186426.0
433 862 -2686905.0
433 865 -101182663.0
433 866 -3942105674.0
433 868 -916.0
434 810 -3223884.0
434 812 -1586542.0
434 815 -4561408774.0
434 816 -180415325.0
442 630 -7203923.0
442 632 -6233460.0
442 633 -156.0
442 635 -7312212993.0
442 636 -2794174519.0
442 638 -3.0
442 640 -631424.0
442 642 -809419.0
442 645 -297026052.0
442 646 -817680157.0
442 648 -35424.0
442 680 -5075370.0
442 682 -5645750.0
442 685 -2357538313.0
442 686 -5716428543.0
442 688 -22965.0
442 690 -574293.0
442 692 -794447.0
442 695 -138741093.0
442 696 -779329809.0
442 698 -19743.0
445 640 -2418.0
445 642 -3446.0
445 645 -227067.0
445 646 -3112370.0
445 648 -342.0
445 680 -3910.0
445 682 -4640.0
445 685 -628563.0
445 686 -4703564.0
445 688 -175.0
445 690 -3773.0
445 692 -4970.0
445 695 -322343.0
445 696 -6030361.0
445 698 -37.0
464 90 -4064392.0
464 92 -3402103.0
464 95 -3994992658.0
464 96 -1558747071.0
464 98 -3.0
464 100 -209165.0
464 102 -278691.0
464 105 -34418444.0
464 106 -269611501.0
464 108 -9227.0
464 140 -2255999.0
464 142 -2681114.0
464 145 -1272968869.0
464 146 -2466904139.0
464 148 -7845.0
464 150 -929211.0
464 152 -1096438.0
464 155 -238365765.0
464 156 -1257770043.0
464 158 -7549.0
464 720 -6230944.0
464 722 -4539418.0
464 723 -950.0
464 725 -6291866890.0
464 726 -1331719458.0
464 728 -3.0
464 730 -594200.0
464 732 -752735.0
464 735 -138634752.0
464 736 -669381172.0
464 738 -44856.0
464 770 -3278021.0
464 772 -4549431.0
464 775 -1063722599.0
464 776 -4593174253.0
464 778 -38881.0
464 780 -764135.0
464 782 -1031162.0
464 785 -131919686.0
464 786 -1049946295.0
464 788 -46662.0
468 90 -53309.0
468 92 -31293.0
468 95 -60859717.0
468 96 -2869889.0
468 98 -2.0
468 100 -2505.0
468 102 -2424.0
468 105 -597249.0
468 106 -1020668.0
468 108 -909.0
468 140 -30817.0
468 142 -52824.0
468 145 -4909292.0
468 146 -64430318.0
468 148 -344.0
468 150 -1987.0
468 152 -1394.0
468 158 -2306.0
489 270 -2486864.0
489 272 -2423128.0
489 275 -2736898921.0
489 276 -1141771384.0
489 280 -303513.0
489 282 -234752.0
489 285 -211501836.0
489 286 -107160757.0
489 288 -18546.0
489 320 -1712843.0
489 322 -1576945.0
489 325 -780546480.0
489 326 -1771334564.0
489 328 -8949.0
489 330 -470720.0
489 332 -777009.0
489 335 -153742417.0
489 336 -865765608.0
489 338 -6336.0

カウンターの調整をしてプロット

counter の wrap-around や、リブートによる counter reset などで数値が巻き戻ることがある。ざっくりといって、負数は 0 にしてしまえばよい。


In [15]:
c2[c2<0] = 0

In [16]:
plt.figure(figsize=(15,8))
plt.gca().yaxis.set_major_formatter(mtick.FormatStrFormatter('%.0f'))
x=plt.plot(t, c2.iloc[:,wlan_io].cumsum())



In [17]:
plt.figure(figsize=(15,8))
plt.gca().yaxis.set_major_formatter(mtick.FormatStrFormatter('%.0f'))
x=plt.plot(t, c2.iloc[:,wlan_io]/300*8)


デバイスごとに合算(上り下り総和)


In [18]:
plt.figure(figsize=(15,8))
plt.gca().yaxis.set_major_formatter(mtick.FormatStrFormatter('%.0f'))
c3 = pandas.DataFrame([c2.iloc[:,wlan_io[16*i:16*(i+1)]].sum(axis=1).cumsum() for i in range(10)])
x = plt.plot(tm, c3.T)



In [19]:
plt.figure(figsize=(15,8))
plt.gca().yaxis.set_major_formatter(mtick.FormatStrFormatter('%.0f'))
c3 = pandas.DataFrame([c2.iloc[:,wlan_io[16*i:16*(i+1)]].sum(axis=1)/300*8 for i in range(10)])
x = plt.plot(tm, c3.T)


Minecraft ワークショップは 10Mbps 程度見込んでおく感じか。

上り下り

普通に下りが支配的。ただ、上りと下りが両方同程度になっている時間帯もあるのが興味深い。


In [20]:
plt.figure(figsize=(15,8))
plt.gca().yaxis.set_major_formatter(mtick.FormatStrFormatter('%.0f'))
c4 = pandas.concat([c2.iloc[:,wlan_io[0:160:2]].sum(axis=1), c2.iloc[:,wlan_io[1:160:2]].sum(axis=1)], axis=1)
x=plt.plot(tm, c4.cumsum())



In [21]:
plt.figure(figsize=(15,8))
plt.gca().yaxis.set_major_formatter(mtick.FormatStrFormatter('%.0f'))
c4 = pandas.concat([c2.iloc[:,wlan_io[0:160:2]].sum(axis=1), c2.iloc[:,wlan_io[1:160:2]].sum(axis=1)], axis=1)
x=plt.plot(tm, c4/300*8)


総合計


In [22]:
plt.figure(figsize=(15,8))
plt.gca().yaxis.set_major_formatter(mtick.FormatStrFormatter('%.0f'))
x=plt.plot(t, c2.iloc[:,wlan_io].cumsum().sum(axis=1))



In [23]:
"{:,}".format(list(c2.iloc[:,wlan_io].cumsum().sum(axis=1))[-1])


Out[23]:
'78,804,531,762.0'

これに別途数えていない部分で 4.5 G 使用していたので、合計 83 G 程度使ったようだ。やはり 2 日目のほうがおとなしい。


In [24]:
plt.figure(figsize=(15,8))
plt.gca().yaxis.set_major_formatter(mtick.FormatStrFormatter('%.0f'))
x=plt.plot(t, c2.iloc[:,wlan_io].cumsum().sum(axis=1).diff()/300*8)


ピークで 40Mbps 以上出てるので、ADSL だとダメだったかもね。


In [ ]: