def get_data(self, hostname, **params): data = [] from_date = params.get('from_date', datetime.datetime.now().strftime('%Y-%m-%d')) to_date = params.get('to_date', (datetime.datetime.now() + datetime.timedelta(1)).strftime('%Y-%m-%d')) if 'show' in params: data = reportdata.getLocksReport(hostname, from_date, to_date) host_names = hosts.getHostsWithFeature('blockingStatsGatherInterval').items() return data, from_date, to_date, host_names
def get_data(self, uishortname, **params): data = [] from_date = params.get('from_date', datetime.datetime.now().strftime('%Y-%m-%d')) to_date = params.get('to_date', (datetime.datetime.now() + datetime.timedelta(1)).strftime('%Y-%m-%d')) if 'show' in params: if not is_sproc_installed('blocking_last_day_by_shortname'): raise Exception('Required additional module is not installed, see - https://github.com/zalando/PGObserver/blob/master/extra_features/blocking_monitor/FEAT_DESC.md') if uishortname == 'all': uishortname = None data = reportdata.getLocksReport(uishortname, from_date, to_date) uishortnames = hosts.getHostsWithFeatureAsShortnames('blockingStatsGatherInterval') return data, from_date, to_date, uishortnames
def get_data(self, uishortname, **params): data = [] from_date = params.get('from_date', datetime.datetime.now().strftime('%Y-%m-%d')) to_date = params.get('to_date', (datetime.datetime.now() + datetime.timedelta(1)).strftime('%Y-%m-%d')) if 'show' in params: if not is_sproc_installed('blocking_last_day_by_shortname'): raise Exception( 'Required additional module is not installed, see - https://github.com/zalando/PGObserver/blob/master/extra_features/blocking_monitor/FEAT_DESC.md' ) if uishortname == 'all': uishortname = None data = reportdata.getLocksReport(uishortname, from_date, to_date) uishortnames = hosts.getHostsWithFeatureAsShortnames( 'blockingStatsGatherInterval') return data, from_date, to_date, uishortnames