Example #1
0
File: lmtdb.c Project: LaHaine/lmt
/* helper for _insert_mds () */
static void
_insert_mds_ops (lmt_db_t db, char *mdtname, char *s)
{
    char *opname = NULL;
    uint64_t samples, sum, sumsquares;

    if (lmt_mdt_decode_v1_mdops (s, &opname, &samples, &sum, &sumsquares) < 0)
        goto done;
    if (lmt_db_insert_mds_ops_data (db, mdtname, opname,
                                    samples, sum, sumsquares) < 0) {
        _trigger_db_reconnect ();
        goto done;
    }
done:
    if (opname)
        free (opname);    
}
Example #2
0
File: tparse.c Project: LLNL/lmt
int
_parse_mdt_v1_mdops (List mdops)
{
    int retval = -1;
    char *opname, *op;
    uint64_t samples, sum, sumsq;
    ListIterator itr;

    if (!(itr = list_iterator_create (mdops)))
        goto done;
    while ((op = list_next (itr))) {
        if (lmt_mdt_decode_v1_mdops (op, &opname, &samples, &sum, &sumsq) < 0)
            goto done;
        free (opname);
    }
    retval = 0;
done:
    if (itr)
        list_iterator_destroy (itr);
    return retval;    
}
Example #3
0
File: mdt.c Project: LaHaine/lmt
int lmt_mds_decode_v2_mdops (const char *s, char **opnamep, uint64_t *samplesp,
                             uint64_t *sump, uint64_t *sumsquaresp)
{
    return lmt_mdt_decode_v1_mdops (s, opnamep, samplesp, sump, sumsquaresp);
}