Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/O Code)
 Database Query Count + Hidden Timer Count
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

spyordie007
Junior Member

USA
408 Posts

Posted - 30 April 2003 :  14:04:54  Show Profile  Visit spyordie007's Homepage  Send spyordie007 an AOL message
This should be really simple to create, but I would like to have a count of the trips to the DB get inserted in the output within a comment (so that end users dont see it). I would also like to hide the Timer within a comment so that end users cannot see that either.

The Database Trip Count should be fairly simple to create (as Davio hinted here), the twist would just be to wrap both within a comment so that the way to view them would be to look at the source of the HTML output.
-Spy

Power - The only narcotic controlled by the SEC, not the FDA.

Prosperity without pollution! The American Hydrogen Association - http://www.ahanw.org
Questions about Hydrogen? Post them on our forum - http://www.ahanw.org/forum

spyordie007
Junior Member

USA
408 Posts

Posted - 07 May 2003 :  12:32:06  Show Profile  Visit spyordie007's Homepage  Send spyordie007 an AOL message
bump, someone please? This should be easy...

-spy

Power - The only narcotic controlled by the SEC, not the FDA.

Prosperity without pollution! The American Hydrogen Association - http://www.ahanw.org
Questions about Hydrogen? Post them on our forum - http://www.ahanw.org/forum
Go to Top of Page

red1
Junior Member

355 Posts

Posted - 07 May 2003 :  14:01:31  Show Profile
Yes the concept is simple, but you'd need to scour all the forum files for all instances of DB calls. If you really want to do it...

Insert this in config.asp (somewhere near the top)
Dim intDBCalls
intDBCalls = 0


Then look for all instances of rs.Open or set rs = My_conn.Execute. Note that the variable names may be different. Undeneath each one of those insert this:
intDBcalls = intDBcalls + 1


Then in inc_footer.asp find the part where the timer is written and insert this:
Response.Write "<!-- DB Calls = " & intDBCalls & " -->"
Go to Top of Page

dayve
Forum Moderator

USA
5820 Posts

Posted - 07 May 2003 :  16:28:57  Show Profile  Visit dayve's Homepage
^^^ that's not really an optimal way to do it, too much room for human error (missing recordsets). It would be nice to dynamically find all queries being executed for each individual page.

Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 07 May 2003 :  18:27:17  Show Profile  Send ruirib a Yahoo! Message
Unless you encapsulate your DB calls in a function, how else can you do it?


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page

Davio
Development Team Member

Jamaica
12217 Posts

Posted - 07 May 2003 :  18:33:14  Show Profile
Yeah, what Rui said.

I basically did a search for .open and for my_conn.execute in the files and did what red1 posted. It catches all the record sets.

Support Snitz Forums
Go to Top of Page

snaayk
Senior Member

USA
1061 Posts

Posted - 08 May 2003 :  10:50:50  Show Profile  Visit snaayk's Homepage  Send snaayk an AOL message  Send snaayk an ICQ Message  Send snaayk a Yahoo! Message
quote:
Originally posted by ruirib

Unless you encapsulate your DB calls in a function, how else can you do it?


Thats what I am doing now and it works like a dream. I have one function for those that may require paging and one that doesn't. The code is easier to read. And I can easily count queries on a page
Go to Top of Page

Davio
Development Team Member

Jamaica
12217 Posts

Posted - 08 May 2003 :  11:57:37  Show Profile
quote:
Thats what I am doing now and it works like a dream.
Dreams don't always go the way we want it to.

Support Snitz Forums
Go to Top of Page

snaayk
Senior Member

USA
1061 Posts

Posted - 08 May 2003 :  12:59:13  Show Profile  Visit snaayk's Homepage  Send snaayk an AOL message  Send snaayk an ICQ Message  Send snaayk a Yahoo! Message
ah yes..it starts as a dream, then suddenly, it turns into a terrible nightmare!!
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.34 seconds. Powered By: Snitz Forums 2000 Version 3.4.07