@@ -429,7 +429,12 @@ def clock_entries_plot(type, DS,DE,BS,BE):
429
429
430
430
431
431
## Sync Size Transferred
432
- def sync_paper4 ():
432
+ def sync_paper4 (
433
+ types = ['hhh' ,'hlh' ,'lhh' ,'llh' ,'hhl' ,'hll' ,'lhl' ,'lll' ],
434
+ # ['hhh','hhl','hlh','hll','lhh','lhl','llh','lll'],
435
+ types2 = ['hh' ,'lh' ,'hl' ,'ll' ],
436
+ # ['hh','hl','lh','ll'],
437
+ filename_ext = '' ):
433
438
434
439
# Basic
435
440
basic_mt = OrderedDict ()
@@ -470,9 +475,7 @@ def sync_paper4():
470
475
final_offset = 0
471
476
472
477
473
- # types = ['hhh']
474
- types = ['hhh' ,'hlh' ,'lhh' ,'llh' ,'hhl' ,'hll' ,'lhl' ,'lll' ]
475
- # types = ['hhh','hhl','hlh','hll','lhh','lhl','llh','lll']
478
+ # types = ['hhh','hlh','lhh','llh','hhl','hll','lhl','lll']
476
479
for t in types :
477
480
change_current_basic (cluster_path + 'cluster_basic/sync_' + t + '/' )
478
481
@@ -504,9 +507,7 @@ def sync_paper4():
504
507
basic_total [t ] = (basic_ctx [t ][BS [t ]:BE [t ],10 ] + basic_md [t ][BS [t ]:BE [t ],10 ] + basic_pl [t ][BS [t ]:BE [t ],10 ])
505
508
506
509
507
- types2 = ['hh' ,'lh' ,'hl' ,'ll' ]
508
- # types2 = ['hh','hl','lh','ll']
509
- # types2 = ['hh','hl']
510
+ # types2 = ['hh','lh','hl','ll']
510
511
for t in types2 :
511
512
change_current_dotted (cluster_path + 'cluster_dotted/sync_' + t + '/' )
512
513
@@ -587,7 +588,7 @@ def sync_paper4():
587
588
# plt.xlim(xmin=-5)
588
589
# plt.xlim(xmax=(BE['hhh']-BS['hhh'])*5 - 40)
589
590
# plt.ylim(ymin=-0.5)
590
- pp = PdfPages (test_path + 'sync_size_bar_abs_paper.pdf' )
591
+ pp = PdfPages (test_path + 'sync_size_bar_abs_paper' + filename_ext + ' .pdf' )
591
592
pp .savefig ()
592
593
pp .close ()
593
594
@@ -628,7 +629,7 @@ def sync_paper4():
628
629
# plt.xlim(xmin=-5)
629
630
# plt.xlim(xmax=(BE['hhh']-BS['hhh'])*5 - 40)
630
631
# plt.ylim(ymin=-0.5)
631
- pp = PdfPages (test_path + 'sync_size_pct_bar_paper.pdf' )
632
+ pp = PdfPages (test_path + 'sync_size_pct_bar_paper' + filename_ext + ' .pdf' )
632
633
pp .savefig ()
633
634
pp .close ()
634
635
@@ -667,7 +668,7 @@ def sync_paper4():
667
668
# plt.xlim(xmin=-5)
668
669
# plt.xlim(xmax=(BE['hhh']-BS['hhh'])*5 - 40)
669
670
# plt.ylim(ymin=-0.5)
670
- pp = PdfPages (test_path + 'sync_size_pct_bar_ctx_paper.pdf' )
671
+ pp = PdfPages (test_path + 'sync_size_pct_bar_ctx_paper' + filename_ext + ' .pdf' )
671
672
pp .savefig ()
672
673
pp .close ()
673
674
@@ -707,7 +708,7 @@ def sync_paper4():
707
708
# plt.xlim(xmin=-5)
708
709
# plt.xlim(xmax=(BE['hhh']-BS['hhh'])*5 - 40)
709
710
# plt.ylim(ymin=-0.5)
710
- pp = PdfPages (test_path + 'sync_size_pct_bar_md_paper.pdf' )
711
+ pp = PdfPages (test_path + 'sync_size_pct_bar_md_paper' + filename_ext + ' .pdf' )
711
712
pp .savefig ()
712
713
pp .close ()
713
714
@@ -740,7 +741,7 @@ def sync_paper4():
740
741
plt .xlim (xmin = - 5 )
741
742
plt .xlim (xmax = (BE ['hhh' ]- BS ['hhh' ])* 5 )
742
743
plt .ylim (ymin = - 5 )
743
- pp = PdfPages (test_path + 'sync_size_basic_paper.pdf' )
744
+ pp = PdfPages (test_path + 'sync_size_basic_paper' + filename_ext + ' .pdf' )
744
745
pp .savefig ()
745
746
pp .close ()
746
747
@@ -758,9 +759,9 @@ def sync_paper4():
758
759
plt .legend (loc = 'upper right' )
759
760
# plt.ylim((-1,62))
760
761
plt .xlim (xmin = - 5 )
761
- plt .xlim (xmax = (DE ['hh' ] - DS ['hh' ])* 5 )
762
+ plt .xlim (xmax = (DE [types2 [ 0 ]] - DS [types2 [ 0 ] ])* 5 )
762
763
plt .ylim (ymin = - 5 )
763
- pp = PdfPages (test_path + 'sync_size_dotted_paper.pdf' )
764
+ pp = PdfPages (test_path + 'sync_size_dotted_paper' + filename_ext + ' .pdf' )
764
765
pp .savefig ()
765
766
pp .close ()
766
767
@@ -828,7 +829,12 @@ def sync_size_plot(type, DS,DE,BS,BE):
828
829
829
830
830
831
## Repair Latency
831
- def sync_paper3 ():
832
+ def sync_paper3 (
833
+ types = ['hhh' ,'hhl' ,'hlh' ,'hll' ,'lhh' ,'lhl' ,'llh' ,'lll' ],
834
+ types2 = ['hh' ,'hl' ,'lh' ,'ll' ],
835
+ filename_ext = '' ):
836
+
837
+
832
838
basic = {}
833
839
basicX = {}
834
840
basicY = {}
@@ -840,7 +846,7 @@ def sync_paper3():
840
846
dottedY2 = {}
841
847
dotted_ecdf = {}
842
848
843
- types = ['hhh' ,'hhl' ,'hlh' ,'hll' ,'lhh' ,'lhl' ,'llh' ,'lll' ]
849
+ # types = ['hhh','hhl','hlh','hll','lhh','lhl','llh','lll']
844
850
for t in types :
845
851
change_current_basic (cluster_path + 'cluster_basic/sync_' + t + '/' )
846
852
basic [t ] = load_cluster_basic_csv ('write-latency_gauge.csv' , False )
@@ -849,7 +855,7 @@ def sync_paper3():
849
855
basicX [t ] = np .linspace (min (basicY [t ]), max (basicY [t ]))
850
856
basicY2 [t ] = basic_ecdf [t ](basicX [t ])
851
857
852
- types2 = ['hh' ,'hl' ,'lh' ,'ll' ]
858
+ # types2 = ['hh','hl','lh','ll']
853
859
for t in types2 :
854
860
change_current_dotted (cluster_path + 'cluster_dotted/sync_' + t + '/' )
855
861
dotted [t ] = load_cluster_dotted_csv ('write-latency_gauge.csv' , False )
@@ -869,7 +875,8 @@ def sync_paper3():
869
875
# plt.title("10000 ms Sync Interval, 100% Replication Loss")
870
876
t1 = 'hhh'
871
877
t2 = 'lhh'
872
- t3 = 'hh'
878
+ # t3 = 'hh'
879
+ t3 = types2 [0 ]
873
880
plt .step (basicX [t1 ]/ 1000.0 , basicY2 [t1 ], label = "BasicDB, High MT/Leaf Ratio" , lw = l , marker = ms [0 ], alpha = 0.6 , color = 'b' )
874
881
plt .step (basicX [t2 ]/ 1000.0 , basicY2 [t2 ], label = "BasicDB, Low MT/Leaf Ratio" , lw = l , marker = ms [1 ], alpha = 0.6 , color = 'r' )
875
882
plt .step (dottedX [t3 ]/ 1000.0 , dottedY2 [t3 ], label = "DottedDB" , lw = l , marker = ms [3 ], alpha = 0.6 , color = 'g' )
@@ -879,7 +886,7 @@ def sync_paper3():
879
886
plt .xlim (xmin = - 0.5 )
880
887
plt .xlim (xmax = 990 )
881
888
plt .ylim (ymax = 1.05 )
882
- pp = PdfPages (test_path + 'repair_latency_hh_paper.pdf' )
889
+ pp = PdfPages (test_path + 'repair_latency_hh_paper' + filename_ext + ' .pdf' )
883
890
pp .savefig ()
884
891
pp .close ()
885
892
@@ -891,7 +898,8 @@ def sync_paper3():
891
898
# plt.title("10000 ms Sync Interval, 20% Replication Loss")
892
899
t1 = 'hhl'
893
900
t2 = 'lhl'
894
- t3 = 'hl'
901
+ # t3 = 'hl'
902
+ t3 = types2 [1 ]
895
903
plt .step (basicX [t1 ]/ 1000.0 , basicY2 [t1 ], label = "BasicDB, High MT/Leaf Ratio" , lw = l , marker = ms [0 ], alpha = 0.6 , color = 'b' )
896
904
plt .step (basicX [t2 ]/ 1000.0 , basicY2 [t2 ], label = "BasicDB, Low MT/Leaf Ratio" , lw = l , marker = ms [1 ], alpha = 0.6 , color = 'r' )
897
905
plt .step (dottedX [t3 ]/ 1000.0 , dottedY2 [t3 ], label = "DottedDB" , lw = l , marker = ms [3 ], alpha = 0.6 , color = 'g' )
@@ -901,7 +909,7 @@ def sync_paper3():
901
909
plt .xlim (xmin = - 0.5 )
902
910
plt .xlim (xmax = 195 )
903
911
plt .ylim (ymax = 1.05 )
904
- pp = PdfPages (test_path + 'repair_latency_hl_paper.pdf' )
912
+ pp = PdfPages (test_path + 'repair_latency_hl_paper' + filename_ext + ' .pdf' )
905
913
pp .savefig ()
906
914
pp .close ()
907
915
@@ -913,7 +921,8 @@ def sync_paper3():
913
921
# plt.title("100 ms Sync Interval, 100% Replication Loss")
914
922
t1 = 'hlh'
915
923
t2 = 'llh'
916
- t3 = 'lh'
924
+ # t3 = 'lh'
925
+ t3 = types2 [2 ]
917
926
plt .step (basicX [t1 ]/ 1000.0 , basicY2 [t1 ], label = "BasicDB, High MT/Leaf Ratio" , lw = l , marker = ms [0 ], alpha = 0.6 , color = 'b' )
918
927
plt .step (basicX [t2 ]/ 1000.0 , basicY2 [t2 ], label = "BasicDB, Low MT/Leaf Ratio" , lw = l , marker = ms [1 ], alpha = 0.6 , color = 'r' )
919
928
plt .step (dottedX [t3 ]/ 1000.0 , dottedY2 [t3 ], label = "DottedDB" , lw = l , marker = ms [3 ], alpha = 0.6 , color = 'g' )
@@ -923,7 +932,7 @@ def sync_paper3():
923
932
plt .xlim (xmin = - 0.5 )
924
933
plt .xlim (xmax = 790 )
925
934
plt .ylim (ymax = 1.05 )
926
- pp = PdfPages (test_path + 'repair_latency_lh_paper.pdf' )
935
+ pp = PdfPages (test_path + 'repair_latency_lh_paper' + filename_ext + ' .pdf' )
927
936
pp .savefig ()
928
937
pp .close ()
929
938
@@ -935,7 +944,8 @@ def sync_paper3():
935
944
# plt.title("100 ms Sync Interval, 20% Replication Loss")
936
945
t1 = 'hll'
937
946
t2 = 'lll'
938
- t3 = 'll'
947
+ # t3 = 'll'
948
+ t3 = types2 [3 ]
939
949
plt .step (basicX [t1 ]/ 1000.0 , basicY2 [t1 ], label = "BasicDB, High MT/Leaf Ratio" , lw = l , marker = ms [0 ], alpha = 0.6 , color = 'b' )
940
950
plt .step (basicX [t2 ]/ 1000.0 , basicY2 [t2 ], label = "BasicDB, Low MT/Leaf Ratio" , lw = l , marker = ms [1 ], alpha = 0.6 , color = 'r' )
941
951
plt .step (dottedX [t3 ]/ 1000.0 , dottedY2 [t3 ], label = "DottedDB" , lw = l , marker = ms [3 ], alpha = 0.6 , color = 'g' )
@@ -947,7 +957,7 @@ def sync_paper3():
947
957
plt .xlim (xmin = - 0.5 )
948
958
plt .xlim (xmax = 68 )
949
959
plt .ylim (ymax = 1.05 )
950
- pp = PdfPages (test_path + 'repair_latency_ll_paper.pdf' )
960
+ pp = PdfPages (test_path + 'repair_latency_ll_paper' + filename_ext + ' .pdf' )
951
961
pp .savefig ()
952
962
pp .close ()
953
963
@@ -1371,7 +1381,12 @@ def perf_paper():
1371
1381
1372
1382
1373
1383
## Hit Ratio
1374
- def sync_paper1 ():
1384
+ def sync_paper1 (
1385
+ types = ['hhh' ,'hhl' ,'hlh' ,'hll' ,'lhh' ,'lhl' ,'llh' ,'lll' ],
1386
+ types2 = ['hh' ,'hl' ,'lh' ,'ll' ],
1387
+ filename_ext = '' ):
1388
+
1389
+
1375
1390
initial_offset = - 1
1376
1391
final_offset = 0
1377
1392
@@ -1398,7 +1413,7 @@ def sync_paper1():
1398
1413
dotted_tm = {}
1399
1414
dotted3 = {}
1400
1415
1401
- types = ['hhh' ,'hhl' ,'hlh' ,'hll' ,'lhh' ,'lhl' ,'llh' ,'lll' ]
1416
+ # types = ['hhh','hhl','hlh','hll','lhh','lhl','llh','lll']
1402
1417
for t in types :
1403
1418
change_current_basic (cluster_path + 'cluster_basic/sync_' + t + '/' )
1404
1419
@@ -1417,7 +1432,7 @@ def sync_paper1():
1417
1432
basic_pct [t ] = np .array (map (lambda x : min (x ,100 ), basic_pct0 [t ]))
1418
1433
1419
1434
1420
- types2 = ['hh' ,'hl' ,'lh' ,'ll' ]
1435
+ # types2 = ['hh','hl','lh','ll']
1421
1436
for t in types2 :
1422
1437
change_current_dotted (cluster_path + 'cluster_dotted/sync_' + t + '/' )
1423
1438
@@ -1455,7 +1470,7 @@ def sync_paper1():
1455
1470
plt .ylim ((- 1 ,62 ))
1456
1471
plt .xlim (xmin = - 15 )
1457
1472
plt .xlim (xmax = (BE ['hhh' ]- BS ['hhh' ])* 5 + 30 )
1458
- pp = PdfPages (test_path + 'basic_hit_ratio_paper.pdf' )
1473
+ pp = PdfPages (test_path + 'basic_hit_ratio_paper' + filename_ext + ' .pdf' )
1459
1474
pp .savefig ()
1460
1475
pp .close ()
1461
1476
@@ -1478,10 +1493,10 @@ def sync_paper1():
1478
1493
# plt.ylim(ymin=-150.0)
1479
1494
plt .ylim ((75 ,100.3 ))
1480
1495
plt .xlim (xmin = - 15 )
1481
- plt .xlim (xmax = (DE ['hh' ] - DS ['hh' ])* 5 + 30 )
1496
+ plt .xlim (xmax = (DE [types2 [ 0 ]] - DS [types2 [ 0 ] ])* 5 + 30 )
1482
1497
# plt.xlim(xmax=1375)
1483
1498
# save in PDF
1484
- pp = PdfPages (test_path + 'dotted_hit_ratio_paper.pdf' )
1499
+ pp = PdfPages (test_path + 'dotted_hit_ratio_paper' + filename_ext + ' .pdf' )
1485
1500
pp .savefig ()
1486
1501
pp .close ()
1487
1502
@@ -1507,7 +1522,7 @@ def sync_paper1():
1507
1522
plt .ylim ((- 1 ,101 ))
1508
1523
plt .xlim (xmin = - 15 )
1509
1524
plt .xlim (xmax = (BE ['hhh' ]- BS ['hhh' ])* 5 + 30 )
1510
- pp = PdfPages (test_path + 'hit_ratio_paper.pdf' )
1525
+ pp = PdfPages (test_path + 'hit_ratio_paper' + filename_ext + ' .pdf' )
1511
1526
pp .savefig ()
1512
1527
pp .close ()
1513
1528
@@ -1572,11 +1587,15 @@ def sync_hit_ratio_plot(type, DS,DE,BS,BE):
1572
1587
1573
1588
1574
1589
## Sync Metadata
1575
- def sync_paper2 ():
1590
+ def sync_paper2 (
1591
+ types = ['hhh' ,'hhl' ,'hlh' ,'hll' ,'lhh' ,'lhl' ,'llh' ,'lll' ],
1592
+ types2 = ['hh' ,'hl' ,'lh' ,'ll' ],
1593
+ filename_ext = '' ):
1594
+
1595
+
1576
1596
initial_offset = - 1
1577
1597
final_offset = 0
1578
1598
1579
-
1580
1599
# Basic
1581
1600
basic_total = {}
1582
1601
basic_mt = {}
@@ -1602,7 +1621,7 @@ def sync_paper2():
1602
1621
1603
1622
mt_metadata = 11
1604
1623
1605
- types = ['hhh' ,'hhl' ,'hlh' ,'hll' ,'lhh' ,'lhl' ,'llh' ,'lll' ]
1624
+ # types = ['hhh','hhl','hlh','hll','lhh','lhl','llh','lll']
1606
1625
for t in types :
1607
1626
change_current_basic (cluster_path + 'cluster_basic/sync_' + t + '/' )
1608
1627
@@ -1627,7 +1646,7 @@ def sync_paper2():
1627
1646
basic_total [t ].fill (basic_size [t ])
1628
1647
print str (basic_size [t ]/ 1024.0 ) + " KB\n "
1629
1648
1630
- types2 = ['hh' ,'hl' ,'lh' ,'ll' ]
1649
+ # types2 = ['hh','hl','lh','ll']
1631
1650
for t in types2 :
1632
1651
change_current_dotted (cluster_path + 'cluster_dotted/sync_' + t + '/' )
1633
1652
@@ -1684,7 +1703,7 @@ def sync_paper2():
1684
1703
plt .xlim (xmin = - 5 )
1685
1704
plt .xlim (xmax = (BE ['hhh' ]- BS ['hhh' ])* 5 )
1686
1705
plt .ylim (ymin = - 5 )
1687
- pp = PdfPages (test_path + 'sync_metadata_paper.pdf' )
1706
+ pp = PdfPages (test_path + 'sync_metadata_paper' + filename_ext + ' .pdf' )
1688
1707
pp .savefig ()
1689
1708
pp .close ()
1690
1709
@@ -1964,6 +1983,11 @@ def main(argv):
1964
1983
clock_entries_paper ()
1965
1984
elif arg1 == 'deletes' :
1966
1985
deletes_paper ()
1986
+ elif arg1 == 'strip' :
1987
+ strip_paper ()
1988
+ elif arg1 == 'perf' :
1989
+ perf_paper ()
1990
+ # for normal KL and VV (1st version of SWC)
1967
1991
elif arg1 == 'sync1' :
1968
1992
sync_paper1 () # hit ratio
1969
1993
elif arg1 == 'sync2' :
@@ -1972,10 +1996,27 @@ def main(argv):
1972
1996
sync_paper3 () # repair latency
1973
1997
elif arg1 == 'sync4' :
1974
1998
sync_paper4 () # sync size
1975
- elif arg1 == 'strip' :
1976
- strip_paper ()
1977
- elif arg1 == 'perf' :
1978
- perf_paper ()
1999
+ # for matrix watermark (2nd version of SWC)
2000
+ elif arg1 == 'sync1m' :
2001
+ sync_paper1 ( # hit ratio
2002
+ ['hhh' ,'hhl' ,'hlh' ,'hll' ,'lhh' ,'lhl' ,'llh' ,'lll' ],
2003
+ ['hh_mat' ,'hl_mat' ,'lh_mat' ,'ll_mat' ],
2004
+ '_matrix' )
2005
+ elif arg1 == 'sync2m' :
2006
+ sync_paper2 ( # metadata size
2007
+ ['hhh' ,'hhl' ,'hlh' ,'hll' ,'lhh' ,'lhl' ,'llh' ,'lll' ],
2008
+ ['hh_mat' ,'hl_mat' ,'lh_mat' ,'ll_mat' ],
2009
+ '_matrix' )
2010
+ elif arg1 == 'sync3m' :
2011
+ sync_paper3 ( # repair latency
2012
+ ['hhh' ,'hhl' ,'hlh' ,'hll' ,'lhh' ,'lhl' ,'llh' ,'lll' ],
2013
+ ['hh_mat' ,'hl_mat' ,'lh_mat' ,'ll_mat' ],
2014
+ '_matrix' )
2015
+ elif arg1 == 'sync4m' :
2016
+ sync_paper4 ( # sync size
2017
+ ['hhh' ,'hlh' ,'lhh' ,'llh' ,'hhl' ,'hll' ,'lhl' ,'lll' ],
2018
+ ['hh_mat' ,'lh_mat' ,'hl_mat' ,'ll_mat' ],
2019
+ '_matrix' )
1979
2020
else :
1980
2021
print "No args :("
1981
2022
0 commit comments