Browse Source

network report

tum 2 years ago
parent
commit
4be1032710

BIN
Sample.xlsx


+ 1 - 0
app/backend/urls.py

@@ -10,5 +10,6 @@ urlpatterns = [
10 10
     path('reports/', views.reports, name='reports'),
11 11
     path('service_status/', views.service_status, name='service_status'),
12 12
     path('dump_api/', views.dump_api, name='dump_api'),
13
+    path('dump_fixed_results/', views.dump_fixed_results, name='dump_fixed_results'),
13 14
     path('print_table/', views.print_table, name='print_table'),
14 15
 ]

+ 27 - 0
app/backend/views.py

@@ -249,3 +249,30 @@ def print_table(request):
249 249
 
250 250
 
251 251
     
252
+def dump_fixed_results(request):
253
+    from bson.json_util import dumps
254
+    from bson.json_util import loads
255
+    col  = db['fixed_results']
256
+    col.delete_many({})
257
+    tt = exfo.call_remote_api("/API/REST/Test/v1/TypeByName?list_all=false&size=0")
258
+    pprint(tt)
259
+    tt_json = tt.json()
260
+    temp = tt_json['result']
261
+    for t in temp:
262
+        tn = t['ids']['test_type_name']
263
+        r = exfo.call_remote_api('/API/REST/Test/v1/FixedResults/'+tn+'?sections=all&size=20&sort=verifier_id asc,time_stamp desc&time_range={"start":"1 weeks  ago","end":"now"}').json()
264
+        #pprint(r)
265
+        try:
266
+            r0 = r['result']
267
+            if len(r0) > 0:
268
+                col.insert_many(r0)
269
+        except Exception as e:
270
+            pprint(e)
271
+
272
+    # pprint(temp)
273
+    #col.insert_many(temp)
274
+    results = col.find({})
275
+    data = dumps(list(results), indent=4)
276
+    data = {'msg': 'done'}
277
+    # return HttpResponse(data, content_type='application/json')
278
+    return JsonResponse(data)

+ 7 - 7
app/network_report/settings.py

