summaryrefslogtreecommitdiffstats
path: root/server/parser/pgsql.c
diff options
context:
space:
mode:
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;
+}