Exemple #1
0
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)
Exemple #2
0
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)
Exemple #3
0
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)
Exemple #4
0
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)
Exemple #5
0
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
Exemple #6
0
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
Exemple #7
0
def llamadaajaxdatosmemoria():
    datosbd = pg.executequery("select text,value from get_resource()")

    return dict(datosbd)
Exemple #8
0
def llamadaajaxdatosfechahora():
    datosbd = pg.executequery(
        "select 'fecha y Hora',current_date::text||' , '||to_char(current_timestamp,'HH24:MI:SS')"
    )

    return dict(datosbd)
Exemple #9
0
def llamadaajaxdatosmemoria():
    datosbd = pg.executequery("select text,value from get_resource()")

    return  dict(datosbd)
Exemple #10
0
def llamadaajaxdatosfechahora():
    datosbd = pg.executequery(
        "select 'fecha y Hora',current_date::text||' , '||to_char(current_timestamp,'HH24:MI:SS')")

    return  dict(datosbd)