@@ -195,11 +195,11 @@ YARN_INSTALLED_APPS = (
195 195
 
196 196
 
197 197
 CELERY_BEAT_SCHEDULE = {
198
-    "dumpapi": {
199
-        "task": "backend.views.dump_api_task",
200
-        #"schedule": crontab(minute="*/1"),
201
-        # "schedule": crontab(minute="*/30"),
202
-        # "schedule": crontab(hour="17", minute="15"),
203
-        "schedule": crontab(minute="*/3", hour="17-21"),
204
-    },
198
+    # "dumpapi": {
199
+        # "task": "backend.views.dump_api_task",
200
+        # #"schedule": crontab(minute="*/1"),
201
+        # # "schedule": crontab(minute="*/30"),
202
+        # # "schedule": crontab(hour="17", minute="15"),
203
+        # "schedule": crontab(minute="*/3", hour="17-21"),
204
+    # },
205 205
 }

File diff suppressed because it is too large
+ 31365 - 0
network-result.ipynb


+ 68 - 2
network.ipynb

@@ -3,6 +3,7 @@
3 3
   {
4 4
    "cell_type": "code",
5 5
    "execution_count": 37,
6
+   "id": "93bbfffb",
6 7
    "metadata": {
7 8
     "scrolled": true
8 9
    },
@@ -27,6 +28,7 @@
27 28
   {
28 29
    "cell_type": "code",
29 30
    "execution_count": 38,
31
+   "id": "96e5adc4",
30 32
    "metadata": {
31 33
     "scrolled": false
32 34
    },
@@ -61,6 +63,7 @@
61 63
   {
62 64
    "cell_type": "code",
63 65
    "execution_count": 39,
66
+   "id": "ff046a48",
64 67
    "metadata": {},
65 68
    "outputs": [],
66 69
    "source": [
@@ -71,6 +74,7 @@
71 74
   {
72 75
    "cell_type": "code",
73 76
    "execution_count": 40,
77
+   "id": "220562c3",
74 78
    "metadata": {
75 79
     "scrolled": true
76 80
    },
@@ -94,6 +98,7 @@
94 98
   {
95 99
    "cell_type": "code",
96 100
    "execution_count": 41,
101
+   "id": "46daba6c",
97 102
    "metadata": {},
98 103
    "outputs": [
99 104
     {
@@ -114,6 +119,7 @@
114 119
   {
115 120
    "cell_type": "code",
116 121
    "execution_count": 42,
122
+   "id": "ed775449",
117 123
    "metadata": {},
118 124
    "outputs": [],
119 125
    "source": [
@@ -123,6 +129,7 @@
123 129
   {
124 130
    "cell_type": "code",
125 131
    "execution_count": 43,
132
+   "id": "1996a9ee",
126 133
    "metadata": {
127 134
     "scrolled": true
128 135
    },
@@ -145,6 +152,7 @@
145 152
   {
146 153
    "cell_type": "code",
147 154
    "execution_count": 44,
155
+   "id": "7cbc7ee0",
148 156
    "metadata": {},
149 157
    "outputs": [
150 158
     {
@@ -166,6 +174,7 @@
166 174
   {
167 175
    "cell_type": "code",
168 176
    "execution_count": null,
177
+   "id": "dc0d07cb",
169 178
    "metadata": {
170 179
     "scrolled": false
171 180
    },
@@ -179,6 +188,7 @@
179 188
   {
180 189
    "cell_type": "code",
181 190
    "execution_count": 20,
191
+   "id": "a783f2b2",
182 192
    "metadata": {},
183 193
    "outputs": [
184 194
     {
@@ -225,6 +235,7 @@
225 235
   {
226 236
    "cell_type": "code",
227 237
    "execution_count": 18,
238
+   "id": "82c17e4b",
228 239
    "metadata": {},
229 240
    "outputs": [
230 241
     {
@@ -246,6 +257,7 @@
246 257
   {
247 258
    "cell_type": "code",
248 259
    "execution_count": null,
260
+   "id": "b9bf03e8",
249 261
    "metadata": {},
250 262
    "outputs": [],
251 263
    "source": [
@@ -256,6 +268,7 @@
256 268
   {
257 269
    "cell_type": "code",
258 270
    "execution_count": 13,
271
+   "id": "c55c2608",
259 272
    "metadata": {},
260 273
    "outputs": [
261 274
     {
@@ -284,6 +297,7 @@
284 297
   {
285 298
    "cell_type": "code",
286 299
    "execution_count": 14,
300
+   "id": "954f3de0",
287 301
    "metadata": {
288 302
     "scrolled": true
289 303
    },
@@ -305,6 +319,7 @@
305 319
   {
306 320
    "cell_type": "code",
307 321
    "execution_count": 15,
322
+   "id": "addc4b16",
308 323
    "metadata": {},
309 324
    "outputs": [
310 325
     {
@@ -327,6 +342,7 @@
327 342
   {
328 343
    "cell_type": "code",
329 344
    "execution_count": null,
345
+   "id": "5fdc4a48",
330 346
    "metadata": {
331 347
     "scrolled": true
332 348
    },
@@ -338,6 +354,7 @@
338 354
   {
339 355
    "cell_type": "code",
340 356
    "execution_count": null,
357
+   "id": "b606622f",
341 358
    "metadata": {
342 359
     "scrolled": true
343 360
    },
@@ -349,6 +366,7 @@
349 366
   {
350 367
    "cell_type": "code",
351 368
    "execution_count": null,
369
+   "id": "e123b1d7",
352 370
    "metadata": {},
353 371
    "outputs": [],
354 372
    "source": [
@@ -359,6 +377,7 @@
359 377
   {
360 378
    "cell_type": "code",
361 379
    "execution_count": null,
380
+   "id": "fae5c564",
362 381
    "metadata": {
363 382
     "scrolled": true
364 383
    },
@@ -372,6 +391,7 @@
372 391
   {
373 392
    "cell_type": "code",
374 393
    "execution_count": null,
394
+   "id": "54799082",
375 395
    "metadata": {
376 396
     "scrolled": true
377 397
    },
@@ -384,6 +404,7 @@
384 404
   {
385 405
    "cell_type": "code",
386 406
    "execution_count": null,
407
+   "id": "06fbb196",
387 408
    "metadata": {
388 409
     "scrolled": true
389 410
    },
@@ -395,6 +416,7 @@
395 416
   {
396 417
    "cell_type": "code",
397 418
    "execution_count": null,
419
+   "id": "566e5a39",
398 420
    "metadata": {
399 421
     "scrolled": true
400 422
    },
@@ -406,6 +428,7 @@
406 428
   {
407 429
    "cell_type": "code",
408 430
    "execution_count": null,
431
+   "id": "fd175745",
409 432
    "metadata": {
410 433
     "scrolled": true
411 434
    },
@@ -418,6 +441,7 @@
418 441
   {
419 442
    "cell_type": "code",
420 443
    "execution_count": null,
444
+   "id": "d04bf31b",
421 445
    "metadata": {},
422 446
    "outputs": [],
423 447
    "source": [
@@ -427,6 +451,7 @@
427 451
   {
428 452
    "cell_type": "code",
429 453
    "execution_count": null,
454
+   "id": "4211ee77",
430 455
    "metadata": {
431 456
     "scrolled": true
432 457
    },
@@ -439,6 +464,7 @@
439 464
   {
440 465
    "cell_type": "code",
441 466
    "execution_count": null,
467
+   "id": "189ed063",
442 468
    "metadata": {},
443 469
    "outputs": [],
444 470
    "source": [
@@ -448,6 +474,7 @@
448 474
   {
449 475
    "cell_type": "code",
450 476
    "execution_count": null,
477
+   "id": "ba901e35",
451 478
    "metadata": {},
452 479
    "outputs": [],
453 480
    "source": [
@@ -457,6 +484,7 @@
457 484
   {
458 485
    "cell_type": "code",
459 486
    "execution_count": null,
487
+   "id": "2276d112",
460 488
    "metadata": {},
461 489
    "outputs": [],
462 490
    "source": [
@@ -466,6 +494,7 @@
466 494
   {
467 495
    "cell_type": "code",
468 496
    "execution_count": null,
497
+   "id": "aa384bc1",
469 498
    "metadata": {
470 499
     "scrolled": true
471 500
    },
@@ -477,6 +506,7 @@
477 506
   {
478 507
    "cell_type": "code",
479 508
    "execution_count": null,
509
+   "id": "986c64ca",
480 510
    "metadata": {},
481 511
    "outputs": [],
482 512
    "source": [
@@ -487,6 +517,7 @@
487 517
   {
488 518
    "cell_type": "code",
489 519
    "execution_count": null,
520
+   "id": "7c605acc",
490 521
    "metadata": {
491 522
     "scrolled": true
492 523
    },
@@ -498,6 +529,7 @@
498 529
   {
499 530
    "cell_type": "code",
500 531
    "execution_count": null,
532
+   "id": "690bc8ad",
501 533
    "metadata": {
502 534
     "scrolled": true
503 535
    },
@@ -510,6 +542,7 @@
510 542
   {
511 543
    "cell_type": "code",
512 544
    "execution_count": null,
545
+   "id": "018d4db4",
513 546
    "metadata": {
514 547
     "scrolled": true
515 548
    },
@@ -522,6 +555,7 @@
522 555
   {
523 556
    "cell_type": "code",
524 557
    "execution_count": null,
558
+   "id": "bf21ade3",
525 559
    "metadata": {
526 560
     "scrolled": true
527 561
    },
@@ -533,6 +567,7 @@
533 567
   {
534 568
    "cell_type": "code",
535 569
    "execution_count": null,
570
+   "id": "bc3d51f6",
536 571
    "metadata": {
537 572
     "scrolled": true
538 573
    },
@@ -546,6 +581,7 @@
546 581
   {
547 582
    "cell_type": "code",
548 583
    "execution_count": null,
584
+   "id": "10da50d4",
549 585
    "metadata": {},
550 586
    "outputs": [],
551 587
    "source": [
@@ -559,6 +595,7 @@
559 595
   {
560 596
    "cell_type": "code",
561 597
    "execution_count": null,
598
+   "id": "cc80c5e1",
562 599
    "metadata": {},
563 600
    "outputs": [],
564 601
    "source": [
@@ -568,6 +605,7 @@
568 605
   {
569 606
    "cell_type": "code",
570 607
    "execution_count": null,
608
+   "id": "d2ef3fd1",
571 609
    "metadata": {
572 610
     "scrolled": false
573 611
    },
@@ -580,6 +618,7 @@
580 618
   {
581 619
    "cell_type": "code",
582 620
    "execution_count": null,
621
+   "id": "9721b6d1",
583 622
    "metadata": {},
584 623
    "outputs": [],
585 624
    "source": [
@@ -589,6 +628,7 @@
589 628
   {
590 629
    "cell_type": "code",
591 630
    "execution_count": null,
631
+   "id": "a5fbfb1e",
592 632
    "metadata": {},
593 633
    "outputs": [],
594 634
    "source": [
@@ -612,6 +652,7 @@
612 652
   {
613 653
    "cell_type": "code",
614 654
    "execution_count": null,
655
+   "id": "b60cca21",
615 656
    "metadata": {},
616 657
    "outputs": [],
617 658
    "source": [
@@ -622,6 +663,7 @@
622 663
   {
623 664
    "cell_type": "code",
624 665
    "execution_count": null,
666
+   "id": "acaed425",
625 667
    "metadata": {},
626 668
    "outputs": [],
627 669
    "source": [
@@ -632,6 +674,7 @@
632 674
   {
633 675
    "cell_type": "code",
634 676
    "execution_count": null,
677
+   "id": "c7c363e7",
635 678
    "metadata": {
636 679
     "scrolled": true
637 680
    },
@@ -643,6 +686,7 @@
643 686
   {
644 687
    "cell_type": "code",
645 688
    "execution_count": null,
689
+   "id": "a87ab1b7",
646 690
    "metadata": {},
647 691
    "outputs": [],
648 692
    "source": [
@@ -653,6 +697,7 @@
653 697
   {
654 698
    "cell_type": "code",
655 699
    "execution_count": null,
700
+   "id": "49d2d652",
656 701
    "metadata": {},
657 702
    "outputs": [],
658 703
    "source": [
@@ -663,6 +708,7 @@
663 708
   {
664 709
    "cell_type": "code",
665 710
    "execution_count": null,
711
+   "id": "41c258c7",
666 712
    "metadata": {},
667 713
    "outputs": [],
668 714
    "source": [
@@ -686,6 +732,7 @@
686 732
   {
687 733
    "cell_type": "code",
688 734
    "execution_count": null,
735
+   "id": "2112d785",
689 736
    "metadata": {},
690 737
    "outputs": [],
691 738
    "source": [
@@ -696,6 +743,7 @@
696 743
   {
697 744
    "cell_type": "code",
698 745
    "execution_count": null,
746
+   "id": "9a21694d",
699 747
    "metadata": {},
700 748
    "outputs": [],
701 749
    "source": []
@@ -703,6 +751,7 @@
703 751
   {
704 752
    "cell_type": "code",
705 753
    "execution_count": null,
754
+   "id": "55d3ccb7",
706 755
    "metadata": {},
707 756
    "outputs": [],
708 757
    "source": [
@@ -712,6 +761,7 @@
712 761
   {
713 762
    "cell_type": "code",
714 763
    "execution_count": null,
764
+   "id": "072d4638",
715 765
    "metadata": {},
716 766
    "outputs": [],
717 767
    "source": [
@@ -722,6 +772,7 @@
722 772
   {
723 773
    "cell_type": "code",
724 774
    "execution_count": null,
775
+   "id": "c984e701",
725 776
    "metadata": {
726 777
     "scrolled": false
727 778
    },
@@ -734,6 +785,7 @@
734 785
   {
735 786
    "cell_type": "code",
736 787
    "execution_count": null,
788
+   "id": "c9081831",
737 789
    "metadata": {},
738 790
    "outputs": [],
739 791
    "source": [
@@ -743,6 +795,7 @@
743 795
   {
744 796
    "cell_type": "code",
745 797
    "execution_count": null,
798
+   "id": "5aa598fa",
746 799
    "metadata": {},
747 800
    "outputs": [],
748 801
    "source": [
@@ -753,6 +806,7 @@
753 806
   {
754 807
    "cell_type": "code",
755 808
    "execution_count": null,
809
+   "id": "c16df369",
756 810
    "metadata": {
757 811
     "scrolled": true
758 812
    },
@@ -764,6 +818,7 @@
764 818
   {
765 819
    "cell_type": "code",
766 820
    "execution_count": null,
821
+   "id": "dde802e6",
767 822
    "metadata": {
768 823
     "scrolled": false
769 824
    },
@@ -780,6 +835,7 @@
780 835
   {
781 836
    "cell_type": "code",
782 837
    "execution_count": null,
838
+   "id": "4b36a671",
783 839
    "metadata": {},
784 840
    "outputs": [],
785 841
    "source": [
@@ -789,6 +845,7 @@
789 845
   {
790 846
    "cell_type": "code",
791 847
    "execution_count": null,
848
+   "id": "9916d649",
792 849
    "metadata": {
793 850
     "scrolled": false
794 851
    },
@@ -804,6 +861,7 @@
804 861
   {
805 862
    "cell_type": "code",
806 863
    "execution_count": null,
864
+   "id": "024c43da",
807 865
    "metadata": {},
808 866
    "outputs": [],
809 867
    "source": [
@@ -814,6 +872,7 @@
814 872
   {
815 873
    "cell_type": "code",
816 874
    "execution_count": null,
875
+   "id": "58ad756c",
817 876
    "metadata": {
818 877
     "scrolled": true
819 878
    },
@@ -826,6 +885,7 @@
826 885
   {
827 886
    "cell_type": "code",
828 887
    "execution_count": null,
888
+   "id": "5ac35907",
829 889
    "metadata": {},
830 890
    "outputs": [],
831 891
    "source": [
@@ -836,6 +896,7 @@
836 896
   {
837 897
    "cell_type": "code",
838 898
    "execution_count": null,
899
+   "id": "1f9a585d",
839 900
    "metadata": {
840 901
     "scrolled": false
841 902
    },
@@ -857,6 +918,7 @@
857 918
   {
858 919
    "cell_type": "code",
859 920
    "execution_count": null,
921
+   "id": "7c0d9839",
860 922
    "metadata": {},
861 923
    "outputs": [],
862 924
    "source": [
@@ -867,6 +929,7 @@
867 929
   {
868 930
    "cell_type": "code",
869 931
    "execution_count": null,
932
+   "id": "956c1225",
870 933
    "metadata": {},
871 934
    "outputs": [],
872 935
    "source": [
@@ -891,6 +954,7 @@
891 954
   {
892 955
    "cell_type": "code",
893 956
    "execution_count": null,
957
+   "id": "d6efa7a5",
894 958
    "metadata": {},
895 959
    "outputs": [],
896 960
    "source": [
@@ -902,6 +966,7 @@
902 966
   {
903 967
    "cell_type": "code",
904 968
    "execution_count": null,
969
+   "id": "80181787",
905 970
    "metadata": {},
906 971
    "outputs": [],
907 972
    "source": []
@@ -909,6 +974,7 @@
909 974
   {
910 975
    "cell_type": "code",
911 976
    "execution_count": null,
977
+   "id": "0e1394e6",
912 978
    "metadata": {},
913 979
    "outputs": [],
914 980
    "source": []
@@ -916,7 +982,7 @@
916 982
  ],
917 983
  "metadata": {
918 984
   "kernelspec": {
919
-   "display_name": "Python 3",
985
+   "display_name": "Python 3 (ipykernel)",
920 986
    "language": "python",
921 987
    "name": "python3"
922 988
   },
@@ -930,7 +996,7 @@
930 996
    "name": "python",
931 997
    "nbconvert_exporter": "python",
932 998
    "pygments_lexer": "ipython3",
933
-   "version": "3.7.3"
999
+   "version": "3.10.4"
934 1000
   }
935 1001
  },
936 1002
  "nbformat": 4,

BIN
sample_1704434185.xlsx


BIN
sample_1704441131.xlsx


BIN
sample_1704441416.xlsx


BIN
sample_1704442111.xlsx


BIN
sample_1704442400.xlsx


BIN
sample_1704442540.xlsx


BIN
sample_1704442778.xlsx


BIN
sample_1704443129.xlsx


BIN
sample_1704443305.xlsx


BIN
sample_1704443666.xlsx


BIN
sample_1704516342.xlsx


BIN
sample_atp.xlsx


BIN
~$table1703516489.xlsx


BIN
~$table3.xlsx