|
关于流媒体压力测试的一个问题:
紧急需要解决的是:发送play命令的时候socket2接收到的字节数竟然是0,而发送setup时候可以接收到期望的字节数的,具体的可以参见run时replay log的内容:
Virtual User Script started
Starting action vuser_init.
vuser_init.c(12): lrs_startup(257)
Ending action vuser_init.
Running Vuser...
Starting iteration 1.
Starting action Action.
Action.c(13): lrs_create_socket(socket0, TCP, ...)
Action.c(15): lrs_send(socket0, buf0)
Action.c(17): lrs_receive(socket0, buf1)
Action.c(19): lrs_send(socket0, buf2)
Action.c(21): lrs_receive(socket0, buf3)
Action.c(23): lrs_create_socket(socket1, UDP, ...)
Action.c(25): lrs_send(socket1, buf4)
Action.c(27): lrs_receive(socket1, buf5)
Action.c(27): Mismatch (expected 11 bytes, 0 bytes actually received)
Action.c(29): lrs_close_socket(socket1)
Action.c(31): lrs_send(socket0, buf6)
Action.c(33): lrs_receive(socket0, buf7)
Action.c(33): Mismatch (expected 161 bytes, 159 bytes actually received)
Action.c(35): lrs_save_param(socket0, null, newsession, 133, 19)
Action.c(37): param1: <newsession>
Action.c(39): lrs_send(socket0, buf8)
Action.c(49): lrs_create_socket(socket2, UDP, ...)
Action.c(51): lrs_receive(socket0, buf9)
Action.c(53): lrs_receive(socket2, buf10)
Action.c(53): Mismatch (expected 38512 bytes, 0 bytes actually received)
Action.c(55): lrs_create_socket(socket3, UDP, ...)
Action.c(57): lrs_send(socket3, buf11)
Action.c(59): lrs_receive(socket2, buf12)
Action.c(59): Mismatch (expected 885776 bytes, 0 bytes actually received)
Action.c(61): lrs_send(socket3, buf13)
Action.c(63): lrs_receive(socket2, buf14)
Action.c(63): Mismatch (expected 654704 bytes, 0 bytes actually received)
Action.c(65): lrs_send(socket3, buf15)
Action.c(67): lrs_receive(socket2, buf16)
Action.c(67): Mismatch (expected 1138096 bytes, 0 bytes actually received)
Action.c(69): lrs_send(socket3, buf17)
Action.c(71): lrs_receive(socket2, buf18)
Action.c(71): Mismatch (expected 985376 bytes, 0 bytes actually received)
Action.c(73): lrs_send(socket3, buf19)
Action.c(75): lrs_receive(socket2, buf20)
Action.c(75): Mismatch (expected 1103568 bytes, 0 bytes actually received)
Action.c(77): lrs_send(socket3, buf21)
Action.c(79): lrs_receive(socket2, buf22)
Action.c(79): Mismatch (expected 1079664 bytes, 0 bytes actually received)
Action.c(81): lrs_send(socket3, buf23)
Action.c(83): lrs_receive(socket2, buf24)
Action.c(83): Mismatch (expected 980064 bytes, 0 bytes actually received)
Action.c(85): lrs_send(socket3, buf25)
Action.c(87): lrs_receive(socket2, buf26)
Action.c(87): Mismatch (expected 1111536 bytes, 0 bytes actually received)
Action.c(89): lrs_send(socket3, buf27)
Action.c(91): lrs_receive(socket2, buf28)
Action.c(91): Mismatch (expected 1025216 bytes, 0 bytes actually received)
Action.c(93): lrs_send(socket3, buf29)
Action.c(95): lrs_receive(socket2, buf30)
Action.c(95): Mismatch (expected 974752 bytes, 0 bytes actually received)
Action.c(97): lrs_send(socket3, buf31)
Action.c(99): lrs_receive(socket2, buf32)
Action.c(99): Mismatch (expected 547136 bytes, 0 bytes actually received)
Action.c(101): lrs_send(socket3, buf33)
Action.c(103): lrs_receive(socket2, buf34)
Action.c(103): Mismatch (expected 803440 bytes, 0 bytes actually received)
Action.c(105): lrs_send(socket3, buf35)
Action.c(107): lrs_receive(socket2, buf36)
Action.c(107): Mismatch (expected 551120 bytes, 0 bytes actually received)
Action.c(109): lrs_send(socket3, buf37)
Action.c(111): lrs_receive(socket2, buf38)
Action.c(111): Mismatch (expected 827344 bytes, 0 bytes actually received)
Action.c(113): lrs_send(socket3, buf39)
Action.c(115): lrs_receive(socket2, buf40)
Action.c(115): Mismatch (expected 1053104 bytes, 0 bytes actually received)
Action.c(117): lrs_send(socket3, buf41)
Action.c(119): lrs_receive(socket2, buf42)
Action.c(119): Mismatch (expected 698528 bytes, 0 bytes actually received)
Action.c(121): lrs_send(socket3, buf43)
Action.c(123): lrs_receive(socket2, buf44)
Action.c(123): Mismatch (expected 229744 bytes, 0 bytes actually received)
Action.c(124): lrs_disable_socket(socket0, 1)
Action.c(126): lrs_close_socket(socket2)
Action.c(128): lrs_close_socket(socket0)
Ending action Action.
Ending iteration 1.
Ending Vuser...
Starting action vuser_end.
vuser_end.c(12): lrs_cleanup()
Ending action vuser_end.
Vuser Terminated.
我的action的内容是:
#include "lrs.h"
Action()
{
lrs_create_socket("socket0", "TCP", "LocalHost=0", "RemoteHost=192.168.0.58:554", LrsLastArg);
lrs_send("socket0", "buf0", LrsLastArg);
lrs_receive("socket0", "buf1", LrsLastArg);
lrs_send("socket0", "buf2", LrsLastArg);
lrs_receive("socket0", "buf3", LrsLastArg);
lrs_create_socket("socket1", "UDP", "LocalHost={NewParam}", LrsLastArg);
lrs_send("socket1", "buf4", "TargetSocket=reserved-multicast-range-NOT-delegated.example.com:15947", LrsLastArg);
lrs_receive("socket1", "buf5", LrsLastArg);
lrs_close_socket("socket1");
lrs_send("socket0", "buf6", LrsLastArg);
lrs_receive("socket0", "buf7", LrsLastArg);
lrs_save_param("socket0",NULL,"newsession",133,19);
lr_output_message ("param1: %s", lr_eval_string("<newsession>"));
lrs_send("socket0", "buf8", LrsLastArg);
/*while(a=1)
{
//lr_think_time(60);
//lrs_send("socket2", "buf10", LrsLastArg);
}*/
lrs_create_socket("socket2", "UDP", "LocalHost=0", LrsLastArg);
lrs_receive("socket0", "buf9", LrsLastArg);
lrs_receive("socket2", "buf10", LrsLastArg);
lrs_create_socket("socket3", "UDP", "LocalHost={NewParam_1}", LrsLastArg);
lrs_send("socket3", "buf11", "TargetSocket=192.168.0.58:1", LrsLastArg);
lrs_receive("socket2", "buf12", LrsLastArg);
lrs_send("socket3", "buf13", "TargetSocket=192.168.0.58:1", LrsLastArg);
lrs_receive("socket2", "buf14", LrsLastArg);
lrs_send("socket3", "buf15", "TargetSocket=192.168.0.58:1", LrsLastArg);
lrs_receive("socket2", "buf16", LrsLastArg);
lrs_send("socket3", "buf17", "TargetSocket=192.168.0.58:1", LrsLastArg);
lrs_receive("socket2", "buf18", LrsLastArg);
lrs_send("socket3", "buf19", "TargetSocket=192.168.0.58:1", LrsLastArg);
lrs_receive("socket2", "buf20", LrsLastArg);
lrs_send("socket3", "buf21", "TargetSocket=192.168.0.58:1", LrsLastArg);
lrs_receive("socket2", "buf22", LrsLastArg);
lrs_send("socket3", "buf23", "TargetSocket=192.168.0.58:1", LrsLastArg);
lrs_receive("socket2", "buf24", LrsLastArg);
lrs_send("socket3", "buf25", "TargetSocket=192.168.0.58:1", LrsLastArg);
lrs_receive("socket2", "buf26", LrsLastArg);
lrs_disable_socket("socket0", DISABLE_SEND);
lrs_close_socket("socket2");
lrs_close_socket("socket0");
return 0;
}
对应的data.ws的内容是:
;WSRData 2 1
send buf0 128
"OPTIONS rtsp://192.168.0.58:554/sh.mpg RTSP/1.0\r\n"
"CSeq: 1\r\n"
"User-Agent: VLC media player (LIVE555 Streaming Media v2007.02.20)\r\n"
"\r\n"
recv buf1 115
"RTSP/1.0 200 Ok\r\n"
"Cseq: 1\r\n"
"Server: VLC Server\r\n"
"Public: DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE\r\n"
"Content-Length: 0\r\n"
"\r\n"
send buf2 154
"DESCRIBE rtsp://192.168.0.58:554/sh.mpg RTSP/1.0\r\n"
"CSeq: 2\r\n"
"Accept: application/sdp\r\n"
"User-Agent: VLC media player (LIVE555 Streaming Media v2007.02.20)\r\n"
"\r\n"
recv buf3 339
"RTSP/1.0 200 OK\r\n"
"Content-type: application/sdp\r\n"
"Server: VLC Server\r\n"
"Content-Length: 214\r\n"
"Cseq: 2\r\n"
"Cache-Control: no-cache\r\n"
"\r\n"
"v=0\r\n"
"o=- 1217380334398509 2 IN IP4 192.168.0.58\r\n"
"c=IN IP4 0.0.0.0\r\n"
"t=0 0\r\n"
"a=tool:vlc 0.8.6c\r\n"
"a=range:npt=0-206.889\r\n"
"m=video 0 RTP/AVP 33\r\n"
"a=rtpmap:33 MP2T/90000\r\n"
"a=control:rtsp://192.168.0.58:554/sh.mpg/trackID=0\r\n"
send buf4 11
"hostIdTest"
"\x00"
recv buf5 11
"hostIdTest"
"\x00"
send buf6 186
"SETUP rtsp://192.168.0.58:554/sh.mpg/trackID=0 RTSP/1.0\r\n"
"CSeq: 3\r\n"
"Transport: RTP/AVP;unicast;client_port=1462-1463\r\n"
"User-Agent: VLC media player (LIVE555 Streaming Media v2007.02.20)\r\n"
"\r\n"
recv buf7 161
"RTSP/1.0 200 OK\r\n"
"Transport: RTP/AVP/UDP;client_port=1462-1463\r\n"
"Server: VLC Server\r\n"
"Content-Length: 0\r\n"
"Cseq: 3\r\n"
"Cache-Control: no-cache\r\n"
"Session: <newsession>\r\n"
"\r\n"
send buf8 167
"PLAY rtsp://192.168.0.58:554/sh.mpg RTSP/1.0\r\n"
"CSeq: 4\r\n"
"Session: <newsession>\r\n"
"Range: npt=0.000-\r\n"
"User-Agent: VLC media player (LIVE555 Streaming Media v2007.02.20)\r\n"
"\r\n"
recv buf9 125
"RTSP/1.0 200 OK\r\n"
"Server: VLC Server\r\n"
"Content-Length: 0\r\n"
"Cseq: 4\r\n"
"Cache-Control: no-cache\r\n"
"Session: <newsession>;timeout=5\r\n"
"\r\n"
recv buf10 38512
"\x80"
" "
"\x07\xb0\x11"
"\xc0"
"5"
"\x80"
""
"\xb1"
-1 |
|