473,659 Members | 2,526 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Page rendered in X seconds?

hi,
i would like to display a discreet message on all my pages indicating how
long the server took to render the page. full tracing is not an option
because it would freak out my non-technical users!
i've looked around online and can find nothing to do this, or in the SDK
docs. i thought .Net 2.0 would have something more out-of-the-box for this
type of performance measuring but i can't find any.

i was thinking about running a timer with Application_Beg inRequest and
EndRequest but that seems a little crude given that a portion of requests
will not be able to have their response stream written to, e.g. for
downloading binary files etc.
another approach is to start a timer in Page_PreInit and then end the timer
in Page_PreRender, writing it out to a label etc. But this is missing any
delay from the Unload method, is this negligable?

thanks in advance
tim
Oct 31 '06 #1
10 2929
PreInit/PreRender is ur best bet...you'll miss out on Unload, but you'll
have too since it's too late to write to the page at that point...You're
talking about millisenconds.. if that..(unless you are doing some crazy stuff
in there, but my guess is that you aren't doing anything at all).

Karl
--
http://www.openmymind.net/
http://www.codebetter.com/
"Tim_Mac" <ti********@com munity.nospamwr ote in message
news:uU******** ******@TK2MSFTN GP05.phx.gbl...
hi,
i would like to display a discreet message on all my pages indicating how
long the server took to render the page. full tracing is not an option
because it would freak out my non-technical users!
i've looked around online and can find nothing to do this, or in the SDK
docs. i thought .Net 2.0 would have something more out-of-the-box for
this type of performance measuring but i can't find any.

i was thinking about running a timer with Application_Beg inRequest and
EndRequest but that seems a little crude given that a portion of requests
will not be able to have their response stream written to, e.g. for
downloading binary files etc.
another approach is to start a timer in Page_PreInit and then end the
timer in Page_PreRender, writing it out to a label etc. But this is
missing any delay from the Unload method, is this negligable?

thanks in advance
tim

Oct 31 '06 #2
Thanks for Karl's input.

Hi Tim,

As for the " indicating how long the server took to render the page" you
mentioned, do you mean the time the ASP.NET page hander process the page's
request (load post data , handle postback events....) or the time the
runtime render out the page into response stream?

If what you want is get the time server handler process page request, I
think it ok to use the PreInit and PreRender event pair to do the
calculation since at that time all the main processing has been finished.
And as for the UnLoad event, you do not need to worry about it, because
Unload is called at the page instance's dispose time which is not guarantee
to be immediately after page's rendering, so the delay in Unload should not
be countered into page request's processing time.

In addition, though PreInit/PreRender pair can get the most page request
processing time, if you want to handle the complete time, the best choice
should be use a custom httpmodule and use the HttpApplication pipeline
events to caculate the time. The "PreRequestHand lerExecute" and
"PostRequestHan dlerExecute" events are the ones that fires before and after
page handler process the request.

#ASP.NET Application Life Cycle Overview
http://msdn2.microsoft.com/en-us/library/ms178473.aspx

http://support.microsoft.com/kb/307985/en-us

However, the limitation of using custom httphandler and pipeline event is
that we can not access the control in page structure like in Page's code,
but can only write content into current request's response stream.
Please feel free to post here if you have any other consideration or ideas.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

=============== =============== =============== =====

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.

=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 1 '06 #3
hi Steven,
thanks for your answer. i have tried it out so far with the preinit and
preRender event pair and it seems to provide a good indication. i like the
ability to write directly to page controls, rather than trying to inject
some HTML at the right point in the document via a HttpHandler.

i have some users who occassionally complain that my web application is
running slow, but i am 99.99% sure that the problem is their own company
LAN, which shares a single broadband connection. it is difficult to keep
re-assuring them that nothing is wrong with my app, so hopefully i can use
this load-time indicator to help them see if the problem is actually with
the server or their own connection.

i'm confident that the application is well written and performing very
responsively all the time, so i'm hopeful this will get the users to leave
me alone :)

many thanks again
tim

"Steven Cheng[MSFT]" <st*****@online .microsoft.comw rote in message
news:9p******** ******@TK2MSFTN GXA01.phx.gbl.. .
Thanks for Karl's input.

Hi Tim,

