summaryrefslogtreecommitdiffstats
path: root/server/parser/pgsql.c
diff options
context:
space:
mode:
authorDavid Sommerseth <davids@redhat.com>2009-10-12 19:35:56 +0200
committerDavid Sommerseth <davids@redhat.com>2009-10-12 19:35:56 +0200
commit5b702dfacef74a5ca2835f208fdfa8c4ea76ba54 (patch)
treea29e0769c5c00afb80ef204588e2036480294534 /server/parser/pgsql.c
parent258116aaa3e5c9b48394c7a4911efdadbf4187d1 (diff)
downloadrteval-5b702dfacef74a5ca2835f208fdfa8c4ea76ba54.tar.gz
rteval-5b702dfacef74a5ca2835f208fdfa8c4ea76ba54.tar.xz
rteval-5b702dfacef74a5ca2835f208fdfa8c4ea76ba54.zip
Added db_register_cyclictest()
Diffstat (limited to 'server/parser/pgsql.c')
-rw-r--r--server/parser/pgsql.c65
1 files changed, 65 insertions, 0 deletions
diff --git a/server/parser/pgsql.c b/server/parser/pgsql.c
index f046557..407e0cd 100644
--- a/server/parser/pgsql.c
+++ b/server/parser/pgsql.c
@@ -298,6 +298,8 @@ int db_register_system(void *indbc, xsltStylesheet *xslt, xmlDoc *summaryxml) {
syskey = -1;
goto exit;
}
+ eFree_values(dbdata);
+
dbdata = pgsql_INSERT(dbc, hostinfo_d);
syskey = (dbdata ? syskey : -1);
eFree_values(dbdata);
@@ -429,3 +431,66 @@ int db_register_rtevalrun(void *indbc, xsltStylesheet *xslt, xmlDoc *summaryxml,
}
return rterid;
}
+
+
+int db_register_cyclictest(void *indbc, xsltStylesheet *xslt, xmlDoc *summaryxml, int rterid) {
+ PGconn *dbc = (PGconn *) indbc;
+ int result = -1;
+ xmlDoc *cyclic_d = NULL;
+ parseParams prms;
+ eurephiaVALUES *dbdata = NULL;
+
+ memset(&prms, 0, sizeof(parseParams));
+ prms.table = "cyclic_statistics";
+ prms.rterid = rterid;
+ cyclic_d = parseToSQLdata(xslt, summaryxml, &prms);
+ if( !cyclic_d ) {
+ fprintf(stderr, "** ERROR ** Could not parse the input XML data\n");
+ result = -1;
+ goto exit;
+ }
+
+ // Register the cyclictest statistics information
+ dbdata = pgsql_INSERT(dbc, cyclic_d);
+ if( !dbdata ) {
+ result = -1;
+ goto exit;
+ }
+ if( eCount(dbdata) < 1 ) {
+ fprintf(stderr, "** ERROR ** Failed to register cyclictest statistics\n");
+ result = -1;
+ eFree_values(dbdata);
+ goto exit;
+ }
+ eFree_values(dbdata);
+ xmlFreeDoc(cyclic_d);
+
+ prms.table = "cyclic_rawdata";
+ cyclic_d = parseToSQLdata(xslt, summaryxml, &prms);
+ if( !cyclic_d ) {
+ fprintf(stderr, "** ERROR ** Could not parse the input XML data\n");
+ result = -1;
+ goto exit;
+ }
+
+ // Register the cyclictest raw data
+ dbdata = pgsql_INSERT(dbc, cyclic_d);
+ if( !dbdata ) {
+ result = -1;
+ goto exit;
+ }
+ if( eCount(dbdata) < 1 ) {
+ fprintf(stderr, "** ERROR ** Failed to register cyclictest raw data\n");
+ result = -1;
+ eFree_values(dbdata);
+ goto exit;
+ }
+ eFree_values(dbdata);
+ result = 1;
+ exit:
+ if( cyclic_d ) {
+ xmlFreeDoc(cyclic_d);
+ }
+
+ return result;
+}