[prev in list] [next in list] [prev in thread] [next in thread] 

List:       grinder-use
Subject:    Re: [Grinder-use] Displaying more information Grinder
From:       Philip Aston <philipa () mail ! com>
Date:       2010-06-30 8:55:57
Message-ID: 4C2B069D.7000408 () mail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


  Add something like this to the start of your script:

    grinder.statistics.registerSummaryExpression(
             "200 responses",
             "userLong0")

    grinder.statistics.registerSummaryExpression(
             "304 responses",
             "userLong1")

    class MyHTTPRequest(HTTPRequest):
       def processResponse(response):

         if grinder.statistics.isTestInProgress():
           testStatistics = grinder.statistics.forCurrentTest

           if response.statusCode == 200:
             testStatistics.addLong("userLong0", 1)
           elif response.statusCode == 304:
             testStatistics.addLong("userLong1", 1)

    # Redefine HTTPRequest to be my version
    HTTPRequest = MyHTTPRequest


- Phil

On 29/06/10 19:41, Janarthanam Ramalingam wrote:
> I had a similar use case and I had to settle with writing to my own 
> file. If anyone here knows better?
>
>
> On Fri, Jun 11, 2010 at 5:32 PM, Kalyana Kumar Vakkalagadda 
> <vkalyank@gmail.com <mailto:vkalyank@gmail.com>> wrote:
>
>     Hi,
>     I am looking for a way to insert two more columns to standard
>     columns in the 'Results' tab of The Grinder.
>     The use case is, apart from my server request (which instrumented
>     in grinder), I want to sub-categorize the same request based on
>     response code and display the results on the console.
>     For example, for a url hit, any response code other than 200 and
>     304, is a failure test. So, Successful Tests and Errors getting
>     updated according to my condition. Along with this I want to
>     display on the same row out of the total successful tests how many
>     are 200 and how many are 304.
>     Can somebody help me how can I program this..?
>     Thanks in advance & Regards,
>     Kalyan.
>


[Attachment #5 (text/html)]

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#ffffff">
    Add something like this to the start of your script:<br>
    <blockquote>grinder.statistics.registerSummaryExpression(<br>
              "200 responses",<br>
              "userLong0")<br>
      <br>
      grinder.statistics.registerSummaryExpression(<br>
              "304 responses",<br>
              "userLong1")<br>
      <br>
      class MyHTTPRequest(HTTPRequest):<br>
        def processResponse(response):<br>
      <br>
          if grinder.statistics.isTestInProgress():<br>
            testStatistics = grinder.statistics.forCurrentTest<br>
      <br>
            if response.statusCode == 200:<br>
              testStatistics.addLong("userLong0", 1)<br>
            elif response.statusCode == 304:<br>
              testStatistics.addLong("userLong1", 1)<br>
      <br>
      # Redefine HTTPRequest to be my version<br>
      HTTPRequest = MyHTTPRequest<br>
    </blockquote>
    <br>
    - Phil<br>
    <br>
    On 29/06/10 19:41, Janarthanam Ramalingam wrote:
    <blockquote
      cite="mid:AANLkTikPvGj5TnozJNvMye7frRGqFausMgTQZJFle77_@mail.gmail.com"
      type="cite">I had a similar use case and I had to settle with
      writing to my own file. If anyone here knows better?<br>
      <br>
      <br>
      <div class="gmail_quote">On Fri, Jun 11, 2010 at 5:32 PM, Kalyana
        Kumar Vakkalagadda <span dir="ltr">&lt;<a
            moz-do-not-send="true" href="mailto:vkalyank@gmail.com">vkalyank@gmail.com</a>&gt;</span>
        wrote:<br>
        <blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
          0.8ex; border-left: 1px solid rgb(204, 204, 204);
          padding-left: 1ex;">
          <div>Hi,</div>
          <div> </div>
          <div>I am looking for a way to insert two more columns to
            standard columns in the 'Results' tab of The Grinder.</div>
          <div> </div>
          <div>The use case is, apart from my server request (which
            instrumented in grinder), I want to sub-categorize the same
            request based on response code and display the results on
            the console.</div>
          <div> </div>
          <div>For example, for a url hit, any response code other than
            200 and 304, is a failure test. So, Successful Tests and
            Errors getting updated according to my condition. Along with
            this I want to display on the same row out of the total
            successful tests how many are 200 and how many are 304. </div>
          <div> </div>
          <div>Can somebody help me how can I program this..?</div>
          <div> </div>
          <div>Thanks in advance &amp; Regards,</div>
          <div>Kalyan.</div>
          <br>
        </blockquote>
      </div>
    </blockquote>
    <br>
  </body>
</html>


------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first

_______________________________________________
grinder-use mailing list
grinder-use@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/grinder-use


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic