@@ -55,6 +55,7 @@ class MockServiceStatsManager : public ServiceStatsManager {
55
55
intFlowManager_, timer_interval_) {};
56
56
57
57
void testInjectTxnId (uint32_t txn_id) {
58
+ std::lock_guard<mutex> lock (txnMtx);
58
59
txns.insert (txn_id);
59
60
}
60
61
};
@@ -68,12 +69,11 @@ class ServiceStatsManagerFixture : public PolicyStatsManagerFixture {
68
69
pktInHandler(agent, intFlowManager),
69
70
serviceStatsManager(&agent, idGen,
70
71
switchManager,
71
- intFlowManager, 10 ) {
72
+ intFlowManager, 300 ) {
72
73
createObjects ();
73
74
switchManager.setMaxFlowTables (IntFlowManager::NUM_FLOW_TABLES);
74
75
intFlowManager.start ();
75
76
76
- setLoggingLevel (" trace" );
77
77
// cloud nodeport tests need veth_host_ac
78
78
portmapper.setPort (" veth_host_ac" , 72 );
79
79
portmapper.setPort (72 , " veth_host_ac" );
@@ -285,7 +285,7 @@ ServiceStatsManagerFixture::testFlowAge (PolicyStatsManager *statsManager,
285
285
for (auto age = 0 ; age < PolicyStatsManager::MAX_AGE; age++) {
286
286
boost::system::error_code ec;
287
287
ec = make_error_code (boost::system::errc::success);
288
- statsManager-> on_timer (ec);
288
+ serviceStatsManager. update_state (ec);
289
289
}
290
290
291
291
// 2 flows got aged
@@ -303,7 +303,7 @@ ServiceStatsManagerFixture::testFlowAge (PolicyStatsManager *statsManager,
303
303
304
304
boost::system::error_code ec;
305
305
ec = make_error_code (boost::system::errc::success);
306
- statsManager-> on_timer (ec);
306
+ serviceStatsManager. update_state (ec);
307
307
308
308
// 2 flows get readded to new map
309
309
guard.lock ();
@@ -320,7 +320,7 @@ ServiceStatsManagerFixture::testFlowAge (PolicyStatsManager *statsManager,
320
320
for (auto age = 0 ; age < PolicyStatsManager::MAX_AGE; age++) {
321
321
boost::system::error_code ec;
322
322
ec = make_error_code (boost::system::errc::success);
323
- statsManager-> on_timer (ec);
323
+ serviceStatsManager. update_state (ec);
324
324
}
325
325
326
326
guard.lock ();
@@ -335,7 +335,7 @@ ServiceStatsManagerFixture::testFlowAge (PolicyStatsManager *statsManager,
335
335
336
336
boost::system::error_code ec;
337
337
ec = make_error_code (boost::system::errc::success);
338
- statsManager-> on_timer (ec);
338
+ serviceStatsManager. update_state (ec);
339
339
340
340
guard.lock ();
341
341
BOOST_CHECK_EQUAL (serviceStatsManager.statsState .newFlowCounterMap .size (), 17 );
@@ -434,8 +434,8 @@ ServiceStatsManagerFixture::testFlowStatsSvcTgt (MockConnection& portConn,
434
434
435
435
boost::system::error_code ec;
436
436
ec = make_error_code (boost::system::errc::success);
437
- // Call on_timer function to setup flow stat state.
438
- statsManager-> on_timer (ec);
437
+ // Call update_state() function to setup flow stat state.
438
+ serviceStatsManager. update_state (ec);
439
439
440
440
// create first flow reply message
441
441
struct ofpbuf *res_msg = makeFlowStatReplyMessage_2 (&portConn,
@@ -454,9 +454,9 @@ ServiceStatsManagerFixture::testFlowStatsSvcTgt (MockConnection& portConn,
454
454
LOG (DEBUG) << " 1 FlowStatsReplyMessage handling successful" ;
455
455
ofpbuf_delete (res_msg);
456
456
457
- // Call on_timer function to process the stats collected
457
+ // Call update_state() function to process the stats collected
458
458
// and update Genie objects for stats
459
- statsManager-> on_timer (ec);
459
+ serviceStatsManager. update_state (ec);
460
460
461
461
// calculate expected packet count and byte count
462
462
// that we should have in Genie object
@@ -483,9 +483,9 @@ ServiceStatsManagerFixture::testFlowStatsSvcTgt (MockConnection& portConn,
483
483
LOG (DEBUG) << " 2 FlowStatsReplyMessage handling successful" ;
484
484
ofpbuf_delete (res_msg);
485
485
486
- // Call on_timer function to process the stats collected
486
+ // Call update_state() function to process the stats collected
487
487
// and update Genie objects for stats
488
- statsManager-> on_timer (ec);
488
+ serviceStatsManager. update_state (ec);
489
489
490
490
uint32_t numFlows = entryList.size ()/2 ;
491
491
expPkts =
@@ -577,8 +577,8 @@ ServiceStatsManagerFixture::testFlowStatsPodSvc (MockConnection& portConn,
577
577
578
578
boost::system::error_code ec;
579
579
ec = make_error_code (boost::system::errc::success);
580
- // Call on_timer function to setup flow stat state.
581
- statsManager-> on_timer (ec);
580
+ // Call update_state() function to setup flow stat state.
581
+ serviceStatsManager. update_state (ec);
582
582
583
583
// create first flow reply message
584
584
struct ofpbuf *res_msg = makeFlowStatReplyMessage_2 (&portConn,
@@ -597,9 +597,9 @@ ServiceStatsManagerFixture::testFlowStatsPodSvc (MockConnection& portConn,
597
597
LOG (DEBUG) << " 1 FlowStatsReplyMessage handling successful" ;
598
598
ofpbuf_delete (res_msg);
599
599
600
- // Call on_timer function to process the stats collected
600
+ // Call update_state() function to process the stats collected
601
601
// and update Genie objects for stats
602
- statsManager-> on_timer (ec);
602
+ serviceStatsManager. update_state (ec);
603
603
604
604
// calculate expected packet count and byte count
605
605
// that we should have in Genie object
@@ -623,9 +623,9 @@ ServiceStatsManagerFixture::testFlowStatsPodSvc (MockConnection& portConn,
623
623
LOG (DEBUG) << " 2 FlowStatsReplyMessage handling successful" ;
624
624
ofpbuf_delete (res_msg);
625
625
626
- // Call on_timer function to process the stats collected
626
+ // Call update_state() function to process the stats collected
627
627
// and update Genie objects for stats
628
- statsManager-> on_timer (ec);
628
+ serviceStatsManager. update_state (ec);
629
629
630
630
uint32_t numFlows = entryList.size ()/2 ;
631
631
expPkts =
@@ -711,8 +711,8 @@ ServiceStatsManagerFixture::testFlowRemovedSvcTgt (MockConnection& portConn,
711
711
712
712
boost::system::error_code ec;
713
713
ec = make_error_code (boost::system::errc::success);
714
- // Call on_timer function to setup flow stat state.
715
- statsManager-> on_timer (ec);
714
+ // Call update_state() function to setup flow stat state.
715
+ serviceStatsManager. update_state (ec);
716
716
717
717
// create flow removed message 1
718
718
struct ofpbuf *res_msg = makeFlowRemovedMessage_2 (&portConn,
@@ -749,9 +749,9 @@ ServiceStatsManagerFixture::testFlowRemovedSvcTgt (MockConnection& portConn,
749
749
LOG (DEBUG) << " 2 FlowRemovedMessage handling successful" ;
750
750
ofpbuf_delete (res_msg);
751
751
752
- // Call on_timer function to process the stats collected
752
+ // Call update_state() function to process the stats collected
753
753
// and update Genie objects for stats
754
- statsManager-> on_timer (ec);
754
+ serviceStatsManager. update_state (ec);
755
755
756
756
// calculate expected packet count and byte count
757
757
// that we should have in Genie object
@@ -816,8 +816,8 @@ ServiceStatsManagerFixture::testFlowRemovedPodSvc (MockConnection& portConn,
816
816
817
817
boost::system::error_code ec;
818
818
ec = make_error_code (boost::system::errc::success);
819
- // Call on_timer function to setup flow stat state.
820
- statsManager-> on_timer (ec);
819
+ // Call update_state() function to setup flow stat state.
820
+ serviceStatsManager. update_state (ec);
821
821
822
822
// create flow removed message 1
823
823
struct ofpbuf *res_msg = makeFlowRemovedMessage_2 (&portConn,
@@ -854,9 +854,9 @@ ServiceStatsManagerFixture::testFlowRemovedPodSvc (MockConnection& portConn,
854
854
LOG (DEBUG) << " 2 FlowRemovedMessage handling successful" ;
855
855
ofpbuf_delete (res_msg);
856
856
857
- // Call on_timer function to process the stats collected
857
+ // Call update_state() function to process the stats collected
858
858
// and update Genie objects for stats
859
- statsManager-> on_timer (ec);
859
+ serviceStatsManager. update_state (ec);
860
860
861
861
// calculate expected packet count and byte count
862
862
// that we should have in Genie object
0 commit comments