nGrinder-Recorder Investigation

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

nGrinder-Recorder Investigation

Matt
Hi,Everyone

I will refer to Grinder 's TCPProxy for implementing nGrinder recorder script.
because TCPProxy can generate HTTP script that suitable for testing.
I found HTTPRequestFilter will record any request that include URL and relevant resources (pictures,js and css ...),
and all requests will be saved in RequestList and then it converted to XML files
that used to creates script files based on httpToJythonScriptOldInstrumentation.xsl.

So I want to share with you guys about two points

Firstly our nGrinder recorde will have request filter functions.it could filter resources depend on user select options.
such as not getting statistic datas from js or css files during testing.

I found there is addReques() in HTTPRecordingImplementation and any request will be added.

    RequestType request = m_requestList.add();

so I decide to add "if statements"  to comfirm requests whether or not add into Requestlist
like this

      if(checkFileType(fileType)){
                //fileType is "js","css","png"
                //if not include this type and its request will be created and not be added
            request = RequestType.Factory.newInstance();
        }else{
            request = m_requestList.add();
       }


Secondly
     There is  nGrinder.py created by TCPProxy.although the only operation is load nGrinder login page,it seems some lengthy in this script.
so maybe httpToJythonScriptOldInstrumentation.xsl should be rewrite and simplified script file.


ok, that's all. Glad to wait for your advice.
Reply | Threaded
Open this post in threaded view
|

RE: nGrinder-Recorder Investigation

junoyoon
Administrator

Good investigation.. 

 

I'm adding my opinion on yours.

 

1. It might need to be evaluated by how much intrusive it is.

    If we do it in the custom xsl level, It might not need to change the source code but there might not no possibility how to activate this by condition.

    If we do it in the Recorder level, it might need your solution. It might be speedy and we can control all. However we might need to change TCPProxy code. 

 

2. It's always better to name the method with the purpose not how..

    For example... instead of checkFileType, isRecordEnabledType might be better. 

 

3. I've checked code as well.. TCpProxy uses PicoContainer as well. It might be better to investigate which component can be replaceable..

    If this can be done by just replacing Single component.. It might be best.

    Just implementing HTTPRecordingImplementationEx adding user code (instead of current HttpRecoridngImplementation)  and replace following code in TCPproxy can be one choice.

 

 

 else if ("-http".equalsIgnoreCase(args[i])) {

          requestFilterChain.add(HTTPRequestFilter.class);

          responseFilterChain.add(HTTPResponseFilter.class);

          m_filterContainer.addComponent(

            AttributeStringParserImplementation.class);

          m_filterContainer.addComponent(ConnectionCache.class);

          m_filterContainer.addComponent(

            ConnectionHandlerFactoryImplementation.class);

          m_filterContainer.addComponent(ParametersFromProperties.class);

          m_filterContainer.addComponent(HTTPRecordingImplementationEx.class);

          m_filterContainer.addComponent(ProcessHTTPRecordingWithXSLT.class);

          m_filterContainer.addComponent(

            RegularExpressionsImplementation.class);

          m_filterContainer.addComponent(URIParserImplementation.class);

          m_filterContainer.addComponent(SimpleStringEscaper.class);


 

4. Or.. you simply can add the custom HTTPResponseFilter.... I don't know it can eventually disable the TCPProxy processing depending on the FileType...

    However, if it just works as proxy for js, img... and skip the recoding... it might be best choice...

 

 

Always.. it's better to investigating the better cutting point... Do not focus on the leaf node... but root node. 

 

-----Original Message-----
From: "Matt [via ngrinder]"<[hidden email]>
To: "junoyoon"<[hidden email]>;
Cc:
Sent: 2013-01-10 (목) 10:06:43
Subject: nGrinder-Recorder Investigation

Hi,Everyone

I will refer to Grinder 's TCPProxy for implementing nGrinder recorder script.
because TCPProxy can generate HTTP script that suitable for testing.
I found HTTPRequestFilter will record any request that include URL and relevant resources (pictures,js and css ...),
and all requests will be saved in RequestList and then it converted to XML files
that used to creates script files based on httpToJythonScriptOldInstrumentation.xsl.

So I want to share with you guys about two points

Firstly our nGrinder recorde will have request filter functions.it could filter resources depend on user select options.
such as not getting statistic datas from js or css files during testing.

I found there is addReques() in HTTPRecordingImplementation and any request will be added.

    RequestType request = m_requestList.add();

so I decide to add "if statements"  to comfirm requests whether or not add into Requestlist
like this

      if(checkFileType(fileType)){
                //fileType is "js","css","png"
                //if not include this type and its request will be created and not be added
            request = RequestType.Factory.newInstance();
        }else{
            request = m_requestList.add();
       }


Secondly
     There is  nGrinder.py created by TCPProxy.although the only operation is load nGrinder login page,it seems some lengthy in this script.
so maybe httpToJythonScriptOldInstrumentation.xsl should be rewrite and simplified script file.


ok, that's all. Glad to wait for your advice.



If you reply to this email, your message will be added to the discussion below:
http://ngrinder.642.n7.nabble.com/nGrinder-Recorder-Investigation-tp123.html
To start a new topic under ngrinder_dev, email [hidden email]
To unsubscribe from ngrinder_dev, click here.
NAML