Subject Re: Monitoring FB 1.5 Super Server
Author Stephen Boyd
My application already had a trace capability built in that allowed
me to figure out what was going on when users encountered problems
that I couldn't recreate. So I just added a timer to the main form.
Every time the timer fires I loop through my open connections and
write an entry to the trace file showing which transactions are still
open and which queries are still active for those transactions. I
then added the ability to send these traces to a central location
using a TCP/IP connection.

The TCP/IP stuff is a bit involved but the tracing code itself is
quite simple. This is how I do it using IBObjects:

// Show active transactions in the trace each time the timer
fires.
with TruckloadDataModule.IBOServerDB do
begin
for count:=0 to (TransactionCount - 1) do
if (Transactions[count].Started) then
begin
tname := Transactions[count].Name;
if (tname = '') then
tname := '<default>';
Trace(Format('Index %d (%s) started for %f seconds',
[count,
tname,
(Now - Transactions[count].LastStarted)
* 24 * 60 * 60]));
if (Transactions[count].TransactionIsActive) then
Trace('--IsActive');
for i:=0 to (Transactions[count].DatasetCount - 1) do
begin
if (Transactions[count].Datasets[i].Active) then
Trace(Format('--%s is active',
[Transactions[count].Datasets
[i].Name]));
if (Transactions[count].Datasets[i].CursorIsOpen)
then
Trace(Format('--%s has cursor open',
[Transactions[count].Datasets
[i].Name]));
end;
end;
end;