class_docstr: The standalone disk usage metric.
  
  This metric can be used to monitor the size of a set of directories.
  e.g. This can be useful to monitor the size of a replay buffer,
docstr: Obtains the size of the given directory, in KiB.
  
  :param path: The path of an existing directory.
  :return: A float value describing the size (in KiB)
      of the directory as the sum of all its elements.
docstr_tok: ["Obtains","the","size","of","the","given","directory",",","in","KiB",".",":","param","path",":","The","path","of","an","existing","directory",".",":","return",":","A","float","value","describing","the","size","(","in","KiB",")","of","the","directory","as","the","sum","of","all","its","elements","."]
code: def get_dir_size(path: str) -> float:
      """
      Obtains the size of the given directory, in KiB.
  
      :param path: The path of an existing directory.
      :return: A float value describing the size (in KiB)
          of the directory as the sum of all its elements.
      """
      total_size = 0.0
      for dirpath, dirnames, filenames in os.walk(path):
          for f in filenames:
              fp = os.path.join(dirpath, f)
              # skip if it is symbolic link
              if not os.path.islink(fp):
                  # in KB
                  s = os.path.getsize(fp) / 1024
                  total_size += s
  
      return total_size
  
imports: import os
  from pathlib import Path
  from typing import Union, Sequence, List, Optional
  from avalanche.evaluation import Metric, GenericPluginMetric
label_desc: Use image node_id 5 for calling the DiskUsage obj's underlying member method code with example usage: obj.get_dir_size(path) and returns: total_size