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>
Reviewed-by: Paul Jakma <paul@opensourcerouting.org>
diff --git a/ospfd/ospfd.h b/ospfd/ospfd.h
index 4242aa0..bf70d02 100644
--- a/ospfd/ospfd.h
+++ b/ospfd/ospfd.h
@@ -194,8 +194,9 @@
struct route_table *external_lsas; /* Database of external LSAs,
prefix is LSA's adv. network*/
- /* Time stamps. */
+ /* Time stamps */
struct timeval ts_spf; /* SPF calculation time stamp. */
+ struct timeval ts_spf_duration; /* Execution time of last SPF */
struct route_table *maxage_lsa; /* List of MaxAge LSA for deletion. */
int redistribute; /* Num of redistributed protocols. */
@@ -393,6 +394,9 @@
/* Statistics field. */
u_int32_t spf_calculation; /* SPF Calculation Count. */
+ /* Time stamps. */
+ struct timeval ts_spf; /* SPF calculation time stamp. */
+
/* Router count. */
u_int32_t abr_count; /* ABR router in this area. */
u_int32_t asbr_count; /* ASBR router in this area. */