@@ -51,10 +51,12 @@ func TestHeaderParsing(t *testing.T) {
5151type SimpleSaver struct {
5252 Integers map [string ]int64
5353 Strings map [string ]string
54+ Bools map [string ]bool
5455}
5556
5657func NewSimpleSaver () SimpleSaver {
57- return SimpleSaver {make (map [string ]int64 ), make (map [string ]string )}
58+ return SimpleSaver {make (map [string ]int64 ),
59+ make (map [string ]string ), make (map [string ]bool )}
5860}
5961
6062func (s SimpleSaver ) SetString (name string , val string ) {
@@ -65,12 +67,16 @@ func (s SimpleSaver) SetInt64(name string, val int64) {
6567 s .Integers [name ] = val
6668}
6769
70+ func (s SimpleSaver ) SetBool (name string , val bool ) {
71+ s .Bools [name ] = val
72+ }
73+
6874// These json blobs were created using the old, C web100 based parser.
69- var old1 = `{"Integers":{"AbruptTimeouts":0,"ActiveOpen":0,"CERcvd":0,"CongAvoid":2,"CongOverCount":0,"CongSignals":0,"CountRTT":3,"CurAppRQueue":297,"CurAppWQueue":0,"CurCwnd":4344,"CurMSS":1448,"CurRTO":688,"CurReasmQueue":0,"CurRetxQueue":0,"CurRwinRcvd":29312,"CurRwinSent":6912,"CurSsthresh":2896,"CurTimeoutCount":0,"DSACKDups":0,"DataSegsIn":1,"DataSegsOut":3,"DupAcksIn":0,"DupAcksOut":0,"Duration":2343340,"ECN":0,"FastRetran":0,"HCDataOctetsIn":297,"HCDataOctetsOut":254,"HCThruOctetsAcked":158,"HCThruOctetsReceived":297,"LimCwnd":4294965848,"LimRwin":8365440,"LocalAddressType":1,"LocalPort":46024,"MSSRcvd":0,"MaxAppRQueue":297,"MaxAppWQueue":0,"MaxMSS":1448,"MaxRTO":738,"MaxRTT":244,"MaxReasmQueue":0,"MaxRetxQueue":0,"MaxRwinRcvd":29312,"MaxRwinSent":6912,"MaxSsCwnd":4344,"MaxSsthresh":2896,"MinMSS":1448,"MinRTO":687,"MinRTT":229,"MinRwinRcvd":29312,"MinRwinSent":5792,"MinSsthresh":2896,"Nagle":1,"NonRecovDA":0,"OctetsRetrans":0,"OtherReductions":0,"PostCongCountRTT":0,"PostCongSumRTT":0,"PreCongSumCwnd":0,"PreCongSumRTT":0,"QuenchRcvd":0,"RTTVar":110,"RcvNxt":3198753442,"RcvRTT":0,"RcvWindScale":7,"RecInitial":3198753145,"RemPort":48716,"RetranThresh":3,"SACK":3,"SACKBlocksRcvd":0,"SACKsRcvd":0,"SampleRTT":244,"SegsIn":3,"SegsOut":3,"SegsRetrans":0,"SendStall":0,"SlowStart":0,"SmoothedRTT":246,"SndInitial":2301393414,"SndLimBytesCwnd":0,"SndLimBytesRwin":0,"SndLimBytesSender":254,"SndLimTimeCwnd":0,"SndLimTimeRwin":0,"SndLimTimeSnd":234061,"SndLimTransCwnd":0,"SndLimTransRwin":0,"SndLimTransSnd":1,"SndMax":2301393572,"SndNxt":2301393572,"SndUna":2301393572,"SndWindScale":7,"SpuriousFrDetected":0,"StartTimeStamp":1494337514,"StartTimeUsec":369834,"State":5,"SubsequentTimeouts":0,"SumRTT":707,"TimeStamps":1,"Timeouts":0,"WinScaleRcvd":7,"WinScaleSent":7,"X_OtherReductionsCM":0,"X_OtherReductionsCV":0,"X_Rcvbuf":87380,"X_Sndbuf":16384,"X_dbg1":6912,"X_dbg2":536,"X_dbg3":6864,"X_dbg4":0,"X_rcv_ssthresh":6864,"X_wnd_clamp":64087},"Strings":{"LocalAddress":"213.208.152.37","RemAddress":"45.56.98.222"}}`
75+ var old1 = `{"Integers":{"AbruptTimeouts":0,"ActiveOpen":0,"CERcvd":0,"CongAvoid":2,"CongOverCount":0,"CongSignals":0,"CountRTT":3,"CurAppRQueue":297,"CurAppWQueue":0,"CurCwnd":4344,"CurMSS":1448,"CurRTO":688,"CurReasmQueue":0,"CurRetxQueue":0,"CurRwinRcvd":29312,"CurRwinSent":6912,"CurSsthresh":2896,"CurTimeoutCount":0,"DSACKDups":0,"DataSegsIn":1,"DataSegsOut":3,"DupAcksIn":0,"DupAcksOut":0,"Duration":2343340,"ECN":0,"FastRetran":0,"HCDataOctetsIn":297,"HCDataOctetsOut":254,"HCThruOctetsAcked":158,"HCThruOctetsReceived":297,"LimCwnd":4294965848,"LimRwin":8365440,"LocalAddressType":1,"LocalPort":46024,"MSSRcvd":0,"MaxAppRQueue":297,"MaxAppWQueue":0,"MaxMSS":1448,"MaxRTO":738,"MaxRTT":244,"MaxReasmQueue":0,"MaxRetxQueue":0,"MaxRwinRcvd":29312,"MaxRwinSent":6912,"MaxSsCwnd":4344,"MaxSsthresh":2896,"MinMSS":1448,"MinRTO":687,"MinRTT":229,"MinRwinRcvd":29312,"MinRwinSent":5792,"MinSsthresh":2896,"Nagle":1,"NonRecovDA":0,"OctetsRetrans":0,"OtherReductions":0,"PostCongCountRTT":0,"PostCongSumRTT":0,"PreCongSumCwnd":0,"PreCongSumRTT":0,"QuenchRcvd":0,"RTTVar":110,"RcvNxt":3198753442,"RcvRTT":0,"RcvWindScale":7,"RecInitial":3198753145,"RemPort":48716,"RetranThresh":3,"SACK":3,"SACKBlocksRcvd":0,"SACKsRcvd":0,"SampleRTT":244,"SegsIn":3,"SegsOut":3,"SegsRetrans":0,"SendStall":0,"SlowStart":0,"SmoothedRTT":246,"SndInitial":2301393414,"SndLimBytesCwnd":0,"SndLimBytesRwin":0,"SndLimBytesSender":254,"SndLimTimeCwnd":0,"SndLimTimeRwin":0,"SndLimTimeSnd":234061,"SndLimTransCwnd":0,"SndLimTransRwin":0,"SndLimTransSnd":1,"SndMax":2301393572,"SndNxt":2301393572,"SndUna":2301393572,"SndWindScale":7,"SpuriousFrDetected":0,"StartTimeStamp":1494337514,"StartTimeUsec":369834,"State":5,"SubsequentTimeouts":0,"SumRTT":707,"TimeStamps":1,"Timeouts":0,"WinScaleRcvd":7,"WinScaleSent":7,"X_OtherReductionsCM":0,"X_OtherReductionsCV":0,"X_Rcvbuf":87380,"X_Sndbuf":16384,"X_dbg1":6912,"X_dbg2":536,"X_dbg3":6864,"X_dbg4":0,"X_rcv_ssthresh":6864,"X_wnd_clamp":64087},"Strings":{"LocalAddress":"213.208.152.37","RemAddress":"45.56.98.222"}, "Bools":{}}`
7076
71- var old1000 = `{"Integers":{"AbruptTimeouts":0,"ActiveOpen":0,"CERcvd":0,"CongAvoid":2,"CongOverCount":0,"CongSignals":0,"CountRTT":3,"CurAppRQueue":0,"CurAppWQueue":0,"CurCwnd":4344,"CurMSS":1448,"CurRTO":688,"CurReasmQueue":0,"CurRetxQueue":0,"CurRwinRcvd":29312,"CurRwinSent":64128,"CurSsthresh":2896,"CurTimeoutCount":0,"DSACKDups":0,"DataSegsIn":254,"DataSegsOut":141,"DupAcksIn":0,"DupAcksOut":0,"Duration":7519783,"ECN":0,"FastRetran":0,"HCDataOctetsIn":365207,"HCDataOctetsOut":4670,"HCThruOctetsAcked":158,"HCThruOctetsReceived":365207,"LimCwnd":4294965848,"LimRwin":8365440,"LocalAddressType":1,"LocalPort":46024,"MSSRcvd":0,"MaxAppRQueue":2896,"MaxAppWQueue":0,"MaxMSS":1448,"MaxRTO":738,"MaxRTT":244,"MaxReasmQueue":0,"MaxRetxQueue":0,"MaxRwinRcvd":29312,"MaxRwinSent":64128,"MaxSsCwnd":4344,"MaxSsthresh":2896,"MinMSS":1448,"MinRTO":687,"MinRTT":229,"MinRwinRcvd":29312,"MinRwinSent":5792,"MinSsthresh":2896,"Nagle":1,"NonRecovDA":0,"OctetsRetrans":0,"OtherReductions":0,"PostCongCountRTT":0,"PostCongSumRTT":0,"PreCongSumCwnd":0,"PreCongSumRTT":0,"QuenchRcvd":0,"RTTVar":110,"RcvNxt":3199118352,"RcvRTT":175000,"RcvWindScale":7,"RecInitial":3198753145,"RemPort":48716,"RetranThresh":3,"SACK":3,"SACKBlocksRcvd":0,"SACKsRcvd":0,"SampleRTT":244,"SegsIn":256,"SegsOut":141,"SegsRetrans":0,"SendStall":0,"SlowStart":0,"SmoothedRTT":246,"SndInitial":2301393414,"SndLimBytesCwnd":0,"SndLimBytesRwin":0,"SndLimBytesSender":254,"SndLimTimeCwnd":0,"SndLimTimeRwin":0,"SndLimTimeSnd":234061,"SndLimTransCwnd":0,"SndLimTransRwin":0,"SndLimTransSnd":1,"SndMax":2301393572,"SndNxt":2301393572,"SndUna":2301393572,"SndWindScale":7,"SpuriousFrDetected":0,"StartTimeStamp":1494337514,"StartTimeUsec":369834,"State":5,"SubsequentTimeouts":0,"SumRTT":707,"TimeStamps":1,"Timeouts":0,"WinScaleRcvd":7,"WinScaleSent":7,"X_OtherReductionsCM":0,"X_OtherReductionsCV":0,"X_Rcvbuf":90112,"X_Sndbuf":16384,"X_dbg1":64128,"X_dbg2":1448,"X_dbg3":64087,"X_dbg4":0,"X_rcv_ssthresh":64087,"X_wnd_clamp":63712},"Strings":{"LocalAddress":"213.208.152.37","RemAddress":"45.56.98.222"}}`
77+ var old1000 = `{"Integers":{"AbruptTimeouts":0,"ActiveOpen":0,"CERcvd":0,"CongAvoid":2,"CongOverCount":0,"CongSignals":0,"CountRTT":3,"CurAppRQueue":0,"CurAppWQueue":0,"CurCwnd":4344,"CurMSS":1448,"CurRTO":688,"CurReasmQueue":0,"CurRetxQueue":0,"CurRwinRcvd":29312,"CurRwinSent":64128,"CurSsthresh":2896,"CurTimeoutCount":0,"DSACKDups":0,"DataSegsIn":254,"DataSegsOut":141,"DupAcksIn":0,"DupAcksOut":0,"Duration":7519783,"ECN":0,"FastRetran":0,"HCDataOctetsIn":365207,"HCDataOctetsOut":4670,"HCThruOctetsAcked":158,"HCThruOctetsReceived":365207,"LimCwnd":4294965848,"LimRwin":8365440,"LocalAddressType":1,"LocalPort":46024,"MSSRcvd":0,"MaxAppRQueue":2896,"MaxAppWQueue":0,"MaxMSS":1448,"MaxRTO":738,"MaxRTT":244,"MaxReasmQueue":0,"MaxRetxQueue":0,"MaxRwinRcvd":29312,"MaxRwinSent":64128,"MaxSsCwnd":4344,"MaxSsthresh":2896,"MinMSS":1448,"MinRTO":687,"MinRTT":229,"MinRwinRcvd":29312,"MinRwinSent":5792,"MinSsthresh":2896,"Nagle":1,"NonRecovDA":0,"OctetsRetrans":0,"OtherReductions":0,"PostCongCountRTT":0,"PostCongSumRTT":0,"PreCongSumCwnd":0,"PreCongSumRTT":0,"QuenchRcvd":0,"RTTVar":110,"RcvNxt":3199118352,"RcvRTT":175000,"RcvWindScale":7,"RecInitial":3198753145,"RemPort":48716,"RetranThresh":3,"SACK":3,"SACKBlocksRcvd":0,"SACKsRcvd":0,"SampleRTT":244,"SegsIn":256,"SegsOut":141,"SegsRetrans":0,"SendStall":0,"SlowStart":0,"SmoothedRTT":246,"SndInitial":2301393414,"SndLimBytesCwnd":0,"SndLimBytesRwin":0,"SndLimBytesSender":254,"SndLimTimeCwnd":0,"SndLimTimeRwin":0,"SndLimTimeSnd":234061,"SndLimTransCwnd":0,"SndLimTransRwin":0,"SndLimTransSnd":1,"SndMax":2301393572,"SndNxt":2301393572,"SndUna":2301393572,"SndWindScale":7,"SpuriousFrDetected":0,"StartTimeStamp":1494337514,"StartTimeUsec":369834,"State":5,"SubsequentTimeouts":0,"SumRTT":707,"TimeStamps":1,"Timeouts":0,"WinScaleRcvd":7,"WinScaleSent":7,"X_OtherReductionsCM":0,"X_OtherReductionsCV":0,"X_Rcvbuf":90112,"X_Sndbuf":16384,"X_dbg1":64128,"X_dbg2":1448,"X_dbg3":64087,"X_dbg4":0,"X_rcv_ssthresh":64087,"X_wnd_clamp":63712},"Strings":{"LocalAddress":"213.208.152.37","RemAddress":"45.56.98.222"}, "Bools":{}}`
7278
73- var old2000 = `{"Integers":{"AbruptTimeouts":0,"ActiveOpen":0,"CERcvd":0,"CongAvoid":2,"CongOverCount":0,"CongSignals":0,"CountRTT":3,"CurAppRQueue":0,"CurAppWQueue":0,"CurCwnd":4344,"CurMSS":1448,"CurRTO":688,"CurReasmQueue":0,"CurRetxQueue":0,"CurRwinRcvd":29312,"CurRwinSent":104320,"CurSsthresh":2896,"CurTimeoutCount":0,"DSACKDups":0,"DataSegsIn":1237,"DataSegsOut":639,"DupAcksIn":0,"DupAcksOut":0,"Duration":12709989,"ECN":0,"FastRetran":0,"HCDataOctetsIn":1788591,"HCDataOctetsOut":20606,"HCThruOctetsAcked":158,"HCThruOctetsReceived":1788591,"LimCwnd":4294965848,"LimRwin":8365440,"LocalAddressType":1,"LocalPort":46024,"MSSRcvd":0,"MaxAppRQueue":2896,"MaxAppWQueue":0,"MaxMSS":1448,"MaxRTO":738,"MaxRTT":244,"MaxReasmQueue":0,"MaxRetxQueue":0,"MaxRwinRcvd":29312,"MaxRwinSent":104320,"MaxSsCwnd":4344,"MaxSsthresh":2896,"MinMSS":1448,"MinRTO":687,"MinRTT":229,"MinRwinRcvd":29312,"MinRwinSent":5792,"MinSsthresh":2896,"Nagle":1,"NonRecovDA":0,"OctetsRetrans":0,"OtherReductions":0,"PostCongCountRTT":0,"PostCongSumRTT":0,"PreCongSumCwnd":0,"PreCongSumRTT":0,"QuenchRcvd":0,"RTTVar":110,"RcvNxt":3200541736,"RcvRTT":130375,"RcvWindScale":7,"RecInitial":3198753145,"RemPort":48716,"RetranThresh":3,"SACK":3,"SACKBlocksRcvd":0,"SACKsRcvd":0,"SampleRTT":244,"SegsIn":1239,"SegsOut":639,"SegsRetrans":0,"SendStall":0,"SlowStart":0,"SmoothedRTT":246,"SndInitial":2301393414,"SndLimBytesCwnd":0,"SndLimBytesRwin":0,"SndLimBytesSender":254,"SndLimTimeCwnd":0,"SndLimTimeRwin":0,"SndLimTimeSnd":234061,"SndLimTransCwnd":0,"SndLimTransRwin":0,"SndLimTransSnd":1,"SndMax":2301393572,"SndNxt":2301393572,"SndUna":2301393572,"SndWindScale":7,"SpuriousFrDetected":0,"StartTimeStamp":1494337514,"StartTimeUsec":369834,"State":5,"SubsequentTimeouts":0,"SumRTT":707,"TimeStamps":1,"Timeouts":0,"WinScaleRcvd":7,"WinScaleSent":7,"X_OtherReductionsCM":0,"X_OtherReductionsCV":0,"X_Rcvbuf":147456,"X_Sndbuf":16384,"X_dbg1":104320,"X_dbg2":1448,"X_dbg3":104256,"X_dbg4":0,"X_rcv_ssthresh":104256,"X_wnd_clamp":104256},"Strings":{"LocalAddress":"213.208.152.37","RemAddress":"45.56.98.222"}}`
79+ var old2000 = `{"Integers":{"AbruptTimeouts":0,"ActiveOpen":0,"CERcvd":0,"CongAvoid":2,"CongOverCount":0,"CongSignals":0,"CountRTT":3,"CurAppRQueue":0,"CurAppWQueue":0,"CurCwnd":4344,"CurMSS":1448,"CurRTO":688,"CurReasmQueue":0,"CurRetxQueue":0,"CurRwinRcvd":29312,"CurRwinSent":104320,"CurSsthresh":2896,"CurTimeoutCount":0,"DSACKDups":0,"DataSegsIn":1237,"DataSegsOut":639,"DupAcksIn":0,"DupAcksOut":0,"Duration":12709989,"ECN":0,"FastRetran":0,"HCDataOctetsIn":1788591,"HCDataOctetsOut":20606,"HCThruOctetsAcked":158,"HCThruOctetsReceived":1788591,"LimCwnd":4294965848,"LimRwin":8365440,"LocalAddressType":1,"LocalPort":46024,"MSSRcvd":0,"MaxAppRQueue":2896,"MaxAppWQueue":0,"MaxMSS":1448,"MaxRTO":738,"MaxRTT":244,"MaxReasmQueue":0,"MaxRetxQueue":0,"MaxRwinRcvd":29312,"MaxRwinSent":104320,"MaxSsCwnd":4344,"MaxSsthresh":2896,"MinMSS":1448,"MinRTO":687,"MinRTT":229,"MinRwinRcvd":29312,"MinRwinSent":5792,"MinSsthresh":2896,"Nagle":1,"NonRecovDA":0,"OctetsRetrans":0,"OtherReductions":0,"PostCongCountRTT":0,"PostCongSumRTT":0,"PreCongSumCwnd":0,"PreCongSumRTT":0,"QuenchRcvd":0,"RTTVar":110,"RcvNxt":3200541736,"RcvRTT":130375,"RcvWindScale":7,"RecInitial":3198753145,"RemPort":48716,"RetranThresh":3,"SACK":3,"SACKBlocksRcvd":0,"SACKsRcvd":0,"SampleRTT":244,"SegsIn":1239,"SegsOut":639,"SegsRetrans":0,"SendStall":0,"SlowStart":0,"SmoothedRTT":246,"SndInitial":2301393414,"SndLimBytesCwnd":0,"SndLimBytesRwin":0,"SndLimBytesSender":254,"SndLimTimeCwnd":0,"SndLimTimeRwin":0,"SndLimTimeSnd":234061,"SndLimTransCwnd":0,"SndLimTransRwin":0,"SndLimTransSnd":1,"SndMax":2301393572,"SndNxt":2301393572,"SndUna":2301393572,"SndWindScale":7,"SpuriousFrDetected":0,"StartTimeStamp":1494337514,"StartTimeUsec":369834,"State":5,"SubsequentTimeouts":0,"SumRTT":707,"TimeStamps":1,"Timeouts":0,"WinScaleRcvd":7,"WinScaleSent":7,"X_OtherReductionsCM":0,"X_OtherReductionsCV":0,"X_Rcvbuf":147456,"X_Sndbuf":16384,"X_dbg1":104320,"X_dbg2":1448,"X_dbg3":104256,"X_dbg4":0,"X_rcv_ssthresh":104256,"X_wnd_clamp":104256},"Strings":{"LocalAddress":"213.208.152.37","RemAddress":"45.56.98.222"}, "Bools":{}}`
7480
7581// This tests parsing of snapshot content for three snapshots.
7682func TestSnapshotContent (t * testing.T ) {
0 commit comments