def __call__(self, path_info): splits = path_info.split('/') if len(splits) > 1 and splits[1]: if splits[1].isdigit( ) or splits[1] in hosts.getAllHostUinamesSorted(): return Dispatcher.__call__(self, '/host' + path_info) return Dispatcher.__call__(self, path_info.lower())
def get_data(self, **params): data = [] interval = {} if 'show' in params: uishortname = params.get('uishortname') if uishortname == 'all': uishortname = None data = reportdata.getApiPerformanceIssues(uishortname, params['from'], params['to']) if 'from' in params and 'to' in params: interval['from'] = params['from'] interval['to'] = params['to'] interval['uishortname'] = params['uishortname'] else: curdate = datetime.datetime.now() interval['from'] = 'r{}_00_{:02}'.format( curdate.strftime('%y'), (datetime.datetime.now() - datetime.timedelta(weeks=2)).isocalendar()[1]) interval['to'] = 'r{}_00_{:02}'.format( curdate.strftime('%y'), (datetime.datetime.now() - datetime.timedelta(weeks=1)).isocalendar()[1]) interval['uishortname'] = 'all' uishortnames = hosts.getAllHostUinamesSorted() return data, interval, uishortnames
def get_data(self, **params): data = [] interval = {} if 'show' in params: data = reportdata.getIndexIssues(params.get('uishortname')) if 'uishortname' in params: interval['uishortname'] = params['uishortname'] else: interval['uishortname'] = 'all' uishortnames = hosts.getAllHostUinamesSorted() return data, interval, uishortnames
def get_data(self, uishortname=None, **params): uishortnames = hosts.getAllHostUinamesSorted() bloat_type = params.get('bloat_type', 'table') order_by = params.get('order_by', 'wasted_bytes') limit = params.get('limit', '50') data = [] if uishortname: if bloat_type == 'table': msg, data = reportdata.getBloatedTablesForHostname(uishortname, order_by, limit) else: msg, data = reportdata.getBloatedIndexesForHostname(uishortname, order_by, limit) if msg: raise Exception('Failed to get data: ' + msg) return data, uishortnames, bloat_type, order_by, limit
def get_data(self, uishortname=None, **params): uishortnames = hosts.getAllHostUinamesSorted() bloat_type = params.get('bloat_type', 'table') order_by = params.get('order_by', 'wasted_bytes') limit = params.get('limit', '50') data = [] if uishortname: if bloat_type == 'table': msg, data = reportdata.getBloatedTablesForHostname( uishortname, order_by, limit) else: msg, data = reportdata.getBloatedIndexesForHostname( uishortname, order_by, limit) if msg: raise Exception('Failed to get data: ' + msg) return data, uishortnames, bloat_type, order_by, limit
def get_data(self, **params): data = [] if 'show' in params: uishortname = params.get('uishortname') if uishortname == 'all': uishortname = None data = reportdata.getTablePerformanceIssues(uishortname, params['from'], params['to']) interval = {} if 'from' in params and 'to' in params: interval['from'] = params['from'] interval['to'] = params['to'] interval['uishortname'] = params['uishortname'] else: interval['from'] = (datetime.datetime.now() - datetime.timedelta(days=3)).strftime('%Y-%m-%d') interval['to'] = (datetime.datetime.now()).strftime('%Y-%m-%d') interval['uishortname'] = 'all' return data, interval, hosts.getAllHostUinamesSorted()
def get_data(self, **params): data = [] interval = {} if 'show' in params: uishortname = params.get('uishortname') if uishortname == 'all': uishortname = None data = reportdata.getApiPerformanceIssues(uishortname, params['from'], params['to']) if 'from' in params and 'to' in params: interval['from'] = params['from'] interval['to'] = params['to'] interval['uishortname'] = params['uishortname'] else: curdate = datetime.datetime.now() interval['from'] = 'r{}_00_{:02}'.format(curdate.strftime('%y'), (datetime.datetime.now()-datetime.timedelta(weeks=2)).isocalendar()[1]) interval['to'] = 'r{}_00_{:02}'.format(curdate.strftime('%y'), (datetime.datetime.now()-datetime.timedelta(weeks=1)).isocalendar()[1]) interval['uishortname'] = 'all' uishortnames = hosts.getAllHostUinamesSorted() return data, interval, uishortnames
def get_data(self, **params): data = [] if 'show' in params: uishortname = params.get('uishortname') if uishortname == 'all': uishortname = None data = reportdata.getTablePerformanceIssues( uishortname, params['from'], params['to']) interval = {} if 'from' in params and 'to' in params: interval['from'] = params['from'] interval['to'] = params['to'] interval['uishortname'] = params['uishortname'] else: interval['from'] = ( datetime.datetime.now() - datetime.timedelta(days=3)).strftime('%Y-%m-%d') interval['to'] = (datetime.datetime.now()).strftime('%Y-%m-%d') interval['uishortname'] = 'all' return data, interval, hosts.getAllHostUinamesSorted()
def __call__(self, path_info): splits = path_info.split('/') if len(splits) > 1 and splits[1]: if splits[1].isdigit() or splits[1] in hosts.getAllHostUinamesSorted(): return Dispatcher.__call__(self, '/host' + path_info) return Dispatcher.__call__(self, path_info.lower())