[Spice-devel] [spice 2/2] server: Weakly try to get a better latency value for the bandwidth test.

Uri Lublin uril at redhat.com
Thu Jul 16 01:47:18 PDT 2015


On 07/15/2015 05:38 PM, Francois Gouget wrote:
> Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
> ---
>
> NET_TEST_WARMUP_BYTES is 0 so the warmup ping is the same as the one we
> use to measure the latency. Even if it was not, the actual latency would
> be the MIN() of both anyway so we might as well use both roundtrip times
> to ward off latency jitter a bit.

Hi Francois,

Looks good to me, but please add the comment to the log message
(above the scissors).

Thanks,
     Uri.


>
>   server/main_channel.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/server/main_channel.c b/server/main_channel.c
> index f1b38af..0df1751 100644
> --- a/server/main_channel.c
> +++ b/server/main_channel.c
> @@ -959,11 +959,12 @@ static int main_channel_handle_parsed(RedChannelClient *rcc, uint32_t size, uint
>               case NET_TEST_STAGE_WARMUP:
>                   mcc->net_test_id++;
>                   mcc->net_test_stage = NET_TEST_STAGE_LATENCY;
> +                mcc->latency = roundtrip;
>                   break;
>               case NET_TEST_STAGE_LATENCY:
>                   mcc->net_test_id++;
>                   mcc->net_test_stage = NET_TEST_STAGE_RATE;
> -                mcc->latency = roundtrip;
> +                mcc->latency = MIN(mcc->latency, roundtrip);
>                   break;
>               case NET_TEST_STAGE_RATE:
>                   mcc->net_test_id = 0;
>



More information about the Spice-devel mailing list