Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
a2acc4af
Commit
a2acc4af
authored
Sep 26, 2011
by
Jonathon Duerig
Browse files
Added functions to help track the number of database queries used.
parent
b2fa89ac
Changes
1
Hide whitespace changes
Inline
Side-by-side
db/emdbi.pm.in
View file @
a2acc4af
...
...
@@ -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;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment