@@ -63,7 +63,7 @@ class Watermarkstat(object):
63
63
def __init__ (self ):
64
64
self .counters_db = SonicV2Connector (use_unix_socket_path = False )
65
65
self .counters_db .connect (self .counters_db .COUNTERS_DB )
66
-
66
+
67
67
# connect APP DB for clear notifications
68
68
self .app_db = SonicV2Connector (use_unix_socket_path = False )
69
69
self .app_db .connect (self .counters_db .APPL_DB )
@@ -107,12 +107,14 @@ class Watermarkstat(object):
107
107
108
108
self .port_uc_queues_map = {}
109
109
self .port_mc_queues_map = {}
110
+ self .port_all_queues_map = {}
110
111
self .port_pg_map = {}
111
112
self .port_name_map = {}
112
113
113
114
for port in self .counter_port_name_map :
114
115
self .port_uc_queues_map [port ] = {}
115
116
self .port_mc_queues_map [port ] = {}
117
+ self .port_all_queues_map [port ] = {}
116
118
self .port_pg_map [port ] = {}
117
119
self .port_name_map [self .counter_port_name_map [port ]] = port
118
120
@@ -130,6 +132,9 @@ class Watermarkstat(object):
130
132
elif get_queue_type (counter_queue_name_map [queue ]) == QUEUE_TYPE_MC :
131
133
self .port_mc_queues_map [port ][queue ] = counter_queue_name_map [queue ]
132
134
135
+ elif get_queue_type (counter_queue_name_map [queue ]) == QUEUE_TYPE_ALL :
136
+ self .port_all_queues_map [port ][queue ] = counter_queue_name_map [queue ]
137
+
133
138
# Get PGs for each port
134
139
counter_pg_name_map = self .counters_db .get_all (self .counters_db .COUNTERS_DB , COUNTERS_PG_NAME_MAP )
135
140
if counter_pg_name_map is None :
@@ -167,6 +172,11 @@ class Watermarkstat(object):
167
172
"idx_func" : self .get_queue_index ,
168
173
"wm_name" : "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES" ,
169
174
"header_prefix" : "MC" },
175
+ "q_shared_all" : {"message" : "Egress shared pool occupancy per all queues:" ,
176
+ "obj_map" : self .port_all_queues_map ,
177
+ "idx_func" : self .get_queue_index ,
178
+ "wm_name" : "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES" ,
179
+ "header_prefix" : "ALL" },
170
180
"buffer_pool" : {"message" : "Shared pool maximum occupancy:" ,
171
181
"wm_name" : "SAI_BUFFER_POOL_STAT_WATERMARK_BYTES" ,
172
182
"header" : headerBufferPool },
@@ -271,6 +281,9 @@ def main():
271
281
Examples:
272
282
watermarkstat -t pg_headroom
273
283
watermarkstat -t pg_shared
284
+ watermarkstat -t q_shared_all
285
+ watermarkstat -p -t q_shared_all
286
+ watermarkstat -t q_shared_all -c
274
287
watermarkstat -t q_shared_uni -c
275
288
watermarkstat -t q_shared_multi -c
276
289
watermarkstat -p -t pg_shared
@@ -283,17 +296,17 @@ Examples:
283
296
parser .add_argument ('-c' , '--clear' , action = 'store_true' , help = 'Clear watermarks request' )
284
297
parser .add_argument ('-p' , '--persistent' , action = 'store_true' , help = 'Do the operations on the persistent watermark' )
285
298
parser .add_argument ('-t' , '--type' , required = True , action = 'store' ,
286
- choices = ['pg_headroom' , 'pg_shared' , 'q_shared_uni' , 'q_shared_multi' , 'buffer_pool' , 'headroom_pool' ],
299
+ choices = ['pg_headroom' , 'pg_shared' , 'q_shared_uni' , 'q_shared_multi' , 'buffer_pool' , 'headroom_pool' , 'q_shared_all' ],
287
300
help = 'The type of watermark' )
288
301
parser .add_argument ('-v' , '--version' , action = 'version' , version = '%(prog)s 1.0' )
289
302
args = parser .parse_args ()
290
303
watermarkstat = Watermarkstat ()
291
-
304
+
292
305
if args .clear :
293
306
watermarkstat .send_clear_notification (("PERSISTENT" if args .persistent else "USER" , args .type .upper ()))
294
307
sys .exit (0 )
295
-
296
- table_prefix = PERSISTENT_TABLE_PREFIX if args .persistent else USER_TABLE_PREFIX
308
+
309
+ table_prefix = PERSISTENT_TABLE_PREFIX if args .persistent else USER_TABLE_PREFIX
297
310
watermarkstat .print_all_stat (table_prefix , args .type )
298
311
sys .exit (0 )
299
312
0 commit comments