コード例 #1
0
ファイル: performance.py プロジェクト: etel/PGObserver
    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
コード例 #2
0
    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
コード例 #3
0
ファイル: performance.py プロジェクト: slitsche/PGObserver
    def get_data(self, selected_hostname, **params):
        data = {}
        filter = params.get('filter', 'api')
        from_date = params.get('from_date', (datetime.datetime.now() - datetime.timedelta(14)).strftime('%Y-%m-%d'))
        to_date = params.get('to_date', (datetime.datetime.now() + datetime.timedelta(1)).strftime('%Y-%m-%d'))

        if selected_hostname:
            data = reportdata.get_unused_schemas(selected_hostname, from_date, to_date, filter)

        host_names = hosts.getHostsWithFeature('schemaStatsGatherInterval').items()

        return data, from_date, to_date, host_names, filter
コード例 #4
0
    def get_data(self, selected_hostname, **params):
        data = {}
        filter = params.get('filter', 'api')
        from_date = params.get('from_date', (datetime.datetime.now() - datetime.timedelta(14)).strftime('%Y-%m-%d'))
        to_date = params.get('to_date', (datetime.datetime.now() + datetime.timedelta(1)).strftime('%Y-%m-%d'))

        if selected_hostname:
            data = reportdata.get_unused_schemas(selected_hostname, from_date, to_date, filter)

        host_names = hosts.getHostsWithFeature('schemaStatsGatherInterval').items()
        host_names.sort(key=lambda x: x[1]['host_name'])

        return data, from_date, to_date, host_names, filter