Changeset: 4ab69808874a for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=4ab69808874a
Modified Files:
        monetdb5/mal/mal_profiler.c
        tools/mserver/mserver5.c
Branch: default
Log Message:

Prepare for JSON output
included requested keyword quotes and dropped superflous ','


diffs (48 lines):

diff --git a/monetdb5/mal/mal_profiler.c b/monetdb5/mal/mal_profiler.c
--- a/monetdb5/mal/mal_profiler.c
+++ b/monetdb5/mal/mal_profiler.c
@@ -232,7 +232,7 @@ offlineProfilerEvent(MalBlkPtr mb, MalSt
 #endif
 
        if ( msg){
-               logadd("\"%s\",\t",msg);
+               logadd("\"%s\"\t",msg);
        } else {
                // TODO Obfusate instructions unless administrator calls for it.
                
@@ -244,9 +244,9 @@ offlineProfilerEvent(MalBlkPtr mb, MalSt
                        c++;
                stmtq = mal_quote(c, strlen(c));
                if (stmtq != NULL) {
-                       logadd(" \"%s\",\t", stmtq);
+                       logadd(" \"%s\"\t", stmtq);
                        GDKfree(stmtq);
-               } else logadd(" ,\t");
+               } else logadd("\t");
                GDKfree(stmt);
        }
        
diff --git a/tools/mserver/mserver5.c b/tools/mserver/mserver5.c
--- a/tools/mserver/mserver5.c
+++ b/tools/mserver/mserver5.c
@@ -155,13 +155,13 @@ monet_hello(void)
        printf("# Visit http://www.monetdb.org/ for further information\n");
 
        // The properties shipped through the performance profiler
-       len = snprintf(monet_characteristics, sizeof(monet_characteristics)-1, 
"{ MonetDBversion:\"%s\", ", VERSION);
-       len += snprintf(monet_characteristics + len, 
sizeof(monet_characteristics)-1-len, "release:\"%s\", ", MONETDB_RELEASE);
-       len += snprintf(monet_characteristics + len, 
sizeof(monet_characteristics)-1-len, "host:\"%s\", ", HOST);
-       len += snprintf(monet_characteristics + len, 
sizeof(monet_characteristics)-1-len, "threads:\"%d\", ", GDKnr_threads);
-       len += snprintf(monet_characteristics + len, 
sizeof(monet_characteristics)-1-len, "memory:\"%.3f %cB\", ", sz_mem_h, qc[qi]);
-       len += snprintf(monet_characteristics + len, 
sizeof(monet_characteristics)-1-len, "oid:\""SZFMT"\", ", sizeof(oid) *8);
-       len += snprintf(monet_characteristics + len, 
sizeof(monet_characteristics)-1-len, "packages:[");
+       len = snprintf(monet_characteristics, sizeof(monet_characteristics)-1, 
"{ \"MonetDBversion\":\"%s\", ", VERSION);
+       len += snprintf(monet_characteristics + len, 
sizeof(monet_characteristics)-1-len, "\"release\":\"%s\", ", MONETDB_RELEASE);
+       len += snprintf(monet_characteristics + len, 
sizeof(monet_characteristics)-1-len, "\"host\":\"%s\", ", HOST);
+       len += snprintf(monet_characteristics + len, 
sizeof(monet_characteristics)-1-len, "\"threads\":\"%d\", ", GDKnr_threads);
+       len += snprintf(monet_characteristics + len, 
sizeof(monet_characteristics)-1-len, "\"memory\":\"%.3f %cB\", ", sz_mem_h, 
qc[qi]);
+       len += snprintf(monet_characteristics + len, 
sizeof(monet_characteristics)-1-len, "\"oid\":\""SZFMT"\", ", sizeof(oid) *8);
+       len += snprintf(monet_characteristics + len, 
sizeof(monet_characteristics)-1-len, "\"packages\":[");
        // add the compiled in package names
 #ifdef HAVE_HGE
        len += snprintf(monet_characteristics + len, 
sizeof(monet_characteristics)-1-len, "\"%s\"","huge");
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to