Changeset: 883e1585e5fd for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=883e1585e5fd
Modified Files:
clients/mapiclient/mclient.c
Branch: default
Log Message:
Implemented -ftimer formatter to just print timing.
This does read all data from the server, it just doesn't print it.
Undocumented for now.
diffs (48 lines):
diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c
--- a/clients/mapiclient/mclient.c
+++ b/clients/mapiclient/mclient.c
@@ -115,7 +115,8 @@ enum formatters {
CSVformatter,
XMLformatter,
TESTformatter,
- CLEANformatter
+ CLEANformatter,
+ TIMERformatter
};
static enum formatters formatter = NOformatter;
char *output = NULL; /* output format as string */
@@ -1021,6 +1022,15 @@ RAWrenderer(MapiHdl hdl)
}
static void
+TIMERrenderer(MapiHdl hdl)
+{
+ SQLqueryEcho(hdl);
+ while (fetch_line(hdl) != 0)
+ ;
+ printf("%s\n", timerHuman());
+}
+
+static void
SQLheader(MapiHdl hdl, int *len, int fields, char more)
{
SQLqueryEcho(hdl);
@@ -1364,6 +1374,8 @@ setFormatter(char *s)
_set_output_format(_TWO_DIGIT_EXPONENT);
#endif
formatter = TESTformatter;
+ } else if (strcmp(s, "timer") == 0) {
+ formatter = TIMERformatter;
} else {
mnstr_printf(toConsole, "unsupported formatter\n");
}
@@ -1579,6 +1591,9 @@ format_result(Mapi mid, MapiHdl hdl, cha
break;
}
break;
+ case TIMERformatter:
+ TIMERrenderer(hdl);
+ break;
default:
RAWrenderer(hdl);
break;
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list