As for the " indicating how long the server took to render the page" you
mentioned, do you mean the time the ASP.NET page hander process the page's
request (load post data , handle postback events....) or the time the
runtime render out the page into response stream?

If what you want is get the time server handler process page request, I
think it ok to use the PreInit and PreRender event pair to do the
calculation since at that time all the main processing has been finished.
And as for the UnLoad event, you do not need to worry about it, because
Unload is called at the page instance's dispose time which is not
guarantee
to be immediately after page's rendering, so the delay in Unload should
not
be countered into page request's processing time.

In addition, though PreInit/PreRender pair can get the most page request
processing time, if you want to handle the complete time, the best choice
should be use a custom httpmodule and use the HttpApplication pipeline
events to caculate the time. The "PreRequestHand lerExecute" and
"PostRequestHan dlerExecute" events are the ones that fires before and
after
page handler process the request.

#ASP.NET Application Life Cycle Overview
http://msdn2.microsoft.com/en-us/library/ms178473.aspx

http://support.microsoft.com/kb/307985/en-us

However, the limitation of using custom httphandler and pipeline event is
that we can not access the control in page structure like in Page's code,
but can only write content into current request's response stream.
Please feel free to post here if you have any other consideration or
ideas.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

=============== =============== =============== =====

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.

=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no
rights.

Nov 1 '06 #4
Thanks for your reply Tim,

Well, now I get that why you need to add this info in each of your pages
:-).

BTW, I suggest you also check the average size (response content size) of
your pages, when the page's output size is large, the rendering time (flush
response content to client) can not be omited. Also, if you feel
necessary, you can even build a dedicated report to display the total
processing time of each page(through a custom httpmodule and use the
application events to hook the time).

Anyway, please feel free to post here if you need any further help or if
you get any progress.

Have a good day!

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 2 '06 #5
hi Steven,
thanks for the extra tip about the render phase. i do have some large
pages, upwards of 100Kb displaying a few hundred records in datagrids. i
have viewstate turned off which helps a lot, paging is not an option because
some of my user population are at the extreme novice end of the spectrum,
i.e. clicking next/previous could be a challenge!

do you know how i could factor in the Render time without going down the
HttpModule route, which i understand loses direct access to the page
controls.

thanks
tim

"Steven Cheng[MSFT]" <st*****@online .microsoft.comw rote in message
news:gg******** ******@TK2MSFTN GXA01.phx.gbl.. .
Thanks for your reply Tim,

Well, now I get that why you need to add this info in each of your pages
:-).

BTW, I suggest you also check the average size (response content size) of
your pages, when the page's output size is large, the rendering time
(flush
response content to client) can not be omited. Also, if you feel
necessary, you can even build a dedicated report to display the total
processing time of each page(through a custom httpmodule and use the
application events to hook the time).

Anyway, please feel free to post here if you need any further help or if
you get any progress.

Have a good day!

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no
rights.

Nov 2 '06 #6
Hello Tim,

Thanks for the followup.

As for the render time, I'm afraid we haven't any good means to get it
without use the httpmodule or any other system event which is out of
ASP.NET's page control's lifecycle. This is because the ASP.NET page's
controls are only available during a short period of time which is part of
the page handler's processing time, so we will not be able to record the
render time and set them to Control's properties.

Do you think it possible to create a dedicated report page which always
record and display each page's render time and the client user and visit
them to see the average status?

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 3 '06 #7
hi Steven,
i've taken another look at the performance monitoring options and i think
that should cover everything if i need to look for averages and reports etc.

what i have at the moment is at least a good indication of server
load/busyness, even if it is missing the Render stage.

thanks again for your assistance
tim
"Steven Cheng[MSFT]" <st*****@online .microsoft.comw rote in message
news:ft******** ********@TK2MSF TNGXA01.phx.gbl ...
Hello Tim,

Thanks for the followup.

As for the render time, I'm afraid we haven't any good means to get it
without use the httpmodule or any other system event which is out of
ASP.NET's page control's lifecycle. This is because the ASP.NET page's
controls are only available during a short period of time which is part of
the page handler's processing time, so we will not be able to record the
render time and set them to Control's properties.

Do you think it possible to create a dedicated report page which always
record and display each page's render time and the client user and visit
them to see the average status?

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no
rights.

