summaryrefslogtreecommitdiff
path: root/ospfd/ospf_ase.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2015-05-19 16:36:05 -0700
committerDonald Sharp <sharpd@cumulusnetworks.com>2015-05-19 16:36:05 -0700
commitcf744958ba2c89b5670ac3a0ee1aa92be630cf15 (patch)
tree3755842b26b18cffc66c64e75116dc0adafa04a0 /ospfd/ospf_ase.c
parentc9506a0a6ea4a1729aca9ebdca425b902479e7cd (diff)
ospfd-spf-stats.patch
Compute and display SPF execution statistics Detailed SPF statistics, all around time spent executing various pieces of SPF such as the SPF algorithm itself, installing routes, pruning unreachable networks etc. Reason codes for firing up SPF are: R - Router LSA, N - Network LSA, S - Summary LSA, ABR - ABR status change, ASBR - ASBR Status Change, AS - ASBR Summary, M - MaxAge Signed-off-by: Dinesh G Dutt <ddutt@cumulusnetworks.com> Reviewed-by: JR Rivers <jrrivers@cumulusnetworks.com> Reviewed-by: Scott Feldman <sfeldma@cumulusnetworks.com> Reviewed-by: Ayan Banerjee <ayan@cumulusnetworks.com>
Diffstat (limited to 'ospfd/ospf_ase.c')
-rw-r--r--ospfd/ospf_ase.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/ospfd/ospf_ase.c b/ospfd/ospf_ase.c
index 6a72e31dc4..9038b3a5c6 100644
--- a/ospfd/ospf_ase.c
+++ b/ospfd/ospf_ase.c
@@ -636,6 +636,7 @@ ospf_ase_calculate_timer (struct thread *t)
struct route_node *rn;
struct listnode *node;
struct ospf_area *area;
+ struct timeval start_time, stop_time;
ospf = THREAD_ARG (t);
ospf->t_ase_calc = NULL;
@@ -644,6 +645,8 @@ ospf_ase_calculate_timer (struct thread *t)
{
ospf->ase_calc = 0;
+ quagga_gettime(QUAGGA_CLK_MONOTONIC, &start_time);
+
/* Calculate external route for each AS-external-LSA */
LSDB_LOOP (EXTERNAL_LSDB (ospf), rn, lsa)
ospf_ase_calculate_route (ospf, lsa);
@@ -673,6 +676,12 @@ ospf_ase_calculate_timer (struct thread *t)
ospf_route_table_free (ospf->old_external_route);
ospf->old_external_route = ospf->new_external_route;
ospf->new_external_route = route_table_init ();
+
+ quagga_gettime(QUAGGA_CLK_MONOTONIC, &stop_time);
+
+ zlog_info ("SPF Processing Time(usecs): External Routes: %d\n",
+ (stop_time.tv_sec - start_time.tv_sec)*1000000L+
+ (stop_time.tv_usec - start_time.tv_usec));
}
return 0;
}