views:

220

answers:

1

I'm writing both client and server code using WCF, where I need to know the "perceived" bandwidth of traffic between the client and server. I could use ping statistics to gather this information separately, but I wonder if there is a way to configure the channel stack in WCF so that the same statistics can be gathered simultaneously while performing my web service invocations. This would be particularly useful in cases where ICMP is disabled (e.g. ping won't work).

In short, while making my regular business-related web service calls (REST calls to be precise), is there a way to collect connection speed data implicitly?

Certainly I could time the web service round trip, compared to the size of data used in the round-trip, to give me an idea of throughput - but I won't know how much of that perceived bandwidth was network related, or simply due to server-processing latency. I could perhaps solve that by having the server send back a time delta, representing server latency, so that the client can compute the actual network traffic time. If a more sophisticated approach is not available, that might be my answer...

A: 

The ICMP was not created with the intention of trying those connection speed statistics, but rather if a valid connection was made between two hosts.

My best guess is that the amount of data sent in those REST calls or ICMP traffic is not enough to calculate a perceived connection speed / bandwidth.

If you calculate by these metrics, you will get very big bandwidth statistics or very low, use as an example the copy box in windows XP. You need a constant and substantial amount of data to be sent in order to calculate valid throughput statistics.

jpabluz
I will most need this throughput information, precisely when I am hammering the server with gobs of web service invocations. That might be enough to get me within 20% of a "correct" measure of perceived bandwidth - which may be sufficient for my needs.
Brent Arias
Well if you need a vague statistic, you already have your answer. The process you are describing sounds good enough. Just remove the time-lapse that the server took to process your request and you will get the time, then use the basic distance over time formula to get the network speed.
jpabluz
"distance over time formula"? Do you mean "data quantity/size over time?"
Brent Arias
Well, you got the idea!! =P
jpabluz