def process_stats(self, pathname): """ Delegate the processing of statistics to other functions Arguments: pathname (str): Directory where statistics from HAProxy are saved. """ # statistics for HAProxy daemon and for frontend/backend/server have # different format and haproxystats-pull save them using a different # file suffix, so we can distinguish them easier. files = get_files(pathname, FILE_SUFFIX_INFO) if not files: log.warning( "%s directory doesn't contain any files with HAProxy " "daemon statistics", pathname) else: self.haproxy_stats(files) files = get_files(pathname, FILE_SUFFIX_STAT) if not files: log.warning( "%s directory doesn't contain any files with site " "statistics", pathname) else: self.sites_stats(files)
def process_stats(self, pathname): """Delegate the processing of statistics to other functions. Arguments: pathname (str): Directory where statistics from HAProxy are saved. """ # statistics for HAProxy daemon and for frontend/backend/server have # different format and haproxystats-pull save them using a different # file suffix, so we can distinguish them easier. files = get_files(pathname, FILE_SUFFIX_INFO) if not files: log.warning("%s directory doesn't contain any files with HAProxy " "daemon statistics", pathname) else: self.haproxy_stats(files) files = get_files(pathname, FILE_SUFFIX_STAT) if not files: log.warning("%s directory doesn't contain any files with site " "statistics", pathname) else: self.sites_stats(files)