Nov 3 '06 #8
Tim_Mac wrote:
hi,
i would like to display a discreet message on all my pages indicating how
long the server took to render the page. full tracing is not an option
because it would freak out my non-technical users!
i've looked around online and can find nothing to do this, or in the SDK
docs. i thought .Net 2.0 would have something more out-of-the-box for this
type of performance measuring but i can't find any.
tim
As the foregoing discussion shows, determining the details
about page download, processing (rendering), and availability
can be tricky.

The eValid solution implements testing from within a full
featured web browser. eVaild uses IE DLLs for page rendering so
internal timings are identical (or extremely close) to what
you would see in IE.

In addition to a stopwatch function, eValid also has
facilities for timing based on when objects appear on the
screen, or when objects are made available in the DOM. There
is also "detailed timing" on how long each page component
takes to download.

You can download your evaluation copy of eValid V6 from:

http://www.e-Valid.com/Products/Down...ml?status=FORM

Full details about the eValid web analysis and testing suite
can be found at:

http://www.e-Valid.com

Nov 3 '06 #9
hi eValid,
sorry i'm not interested in the browser render time, just on the server
side.
interesting product though.
tim
Nov 4 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1768
by: Waldyn | last post by:
Is there a command, or a way, to transfer to a different page using php. I currently am inserting JavaScript with a window.Open.
3
3848
by: usenet | last post by:
Hi All, I have some initialization to be done at page load time, which changes the text of some anchors so that they are consistent with the query string (these anchors are used as criteria selectors, and should be initialized to the criteria contained within the url). IE and Safari fire the onload event before rendering any elements, so when the event handler synchronizes the anchors, they are rendered with the right contents...
1
2090
by: jmgro | last post by:
I have spent way too much time trying to solve the following problem: I have a datalist with a timer in the footer template. It works wonderfully except when the user pages back, then forward, and the counter is reset. I saw in one of Kevin Spencer's comments not to put the timer in javascript on the load function, but I have to get the script to run before the page is rendered, otherwise my timer is not displayed. I have a flag "Hidden...
2
1901
by: Max | last post by:
Is it possible to reload a web page on user browser when an event occurs at server side? For example when user A places an order, user B should be notified of that and should see that order on his page. I 'd like to avoid to reload B page every nnn seconds. Or at least, I'd like to check if something interesting has changed on server and only in that case to reload the page. Any suggestion? Thanks Max
14
23147
by: lmttag | last post by:
Hello. We're developing an ASP.NET 2.0 (C#) application and we're trying to AJAX-enable it. We're having problem with a page not showing the page while a long-running process is executing. So, we're looking for a way to display the page with a "please wait..." message while the process is running, and then, when the process is done, update the page with the actual results/page content. We have a page that opens another browser/page...
3
2726
by: The alMIGHTY N | last post by:
I have an XSL file that works with a typically large XML data set generated dynamically from a database. This data is written to the HTML result as a deep multi-dimensional array that is used by Javascript functions to build large expanding/collapsing tables to display the data. The original developer wrote the page so that many writeln functions were called in embedded Javascript to actually write the table as the page was loading....
1
1780
by: Itzik | last post by:
The simple situation that works: A form (ASP 2.0 Page) with Page.MaintainScrollPositionOnPostBack set to True as well as Page.EnableViewState defaults to True. As the form's data are submitted to server and page is rendered back, the form data as well as the page scroll positions are maintained. This is OK! The complicated situation: After the form's data are submitted to server the page (let's call it X) is rendered back as usual, except...
0
895
by: seanalex | last post by:
Hi All, I have a problem with one page in one client site. The page downloads to just before the end tag of the viewstate and then stops. Most of the time it won't do anything after that, but occasionally it will complete after a couple of minutes. Now typically this page takes about 10-15 seconds to render on the screen from the time of request in other client environments. Now to go just one step further, the same page in on the same...
1
1536
by: =?Utf-8?B?UnVzc2VsIExvc2tp?= | last post by:
I am developing a web application using VS 2008. We have included the AjaxControlToolkit. We have a report page. You select the fields you want to see and the filters you want to apply. They application goes off and finds all of the records in several tables on an Oracle database then returns a report using the Microsoft Report viewer. The queries take a bit of time to run. I want to return control to the user immediately after...
0
8428
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8341
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8851
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8751
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8539
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6181
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5650
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
1982
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1739
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.