Commit a2acc4af authored by Jonathon Duerig's avatar Jonathon Duerig

Added functions to help track the number of database queries used.

parent b2fa89ac
......@@ -352,6 +352,8 @@ $DBErrorString = "";
@EXPORT = qw($DBQUERY_MAXTRIES $DBQUERY_RECONNECT $DBErrorString
$DBCONN_EXITONERR $DBCONN_MAXTRIES $DBQUERY_DEBUG);
my $queryCount = 0;
sub TBDBConnect($$)
{
my ($dbnum, $dbname) = @_;
......@@ -498,6 +500,9 @@ sub DBQueryN($$)
my $maxtries = $DBQUERY_MAXTRIES;
my $result;
# Update query count total for debugging purposes
$queryCount += 1;
# Not really forever :-)
if (!$maxtries) {
$maxtries = 100000;
......@@ -788,6 +793,16 @@ END {
TBDBDisconnect();
}
sub ClearQueryCount()
{
$queryCount = 0;
}
sub GetQueryCount()
{
return $queryCount;
}
# _Always_ make sure that this 1 is at the end of the file...
1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment