dragon-pk 发表于 2008-9-1 17:17:24

做过流媒体压力测试的走过来

现在我录制了vlc脚本文件,可以编译通过,现在我想测试它的性能,也就是说要是循环的话能够跑多久,做过流媒体测试都知道发收命令内容中有cesq,我没有对其参数化,但是我想参数化cesq,不知道如何下手?现在我action的内容是:
/*********************************************************************
* Created by Mercury Interactive Windows Sockets Recorder
*
* Created on: Mon Aug 04 14:03:07
********************************************************************/

#include "lrs.h"


Action()
{   
        //int a=1;   
    lrs_create_socket("socket0", "TCP", "LocalHost=0", "RemoteHost=192.168.1.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=15947",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_searched_string("socket0", NULL, "newsession", "LB/BIN= ", "RB/BIN=\r", 9, 0, -1);

    //lrs_save_param("socket0", NULL, "newsession", 146, 10);

    lr_output_message("session is:%s", lr_eval_string("<newsession>"));

    lrs_send("socket0", "buf8", LrsLastArg);

    lrs_receive("socket0", "buf9", LrsLastArg);
   

    //lrs_create_socket("socket2", "UDP", "LocalHost=0", LrsLastArg);

   /* while(a=1)
   {
      lr_think_time(200);

      lrs_send("socket0", "buf0", LrsLastArg);

      lrs_receive("socket0", "buf1", LrsLastArg);

      lrs_send("socket0", "buf2", LrsLastArg);

      lrs_receive("socket0", "buf3", LrsLastArg);

      lrs_send("socket0", "buf6", LrsLastArg);

      lrs_receive("socket0", "buf7", LrsLastArg);

          lrs_save_searched_string("socket0", NULL, "newsession", "LB/BIN= ", "RB/BIN=\r", 9, 0, -1);

      lr_output_message("session is:%s", lr_eval_string("<newsession>"));

      lrs_send("socket0", "buf8", LrsLastArg);

      lrs_receive("socket0", "buf9", LrsLastArg);

                lrs_send("socket0", "buf31", LrsLastArg);

      lrs_receive("socket0", "buf32", LrsLastArg);
   }*/

   

    //lrs_receive("socket2", "buf10", LrsLastArg);

    /*lrs_create_socket("socket3", "UDP", "LocalHost=<NewParam>", LrsLastArg);

    lrs_send("socket3", "buf11", "TargetSocket=192.168.1.58:1", LrsLastArg);

    lrs_receive("socket2", "buf12", LrsLastArg);

    lrs_send("socket3", "buf13", "TargetSocket=192.168.1.58:1", LrsLastArg);

    lrs_receive("socket2", "buf14", LrsLastArg);

    lrs_send("socket3", "buf15", "TargetSocket=192.168.1.58:1", LrsLastArg);

    lrs_receive("socket2", "buf16", LrsLastArg);

    lrs_send("socket3", "buf17", "TargetSocket=192.168.1.58:1", LrsLastArg);

    lrs_receive("socket2", "buf18", LrsLastArg);

    lrs_send("socket3", "buf19", "TargetSocket=192.168.1.58:1", LrsLastArg);

    lrs_receive("socket2", "buf20", LrsLastArg);

    lrs_send("socket3", "buf21", "TargetSocket=192.168.1.58:1", LrsLastArg);

    lrs_receive("socket2", "buf22", LrsLastArg);

    lrs_send("socket3", "buf23", "TargetSocket=192.168.1.58:1", LrsLastArg);

    lrs_receive("socket2", "buf24", LrsLastArg);

    lrs_send("socket3", "buf25", "TargetSocket=192.168.1.58:1", LrsLastArg);

    lrs_receive("socket2", "buf26", LrsLastArg);

    lrs_send("socket3", "buf27", "TargetSocket=192.168.1.58:1", LrsLastArg);

    lrs_receive("socket2", "buf28", LrsLastArg);

    lrs_send("socket3", "buf29", "TargetSocket=192.168.1.58:1", LrsLastArg);

    lrs_receive("socket2", "buf30", LrsLastArg);

    lrs_send("socket0", "buf31", LrsLastArg);

    lrs_receive("socket0", "buf32", LrsLastArg);

    lrs_send("socket3", "buf33", "TargetSocket=192.168.1.58:1", LrsLastArg);

    lrs_close_socket("socket3");

    lrs_close_socket("socket2");

    lrs_close_socket("socket0");*/
   // lrs_disable_socket("socket2", DISABLE_SEND);

    //lrs_close_socket("socket2");

    lr_think_time(90);

    lrs_send("socket0", "buf31", LrsLastArg);

    lrs_receive("socket0", "buf32", LrsLastArg);

        while(1)
   {
      

      lrs_send("socket0", "buf0", LrsLastArg);

      lrs_receive("socket0", "buf1", LrsLastArg);
      
      lrs_send("socket0", "buf2", LrsLastArg);

      lrs_receive("socket0", "buf3", LrsLastArg);

      lrs_send("socket0", "buf6", LrsLastArg);

      lrs_receive("socket0", "buf7", LrsLastArg);

       lrs_save_searched_string("socket0", NULL, "newsession", "LB/BIN= ", "RB/BIN=\r", 9, 0, -1);

      lr_output_message("session is:%s", lr_eval_string("<newsession>"));

      lrs_send("socket0", "buf8", LrsLastArg);

      lrs_receive("socket0", "buf9", LrsLastArg);


       lr_think_time(90);

       lrs_send("socket0", "buf31", LrsLastArg);

       lrs_receive("socket0", "buf32", LrsLastArg);

               
   }

    lrs_disable_socket("socket0", DISABLE_SEND);

    lrs_close_socket("socket0");

    return 0;
}
data.ws的内容:
;WSRData 2 1

send buf0 128
        "OPTIONS rtsp://192.168.1.58:554/back.mpg RTSP/1.0\r\n"
        "CSeq: <a>\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.1.58:554/back.mpg RTSP/1.0\r\n"
        "CSeq: <b>\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.1.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.1.58:554/back.mpg/trackID=0\r\n"

/*send buf4 11
        "hostIdTest"
        "\x00"

recv buf5 11
        "hostIdTest"
        "\x00"*/

send buf6 188
        "SETUP rtsp://192.168.1.58:554/back.mpg/trackID=0 RTSP/1.0\r\n"
        "CSeq: <c>\r\n"
        "Transport: RTP/AVP;unicast;client_port=24008-24009\r\n"
        "User-Agent: VLC media player (LIVE555 Streaming Media v2007.02.20)\r\n"
        "\r\n"

recv buf7 160
        "RTSP/1.0 200 OK\r\n"
        "Transport: RTP/AVP/UDP;client_port=24008-24009\r\n"
        "Server: VLC Server\r\n"
        "Content-Length: 0\r\n"
        "Cseq: 3\r\n"
        "Cache-Control: no-cache\r\n"
        "Session: 945394267\r\n"
        "\r\n"

send buf8 167
        "PLAY rtsp://192.168.1.58:554/back.mpg RTSP/1.0\r\n"
        "CSeq: <d>\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 122
        "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: 945394267;timeout=5\r\n"
        "\r\n"
send buf31 152
        "TEARDOWN rtsp://192.168.1.58:554/back.mpg RTSP/1.0\r\n"
        "CSeq: <e>\r\n"
        "Session: <newsession>\r\n"
        "User-Agent: VLC media player (LIVE555 Streaming Media v2007.02.20)\r\n"
        "\r\n"

recv buf32 122
        "RTSP/1.0 200 OK\r\n"
        "Server: VLC Server\r\n"
        "Content-Length: 0\r\n"
        "Cseq: 5\r\n"
        "Cache-Control: no-cache\r\n"
        "Session: 945394267;timeout=5\r\n"
        "\r\n"
前面参考了对流媒体服务器达尔文进行性能测试的总结一文,但是对其while循环中的   while (a=1)

      {
                     lr_think_time(60);
      lrs_send("socket1", "buf8", LrsLastArg);
      }
buf8如下:
send buf8 252
      "PLAY rtsp://192.168.0.7/sugar.3gp RTSP/1.0\r\n"
      "CSeq: <b>\r\n"
      "Range: npt=0.000000-134.200000\r\n"
      "x-prebuffer: maxtime=2.000000\r\n"
      "x-transport-options: late-tolerance=10\r\n"
      "Session: <newsession>\r\n"
      "User-Agent: QuickTime/7.0.2 (qtver=7.0.2;os=Windows NT 5.0Service Pack 4)\r"
      "\n"
      "\r\n"
不明白buf8怎么内容是那个?


大家谁做过?请指教!

dragon-pk 发表于 2008-9-2 09:28:45

没人知道吗
页: [1]
查看完整版本: 做过流媒体压力测试的走过来