1 |
+ |
(* |
2 |
+ |
* IBX For Lazarus (Firebird Express) |
3 |
+ |
* |
4 |
+ |
* The contents of this file are subject to the Initial Developer's |
5 |
+ |
* Public License Version 1.0 (the "License"); you may not use this |
6 |
+ |
* file except in compliance with the License. You may obtain a copy |
7 |
+ |
* of the License here: |
8 |
+ |
* |
9 |
+ |
* http://www.firebirdsql.org/index.php?op=doc&id=idpl |
10 |
+ |
* |
11 |
+ |
* Software distributed under the License is distributed on an "AS |
12 |
+ |
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or |
13 |
+ |
* implied. See the License for the specific language governing rights |
14 |
+ |
* and limitations under the License. |
15 |
+ |
* |
16 |
+ |
* The Initial Developer of the Original Code is Tony Whyman. |
17 |
+ |
* |
18 |
+ |
* The Original Code is (C) 2015 Tony Whyman, MWA Software |
19 |
+ |
* (http://www.mwasoftware.co.uk). |
20 |
+ |
* |
21 |
+ |
* All Rights Reserved. |
22 |
+ |
* |
23 |
+ |
* Contributor(s): ______________________________________. |
24 |
+ |
* |
25 |
+ |
*) |
26 |
+ |
|
27 |
|
unit Unit1; |
28 |
|
|
29 |
|
{$mode objfpc}{$H+} |
51 |
|
{ private declarations } |
52 |
|
procedure ShowBoolValue(aValue: Long; WhenTrue, WhenFalse: string); |
53 |
|
procedure ShowStrings(aCaption: string; List: TStrings); |
54 |
+ |
function HexString(s: AnsiString): string; |
55 |
|
public |
56 |
|
{ public declarations } |
57 |
|
end; |
87 |
|
begin |
88 |
|
IBTransaction1.Active := true; |
89 |
|
TableNameLookup.Active := true; |
90 |
+ |
Memo1.Lines.Add('Authentication Method = '+ IBDatabase1.AuthenticationMethod); |
91 |
+ |
Memo1.Lines.Add('Remote Protocol = ' + IBDatabase1.RemoteProtocol); |
92 |
+ |
Memo1.Lines.Add('Attachment SQLDialect = ' + IntToStr(IBDatabase1.DBSQLDialect)); |
93 |
|
with IBDatabaseInfo1 do |
94 |
|
begin |
95 |
+ |
Memo1.Lines.Add('DB SQLDialect = ' + IntToStr(DBSQLDialect)); |
96 |
|
Memo1.Lines.Add('Allocation = ' + IntToStr(Allocation)); |
97 |
|
Memo1.Lines.Add('Base Level = ' + IntToStr(BaseLevel)); |
98 |
|
Memo1.Lines.Add('DB File Name = ' + DBFileName); |
99 |
|
Memo1.Lines.Add('DB Site Name = ' + DBSiteName); |
100 |
|
Memo1.Lines.Add('DB Implementation No = ' + IntToStr(DBImplementationNo)); |
101 |
+ |
Memo1.Lines.Add('Database Created: ' + DateTimeToStr(DateDBCreated)); |
102 |
|
Memo1.Lines.Add('DB Implementation Class = ' + IntToStr(DBImplementationClass)); |
103 |
|
ShowBoolValue(NoReserve, 'No Space Reserved','Space is Reserved'); |
104 |
|
Memo1.Lines.Add('ODS Minor Version = ' + IntToStr(ODSMinorVersion)); |
115 |
|
Memo1.Lines.Add('Marks = ' + IntToStr(Marks)); |
116 |
|
Memo1.Lines.Add('Reads = ' + IntToStr(Reads)); |
117 |
|
Memo1.Lines.Add('Writes = ' + IntToStr(Writes)); |
118 |
+ |
if ODSMajorVersion >= 12 then |
119 |
+ |
begin |
120 |
+ |
Memo1.Lines.Add('Pages Free = ' + IntToStr(PagesFree)); |
121 |
+ |
Memo1.Lines.Add('Pages Used = ' + IntToStr(PagesUsed)); |
122 |
+ |
end; |
123 |
+ |
Memo1.Lines.Add('Transaction Count = ' + IntToStr(TransactionCount)); |
124 |
|
AddPerfStats('Backout Count',BackoutCount); |
125 |
|
AddPerfStats('Delete Count',DeleteCount); |
126 |
|
AddPerfStats('Expunge Count',ExpungeCount); |
130 |
|
AddPerfStats('Read Seq Count',ReadSeqCount); |
131 |
|
AddPerfStats('Update Count',UpdateCount); |
132 |
|
Memo1.Lines.Add(''); |
95 |
– |
Memo1.Lines.Add('DB SQLDialect = ' + IntToStr(DBSQLDialect)); |
133 |
|
ShowBoolValue(ReadOnly,'Database is Read Only','Database is Read/Write'); |
134 |
+ |
Memo1.Lines.Add('Hex Dump of Database Page 100:'); |
135 |
+ |
Memo1.Lines.Add(HexString(GetDatabasePage(100))); |
136 |
|
end; |
137 |
|
end; |
138 |
|
|
158 |
|
Memo1.Lines.Add(s); |
159 |
|
end; |
160 |
|
|
161 |
+ |
function TForm1.HexString(s: AnsiString): string; |
162 |
+ |
var i: integer; |
163 |
+ |
begin |
164 |
+ |
Result := ''; |
165 |
+ |
for i := 1 to length(s) do |
166 |
+ |
Result += Format('%x ',[byte(s[i])]); |
167 |
+ |
end; |
168 |
+ |
|
169 |
|
procedure TForm1.AddPerfStats(Heading: string; |
170 |
|
stats: TStrings); |
171 |
|
var i: integer; |