jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ed Young <...@summitbid.com>
Subject Re: Calculating content length
Date Wed, 06 May 2009 16:56:50 GMT
Once again, as soon as I posted below, I seem to have solved my problem, and
again it's much simpler than I'd made it.

I simply made a user variable something like this:

CONTENT_LENGTH   ${__BeanShell("v=0${RTSP_PORT}o=- ${SESSION_ID} 0 IN IP4
${HOSTNAME}s=t=0 0a=X-playlist-item: ${PROVIDER_ID} ${ASSET_ID}c=IN IP4
0.0.0.0m=video 0 udp MP2T".length())}

The only issue is whether I need to include the CRLF __javaScript('\r\n') in
the content length calculation. I had to omit it from the above
CONTENT_LENGTH because it seems BeanShell doesn't like having __javaScript()
functions passed into it.


On Wed, Apr 29, 2009 at 7:13 PM, sebb <sebbaz@gmail.com> wrote:

> On 29/04/2009, Ed Young <ejy@summitbid.com> wrote:
> > Is there a way to calculate the length of some string, including any
> >  embedded variables?
>
> Why do you need to do this?
>
> >  It would have to first expand the variables and then do the
> calculation...
>
> Just pass the string to a function that returns its length; variables
> are resolved before the function is called.
>
> >  ---------------------------------------------------------------------
> >  To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> >  For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>


-- 
- Ed

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message