parameters: (
          self, client: OpenrCtrl.Client, resp: Dict, prefix: str, json: bool
      )
docstring: print the Kv Store counters
docstring_summary: print the Kv Store counters
docstring_tokens: print the Kv Store counters
function: def print_counters(
          self, client: OpenrCtrl.Client, resp: Dict, prefix: str, json: bool
      ) -> None:
          """print the Kv Store counters"""
  
          host_id = client.getMyNodeName()
          caption = "{}'s counters".format(host_id)
  
          rows = []
          for key, counter in sorted(resp.items()):
              if not key.startswith(prefix):
                  continue
              rows.append([key, ":", counter])
  
          if json:
              json_data = {k: v for k, _, v in rows}
              print(utils.json_dumps(json_data))
          else:
              print(
                  printing.render_horizontal_table(
                      rows, caption=caption, tablefmt="plain"
                  )
              )
              print()
function_tokens: def print_counters ( self , client : OpenrCtrl . Client , resp : Dict , prefix : str , json : bool ) -> None : host_id = client . getMyNodeName ( ) caption = "{}'s counters" . format ( host_id ) rows = [ ] for key , counter in sorted ( resp . items ( ) ) : if not key . startswith ( prefix ) : continue rows . append ( [ key , ":" , counter ] ) if json : json_data = { k : v for k , _ , v in rows } print ( utils . json_dumps ( json_data ) ) else : print ( printing . render_horizontal_table ( rows , caption = caption , tablefmt = "plain" ) ) print ( )