def llamadaajaxdatosupdate(): datosbd = pg.executequery( "select datname,tup_returned from pg_stat_database where datname not like 'template%' and tup_fetched<>0") for values in datosbd: query = "insert into log_values values (%s,'Select', now(),%d)" % ("'" + values[0] + "'", values[1]) pg.executupdateequery(query) return dict(datosbd)
def llamadaajaxpeso(): datosbd = pg.executequery( "SELECT distinct datname,round(((pg_database_size(datname)/1024)/1024::numeric),2)::real from pg_database where datname not like 'template%' ") for values in datosbd: query = "insert into log_values values (%s,'Weigth', now(),%d)" % ("'" + values[0] + "'", values[1]) pg.executupdateequery(query) return dict(datosbd)
def llamadaajaxdatosupdate(): datosbd = pg.executequery( "select datname,tup_returned from pg_stat_database where datname not like 'template%' and tup_fetched<>0" ) for values in datosbd: query = "insert into log_values values (%s,'Select', now(),%d)" % ( "'" + values[0] + "'", values[1]) pg.executupdateequery(query) return dict(datosbd)
def llamadaajaxpeso(): datosbd = pg.executequery( "SELECT distinct datname,round(((pg_database_size(datname)/1024)/1024::numeric),2)::real from pg_database where datname not like 'template%' " ) for values in datosbd: query = "insert into log_values values (%s,'Weigth', now(),%d)" % ( "'" + values[0] + "'", values[1]) pg.executupdateequery(query) return dict(datosbd)
def llamadaajaxdatosconeccion(): datosbd = pg.executequery( "select datname,numbackends from pg_stat_database where datname not like 'template%' and numbackends<>0 ") for values in datosbd: query = "insert into log_values values (%s,'Conection', now(),%d)" % ("'" + values[0] + "'", values[1]) pg.executupdateequery(query) var = dict(datosbd) var[""] = 0.0001 return var
def llamadaajaxdatosconeccion(): datosbd = pg.executequery( "select datname,numbackends from pg_stat_database where datname not like 'template%' and numbackends<>0 " ) for values in datosbd: query = "insert into log_values values (%s,'Conection', now(),%d)" % ( "'" + values[0] + "'", values[1]) pg.executupdateequery(query) var = dict(datosbd) var[""] = 0.0001 return var
def llamadaajaxdatosmemoria(): datosbd = pg.executequery("select text,value from get_resource()") return dict(datosbd)
def llamadaajaxdatosfechahora(): datosbd = pg.executequery( "select 'fecha y Hora',current_date::text||' , '||to_char(current_timestamp,'HH24:MI:SS')" ) return dict(datosbd)
def llamadaajaxdatosfechahora(): datosbd = pg.executequery( "select 'fecha y Hora',current_date::text||' , '||to_char(current_timestamp,'HH24:MI:SS')") return dict(datosbd)