A pretty "reliable" way is to keep either a static set of counter variables
in Global class (global.asax) or even store them in Application State. You
could have a lastUpdateTime and a StartTime and get your "counts per hour"
with a simple formula. Each hour, you could reset the StartTime and so you
would have a reasonably reliable way to know how many requests per hour. Use
the Application_BeginRequest event to increment your counter.
Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com
"th*****************@yahoo.com" wrote:
I have a site that sometimes gets extremely high server loads. I would
like to make it so if the sustained server load is very high (million
page views per hour) then it will switch to text only mode. My question
is, what is the most reliable way to detect page views per hour
programatically. I do NOT want to read the IIS logs. But
writing/reading performance stats from performance counter is ok. I
also do not want to slow down the server by inserting a sql record for
every page view!! that would be counter productive!