A key issue in developing fast programs using the MonetDB database back-end requires a keen eye on where performance is lost. Although performance tracking and measurements are highly application dependent, a simple to use tool makes life a lot easier (See stethoscope).
Activation of the performance monitor has a global effect, i.e. all concurrent actions on the kernel are traced, but the events are only sent to the client who initiated the profiler thread.
The profiler event can be handled in several ways. The default strategy is to ship the event record immediately over a stream to a performance monitor. An alternative strategy is preparation of off-line performance analysis, where event information is retained in tables.
To reduce the interference of performance measurement with the experiments, the user can use an event cache, which is emptied explicitly upon need.
MODULE profiler;
PATTERN profiler.cleanup():void;
COMMENT "";
PATTERN profiler.closestream():void;
COMMENT "";
COMMAND profiler.cpuload(X_0:lng, X_1:lng, X_2:lng, X_3:lng, X_4:lng) (X_5:int, X_6:int);
COMMENT "";
COMMAND profiler.cpustats() (X_0:lng, X_1:lng, X_2:lng, X_3:lng, X_4:lng);
COMMENT "";
COMMAND profiler.getDiskReads():lng;
COMMENT "";
COMMAND profiler.getDiskWrites():lng;
COMMENT "";
COMMAND profiler.getSystemTime():lng;
COMMENT "";
PATTERN profiler.getTrace(X_0:str):bat[:any_1];
COMMENT "";
COMMAND profiler.getUserTime():lng;
COMMENT "";
COMMAND profiler.getlimit():int;
COMMENT "";
COMMAND profiler.noop():void;
COMMENT "";
PATTERN profiler.openstream():void;
COMMENT "";
COMMAND profiler.setheartbeat(X_0:int):void;
COMMENT "";
COMMAND profiler.setlimit(X_0:int):void;
COMMENT "";
PATTERN profiler.start():void;
COMMENT "";
PATTERN profiler.starttrace():void;
COMMENT "";
PATTERN profiler.stop():void;
COMMENT "";
PATTERN profiler.stoptrace():void;
COMMENT "";
MODULE querylog;
PATTERN querylog.append(X_0:str, X_1:str, X_2:str, X_3:timestamp):void;
COMMENT "";
PATTERN querylog.call(X_0:timestamp, X_1:timestamp, X_2:str, X_3:lng, X_4:lng, X_5:lng, X_6:int, X_7:int):void;
COMMENT "";
COMMAND querylog.context(X_0:str, X_1:str, X_2:str, X_3:str):void;
COMMENT "";
COMMAND querylog.define(X_0:str, X_1:str, X_2:int):void;
COMMENT "";
COMMAND querylog.disable():void;
COMMENT "";
COMMAND querylog.empty():void;
COMMENT "";
COMMAND querylog.enable():void;
COMMENT "";
COMMAND querylog.enable(X_0:int):void;
COMMENT "";
COMMAND querylog.isset():int;
COMMENT "";
MODULE sysmon;
PATTERN sysmon.pause(X_0:int):void;
COMMENT "";
PATTERN sysmon.pause(X_0:lng):void;
COMMENT "";
PATTERN sysmon.pause(X_0:sht):void;
COMMENT "";
PATTERN sysmon.queue() (X_0:bat[:lng], X_1:bat[:int], X_2:bat[:str], X_3:bat[:timestamp], X_4:bat[:str], X_5:bat[:str], X_6:bat[:timestamp], X_7:bat[:int], X_8:bat[:int]);
COMMENT "";
PATTERN sysmon.resume(X_0:int):void;
COMMENT "";
PATTERN sysmon.resume(X_0:lng):void;
COMMENT "";
PATTERN sysmon.resume(X_0:sht):void;
COMMENT "";
PATTERN sysmon.stop(X_0:int):void;
COMMENT "";
PATTERN sysmon.stop(X_0:lng):void;
COMMENT "";
PATTERN sysmon.stop(X_0:sht):void;
COMMENT "";
PATTERN sysmon.user_statistics() (X_0:bat[:str], X_1:bat[:lng], X_2:bat[:lng], X_3:bat[:timestamp], X_4:bat[:timestamp], X_5:bat[:lng], X_6:bat[:str]);
COMMENT "";
MODULE status;
COMMAND status.batStatistics() (X_0:bat[:str], X_1:bat[:str]);
COMMENT "";
COMMAND status.cpuStatistics() (X_0:bat[:str], X_1:bat[:lng]);
COMMENT "";
COMMAND status.getThreads() (X_0:bat[:int], X_1:bat[:str]);
COMMENT "";
COMMAND status.ioStatistics() (X_0:bat[:str], X_1:bat[:lng]);
COMMENT "";
COMMAND status.memStatistics() (X_0:bat[:str], X_1:bat[:lng]);
COMMENT "";
COMMAND status.memUsage(X_0:lng) (X_1:bat[:str], X_2:bat[:lng]);
COMMENT "";
COMMAND status.mem_cursize():lng;
COMMENT "";
COMMAND status.mem_maxsize():lng;
COMMENT "";
COMMAND status.mem_maxsize(X_0:lng):void;
COMMENT "";
COMMAND status.vmStatistics(X_0:lng) (X_1:bat[:str], X_2:bat[:lng]);
COMMENT "";
COMMAND status.vm_cursize():lng;
COMMENT "";
COMMAND status.vm_maxsize():lng;
COMMENT "";
COMMAND status.vm_maxsize(X_0:lng):void;
COMMENT "";