ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/public/ibx/trunk/testsuite/Test13.pas
(Generate patch)

Comparing ibx/trunk/testsuite/Test13.pas (file contents):
Revision 318 by tony, Thu Feb 25 11:56:36 2021 UTC vs.
Revision 319 by tony, Thu Feb 25 12:05:40 2021 UTC

# Line 30 | Line 30 | type
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;
# Line 65 | Line 66 | const
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);
# Line 77 | Line 83 | begin
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;
# Line 133 | Line 140 | begin
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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines