30 |
|
FIBSQLMonitor: TIBSQLMonitor; |
31 |
|
FLog: TStringList; |
32 |
|
procedure HandleOnSQL(EventText: String; EventTime : TDateTime); |
33 |
+ |
procedure ShowStatistics(Sender: TObject); |
34 |
|
protected |
35 |
|
procedure CreateObjects(Application: TTestApplication); override; |
36 |
|
function GetTestID: AnsiString; override; |
66 |
|
|
67 |
|
procedure TTest13.HandleOnSQL(EventText: String; EventTime: TDateTime); |
68 |
|
begin |
69 |
< |
FLog.Add('*Monitor* '+DateTimeToStr(EventTime)+' '+EventText); |
69 |
> |
FLog.Add('*Monitor* ' {+DateTimeToStr(EventTime)}+' '+EventText); |
70 |
> |
end; |
71 |
> |
|
72 |
> |
procedure TTest13.ShowStatistics(Sender: TObject); |
73 |
> |
begin |
74 |
> |
writeln(OutFile,FIBSQLMonitor.ReadCount,' ISQL Monitor Messages Received'); |
75 |
|
end; |
76 |
|
|
77 |
|
procedure TTest13.CreateObjects(Application: TTestApplication); |
83 |
|
IBDatabase.TraceFlags := [tfQPrepare, tfQExecute, tfQFetch, tfError, tfStmt, tfConnect, |
84 |
|
tfTransact, tfBlob, tfService, tfMisc]; |
85 |
|
FIBSQLMonitor.OnSQL := @HandleOnSQL; |
86 |
+ |
FIBSQLMonitor.OnMonitoringDisabled := @ShowStatistics; |
87 |
|
FIBSQLMonitor.Enabled := true; |
88 |
|
FLog := TStringList.Create; |
89 |
|
end; |
140 |
|
IBDatabase.Connected := false; |
141 |
|
CheckSynchronize(1); |
142 |
|
DisableMonitoring; |
143 |
+ |
writeln(Outfile,MonitorHook.GetWriteCount,' ISQL Monitor Messages written'); |
144 |
+ |
Sleep(1000); |
145 |
|
for i := 0 to FLog.Count - 1 do |
146 |
|
writeln(OutFile,FLog[i]); |
147 |
+ |
writeln(OutFile,FIBSQLMonitor.ReadCount,' ISQL Monitor Messages Received'); |
148 |
|
end; |
149 |
|
|
150 |
|
initialization |