Esempio n. 1
0
    def get_alltables_data(self, hostId, date_from, date_to, order=None, pattern=None):
        hostId = hostId if hostId.isdigit() else hosts.uiShortnameToHostId(hostId)

        if hostId is None:
            return 'valid hostId/hostUiShortname expected'
        if order==None:
            order=2
        hostname = hosts.getHostData()[int(hostId)]['uilongname']
        top_tables = tabledata.getTopTables(hostId, date_from, date_to, order, None, pattern)
        return hostId, hostname, top_tables, order
Esempio n. 2
0
    def alltables(self, hostId, order=None):
        table = tplE.env.get_template("tables_size_table_all.html")
        tpl = tplE.env.get_template("all_tables.html")

        if order == None:
            order = 2

        return tpl.render(
            hostname=hosts.getHostData()[int(hostId)]["settings"]["uiLongName"],
            table=table.render(hostid=hostId, order=int(order), list=tabledata.getTopTables(hostId, None, order)),
        )
Esempio n. 3
0
 def index(self, order='2', date_from=None, date_to=None, limit=50, show=None):
     """ top tables over all dbs """
     order = int(order)
     if not date_from:
         date_from = (datetime.datetime.now() - datetime.timedelta(days=3)).strftime('%Y-%m-%d')
     if not date_to:
         date_to = (datetime.datetime.now() + datetime.timedelta(days=1)).strftime('%Y-%m-%d')
     top_tables = []
     top_tables = tabledata.getTopTables(None, date_from, date_to, order, limit)
     table = tplE.env.get_template('tables_global_top.html')
     return table.render(list=top_tables,
                         limit=limit, order=order, date_from=date_from, date_to=date_to)
Esempio n. 4
0
    def alltables(self, hostId, order=None):
        table = tplE.env.get_template('tables_size_table_all.html')
        tpl = tplE.env.get_template('all_tables.html')

        if order == None:
            order = 2

        return tpl.render(hostname=hosts.getHostData()[int(hostId)]['settings']
                          ['uiLongName'],
                          table=table.render(hostid=hostId,
                                             order=int(order),
                                             list=tabledata.getTopTables(
                                                 hostId, None, order)))
Esempio n. 5
0
 def renderSizeTable(self, hostId):
         table = tplE.env.get_template('tables_size_table.html')
         return table.render( hostId = hostId, list=tabledata.getTopTables( hostId, 10) )
    def alltables(self, hostId , order=None):
        table = tplE.env.get_template('tables_size_table_all.html')
        tpl = tplE.env.get_template('all_tables.html')

        hostUiName = hostId if not hostId.isdigit() else hosts.hostIdToUiShortname(hostId)
        hostId = hostId if hostId.isdigit() else hosts.uiShortnameToHostId(hostId)

        if hostId is None:
            return 'valid hostId/hostUiShortname expected'
        if order==None:
            order=2

        return tpl.render(hostname = hosts.getHostData()[int(hostId)]['settings']['uiLongName'], table=table.render(hostid = hostId, hostuiname=hostUiName, order=int(order), list=tabledata.getTopTables(hostId, None, order)))
Esempio n. 7
0
 def renderSizeTable(self, hostId):
     table = tplE.env.get_template('tables_size_table.html')
     return table.render(hostId=hostId,
                         list=tabledata.getTopTables(hostId, 10))