Hi,
What I want to do is send Http requests for a stress test application. The
url I query will send me a 404, 400, maybe others or redirect me to a
different url. I need to do that asynchronously. I mean, I could possibily
send request using 10 threads and sending 10 requests per thread on each
time the thread loops. I doubt the Microsoft WebBrowser control will do the
trick here.
So, to summarise what I need to do : Send a query (go to a URL that will be
an ASP.NET custom handler), receive the query return (400, 404, another
URL), process the new URL to know if it's expected.
Does someone know a place where I can find code to do this? As for now, I
only found code that uses the MS WebBrowser control. Does anyone know which
classes I should use for this? I can look in msdn doc if needed afterward,
but I need something to start with.
Thanks a lot
ThunderMusic 8 1506
WebBrowser is for interactive usage (it is pretty much IE, as it is a
wrapper around SHDOCVW); perhaps you should look as WebClient, which is
a wrapper around (IIRC) HttpWebRequest and HttpWebResponse:
using (WebClient wc = new WebClient())
{
string page200 =
wc.DownloadString("http://www.google.com");
// expect this to throw
string page404 =
wc.DownloadString("http://www.google.com/doesntexist");
}
Note: HttpWebResponse provides more access to headers
Note: Pages sometimes distinguish by user-agent; you may need to spoof
the UA (header) to give realistic results
Note: another option - re-use existing code like WAS or CURL...
Marc
I just noticed your async requirement; personally, I would do this sync
(local to each thread), but on parallel threads (perhaps ThreadPool,
perhaps not) - keeps it simple for debugging; HttpWebRequest etc does
sport async options, but I believe this just runs sync on the pool
anyway.
You might also want to watch for saturation; I don't know how parallel
these classes are happy to go... you could always drop a few layers,
but that is getting grungy.
Marc
Hello,
>I just noticed your async requirement; personally, I would do this sync
(local to each thread), but on parallel threads (perhaps ThreadPool,
perhaps not) - keeps it simple for debugging; HttpWebRequest etc does
sport async options, but I believe this just runs sync on the pool
anyway.
actually, the HttpWebRequest sync methods run always async (using 2
threadpool threads per request), blocking the currrent thread until the
request completes...
Best regards,
Henning Krause
Hi,
Henning Krause [MVP - Exchange] wrote:
Hello,
>I just noticed your async requirement; personally, I would do this sync (local to each thread), but on parallel threads (perhaps ThreadPool, perhaps not) - keeps it simple for debugging; HttpWebRequest etc does sport async options, but I believe this just runs sync on the pool anyway.
actually, the HttpWebRequest sync methods run always async (using 2
threadpool threads per request), blocking the currrent thread until the
request completes...
Why is it blocking if it's asynchronous? I don't get it.
Laurent
--
Laurent Bugnion [MVP ASP.NET]
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
Hello,
Marc was talking about the synchronous methods.
The synchronous methods of the HttpWebRequest perform the actual request on
threadpool threads and block the calling thread until the request has
finished.
Best regards,
Henning Krause
"Laurent Bugnion [MVP]" <ga*********@bluewin.chwrote in message
news:eu**************@TK2MSFTNGP05.phx.gbl...
Hi,
Henning Krause [MVP - Exchange] wrote:
>Hello,
>>I just noticed your async requirement; personally, I would do this sync (local to each thread), but on parallel threads (perhaps ThreadPool, perhaps not) - keeps it simple for debugging; HttpWebRequest etc does sport async options, but I believe this just runs sync on the pool anyway.
actually, the HttpWebRequest sync methods run always async (using 2 threadpool threads per request), blocking the currrent thread until the request completes...
Why is it blocking if it's asynchronous? I don't get it.
Laurent
--
Laurent Bugnion [MVP ASP.NET]
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
Hi,
Henning Krause [MVP - Exchange] wrote:
Hello,
Marc was talking about the synchronous methods.
The synchronous methods of the HttpWebRequest perform the actual request
on threadpool threads and block the calling thread until the request has
finished.
Best regards,
Henning Krause
Sounds better. I was confused by your statement "the HttpWebRequest sync
methods run always async". Now I understand that the "async" you mention
is not regarding the request itself, but regarding the threading model.
Thanks for clarifying.
Greetings,
Laurent
--
Laurent Bugnion [MVP ASP.NET]
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
I doubt it will suit my needs because I need to get data dynamicly from a
database for building the URLs and doing the stress test and doing an export
job to csv or anything else before starting the actual job would be way out
of the specifications I received...
but thanks a lot, it could have been the way to go... ;) I'll keep the link
anyway, it could be useful in the future... ;)
ThunderMusic
"Peter Bromberg [C# MVP]" <pb*******@yahoo.yabbadabbadoo.comwrote in
message news:3A**********************************@microsof t.com...
It sounds more to me like you are looking for a web stress test app, and
WebTool (aka "HOMER") really fits the bill. It's totally scriptable and
has
been around for a very long time.
http://www.microsoft.com/technet/arc....mspx?mfr=true
Cheers,
Peter
--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net
"ThunderMusic" wrote:
>Hi, What I want to do is send Http requests for a stress test application. The url I query will send me a 404, 400, maybe others or redirect me to a different url. I need to do that asynchronously. I mean, I could possibily send request using 10 threads and sending 10 requests per thread on each time the thread loops. I doubt the Microsoft WebBrowser control will do the trick here.
So, to summarise what I need to do : Send a query (go to a URL that will be an ASP.NET custom handler), receive the query return (400, 404, another URL), process the new URL to know if it's expected.
Does someone know a place where I can find code to do this? As for now, I only found code that uses the MS WebBrowser control. Does anyone know which classes I should use for this? I can look in msdn doc if needed afterward, but I need something to start with.
Thanks a lot
ThunderMusic
Out of the specifications?
Sorry to be impertinent. I don't work in your environment, and I don't know
your boss, but if someone handed me a free tool that COMPLETELY REPLACES the
work I'm doing, I'm not sure I'd pass it off so easily. Not only does WAST
perform stress testing, but there are also more robust (read: not-free)
tools that will do this, all of them cheaper than having you write code.
Tell your boss you can save him thousands of dollars (in your billable time)
and show him the list of products on the market to do stress testing against
web sites. Include the Free one (WAST). You will be a HERO for saving
money and time.
--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster http://blogs.msdn.com/nickmalik
Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
"ThunderMusic" <No*************************@NoSpAm.comwrote in message
news:OD**************@TK2MSFTNGP02.phx.gbl...
>I doubt it will suit my needs because I need to get data dynamicly from a database for building the URLs and doing the stress test and doing an export job to csv or anything else before starting the actual job would be way out of the specifications I received...
but thanks a lot, it could have been the way to go... ;) I'll keep the
link anyway, it could be useful in the future... ;)
ThunderMusic
"Peter Bromberg [C# MVP]" <pb*******@yahoo.yabbadabbadoo.comwrote in
message news:3A**********************************@microsof t.com...
>It sounds more to me like you are looking for a web stress test app, and WebTool (aka "HOMER") really fits the bill. It's totally scriptable and has been around for a very long time.
http://www.microsoft.com/technet/arc....mspx?mfr=true
Cheers, Peter -- Site: http://www.eggheadcafe.com UnBlog: http://petesbloggerama.blogspot.com Short urls & more: http://ittyurl.net
"ThunderMusic" wrote:
>>Hi, What I want to do is send Http requests for a stress test application. The url I query will send me a 404, 400, maybe others or redirect me to a different url. I need to do that asynchronously. I mean, I could possibily send request using 10 threads and sending 10 requests per thread on each time the thread loops. I doubt the Microsoft WebBrowser control will do the trick here.
So, to summarise what I need to do : Send a query (go to a URL that will be an ASP.NET custom handler), receive the query return (400, 404, another URL), process the new URL to know if it's expected.
Does someone know a place where I can find code to do this? As for now, I only found code that uses the MS WebBrowser control. Does anyone know which classes I should use for this? I can look in msdn doc if needed afterward, but I need something to start with.
Thanks a lot
ThunderMusic This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Jack |
last post by:
Hi,
I am trying to get a thorough understanding of a code where a addition or
deletion of records can be done from a list of records. For addition part of
the form, data is being obtained from set...
|
by: SP |
last post by:
Hi I have a problem with a customer's XML being submitting to me in a
non-well-format XML.
They said that there are 18 other partners who has been able to tweak the
XML to make it work.
So I...
|
by: Shapiro |
last post by:
I have a scenario where I log a resquest to a database table and update the
request with a corresponding response including the response time. I am using
an HttpModule to do this.
My challenge...
|
by: Nalaka |
last post by:
Hi,
I have some request specific data that gets created in a "early event", that
I need to pass around to many other events.
I need access to this data during that request.
(and more importantly...
|
by: dougwig |
last post by:
I'm trying to handle the scenario where a user's session times out and
and their ajax request triggers a redirection by the webserver (302
error?).
I'm using Prototype 1.4 and the my works great...
|
by: Michael Kujawa |
last post by:
I am using the following to create an SQL statement
using the names and values from request.form.
The loop goes through each item in request.form
The issue comes in having an additional "and" at...
|
by: santhoskumara |
last post by:
How to request to servlet from Ajax and also I got the DOM object in the servlet through Business Logic. Now how will i pass the DOM object from serlvet to Clientside. Where in the client Side i am...
|
by: MDANH2002 |
last post by:
Hi
From VB.NET I want to simulate the POST request of the following HTML form
<html>
<title>HTTP Post Testing</title>
<body>
<form action=http://www.example.com/postdata ...
|
by: chromis |
last post by:
Hi there,
I've recently been updating a site to use locking on application level variables, and I am trying to use a commonly used method which copies the application struct into the request...
|
by: Joseph Geretz |
last post by:
I'm using the Request Filter documentation which can be found here:
http://msdn.microsoft.com/en-us/library/system.web.httprequest.filter.aspx
In this example, two filters are installed, one...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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...
|
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,...
|
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...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |