diff mbox series

[ovs-dev] northd.c: Adjust and add stopwatch for "lflows_to_sb".

Message ID 20221004231439.3874816-1-hzhou@ovn.org
State Accepted
Headers show
Series [ovs-dev] northd.c: Adjust and add stopwatch for "lflows_to_sb". | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/github-robot-_Build_and_Test success github build: passed
ovsrobot/github-robot-_ovn-kubernetes success github build: passed

Commit Message

Han Zhou Oct. 4, 2022, 11:14 p.m. UTC
The stopwatch "lflows_dp_groups" was stopped in the middle of syncing
lflows to SB. This patch adjust it properly and add the new stopwatch
"lflows_to_sb" to measure the time for syncing lflows to SB.

Signed-off-by: Han Zhou <hzhou@ovn.org>
---
 lib/stopwatch-names.h | 1 +
 northd/northd.c       | 5 ++++-
 northd/ovn-northd.c   | 1 +
 3 files changed, 6 insertions(+), 1 deletion(-)

Comments

Dumitru Ceara Oct. 5, 2022, 9:59 a.m. UTC | #1
On 10/5/22 01:14, Han Zhou wrote:
> The stopwatch "lflows_dp_groups" was stopped in the middle of syncing
> lflows to SB. This patch adjust it properly and add the new stopwatch
> "lflows_to_sb" to measure the time for syncing lflows to SB.
> 
> Signed-off-by: Han Zhou <hzhou@ovn.org>
> ---

Looks good to me, thanks!

Acked-by: Dumitru Ceara <dceara@redhat.com>
Han Zhou Oct. 5, 2022, 11:18 p.m. UTC | #2
On Wed, Oct 5, 2022 at 2:59 AM Dumitru Ceara <dceara@redhat.com> wrote:
>
> On 10/5/22 01:14, Han Zhou wrote:
> > The stopwatch "lflows_dp_groups" was stopped in the middle of syncing
> > lflows to SB. This patch adjust it properly and add the new stopwatch
> > "lflows_to_sb" to measure the time for syncing lflows to SB.
> >
> > Signed-off-by: Han Zhou <hzhou@ovn.org>
> > ---
>
> Looks good to me, thanks!
>
> Acked-by: Dumitru Ceara <dceara@redhat.com>
>

Thanks Dumitru. Applied to main.
Han
diff mbox series

Patch

diff --git a/lib/stopwatch-names.h b/lib/stopwatch-names.h
index 572968ff0..de6fca4cc 100644
--- a/lib/stopwatch-names.h
+++ b/lib/stopwatch-names.h
@@ -29,5 +29,6 @@ 
 #define LFLOWS_LBS_STOPWATCH_NAME "lflows_lbs"
 #define LFLOWS_IGMP_STOPWATCH_NAME "lflows_igmp"
 #define LFLOWS_DP_GROUPS_STOPWATCH_NAME "lflows_dp_groups"
+#define LFLOWS_TO_SB_STOPWATCH_NAME "lflows_to_sb"
 
 #endif
diff --git a/northd/northd.c b/northd/northd.c
index 07707e10a..6771ccce5 100644
--- a/northd/northd.c
+++ b/northd/northd.c
@@ -14420,6 +14420,9 @@  void build_lflows(struct lflow_input *input_data,
 
     hmap_destroy(&single_dp_lflows);
 
+    stopwatch_stop(LFLOWS_DP_GROUPS_STOPWATCH_NAME, time_msec());
+    stopwatch_start(LFLOWS_TO_SB_STOPWATCH_NAME, time_msec());
+
     /* Push changes to the Logical_Flow table to database. */
     const struct sbrec_logical_flow *sbflow;
     SBREC_LOGICAL_FLOW_TABLE_FOR_EACH_SAFE (sbflow,
@@ -14544,7 +14547,6 @@  void build_lflows(struct lflow_input *input_data,
         }
     }
 
-    stopwatch_stop(LFLOWS_DP_GROUPS_STOPWATCH_NAME, time_msec());
     HMAP_FOR_EACH_SAFE (lflow, hmap_node, &lflows) {
         const char *pipeline = ovn_stage_get_pipeline_name(lflow->stage);
         uint8_t table = ovn_stage_get_table(lflow->stage);
@@ -14593,6 +14595,7 @@  void build_lflows(struct lflow_input *input_data,
     }
     hmap_destroy(&lflows);
 
+    stopwatch_stop(LFLOWS_TO_SB_STOPWATCH_NAME, time_msec());
     struct ovn_dp_group *dpg;
     HMAP_FOR_EACH_POP (dpg, node, &dp_groups) {
         bitmap_free(dpg->bitmap);
diff --git a/northd/ovn-northd.c b/northd/ovn-northd.c
index 96f17f15f..faf7cbeb5 100644
--- a/northd/ovn-northd.c
+++ b/northd/ovn-northd.c
@@ -815,6 +815,7 @@  main(int argc, char *argv[])
     stopwatch_create(LFLOWS_LBS_STOPWATCH_NAME, SW_MS);
     stopwatch_create(LFLOWS_IGMP_STOPWATCH_NAME, SW_MS);
     stopwatch_create(LFLOWS_DP_GROUPS_STOPWATCH_NAME, SW_MS);
+    stopwatch_create(LFLOWS_TO_SB_STOPWATCH_NAME, SW_MS);
 
     /* Initialize incremental processing engine for ovn-northd */
     inc_proc_northd_init(&ovnnb_idl_loop, &ovnsb_idl_loop);