@@ -92,7 +92,9 @@ def config(ports):
92
92
line = config_entry .get (config [1 ], config [2 ])
93
93
config_list .append (line )
94
94
table .append ([port ] + config_list )
95
-
95
+ poll_interval = configdb .get_entry ( 'PFC_WD_TABLE' , 'GLOBAL' ).get ('POLL_INTERVAL' )
96
+ if poll_interval is not None :
97
+ click .echo ("Changed polling interval to " + poll_interval + "ms" )
96
98
click .echo (tabulate (table , CONFIG_HEADER , stralign = 'right' , numalign = 'right' , tablefmt = 'simple' ))
97
99
98
100
# Start WD
@@ -127,6 +129,19 @@ def start(action, restoration_time, ports, detection_time):
127
129
configdb .mod_entry ("PFC_WD_TABLE" , port , None )
128
130
configdb .mod_entry ("PFC_WD_TABLE" , port , pfcwd_info )
129
131
132
+ # Set WD poll interval
133
+ @cli .command ()
134
+ @click .argument ('poll_interval' , type = click .IntRange (100 , 3000 ))
135
+ def interval (poll_interval ):
136
+ """ Set PFC watchdog counter polling interval """
137
+ configdb = swsssdk .ConfigDBConnector ()
138
+ configdb .connect ()
139
+ pfcwd_info = {}
140
+ if poll_interval is not None :
141
+ pfcwd_info ['POLL_INTERVAL' ] = poll_interval
142
+
143
+ configdb .mod_entry ("PFC_WD_TABLE" , "GLOBAL" , pfcwd_info )
144
+
130
145
# Stop WD
131
146
@cli .command ()
132
147
@click .argument ('ports' , nargs = - 1 )
0 commit comments