jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Levine" <david.lev...@keas.com>
Subject Re: Is there a sampler that can read a tomcat log file?
Date Mon, 02 Nov 2009 03:26:15 GMT
Thanks Deepak, you always have very thoughtful replies.

I'm trying to make sure that a particular functional path through JMeter 
results in particular lines in the tomcat log file.  I also want to make 
sure a particular functional path results in no ERRORS being logged in the 
tomcat log file.  Your idea about writing a service that just returns the 
log lines I want is pretty much what I was thinking of doing, only I was 
thinking of writing a custom sampler to wrap up the service.  It's a lot 
less work to do just what you're suggesting though.

If anyone else would find this web service useful for your JMeter test, let 
me know and I'll post the source somewhere.

David

--------------------------------------------------
From: "Deepak Shetty" <shettyd@gmail.com>
Sent: Sunday, November 01, 2009 5:16 PM
To: "JMeter Users List" <jmeter-user@jakarta.apache.org>
Subject: Re: Is there a sampler that can read a tomcat log file?

> Hi
> what are you trying to assert in the logs? Ideally your response and
> response code should tell you everything you need to know.
>
> You need not necessarily have to extend Jmeter (you could just have a JSP
> page / code on tomcat ) which returns whatever you want (that is you don't
> need any Special Log Sampler , any HTTP/Web Service sampler should work 
> just
> as well).
>
> regards
> deepak
>
> On Sun, Nov 1, 2009 at 5:06 PM, David Levine <david.levine@keas.com> 
> wrote:
>
>> Hi,
>>
>> As part of my functional test, I'd like to assert that a particular line 
>> is
>> present (or not present) in the tomcat log file for my application. 
>> After
>> looking around at the available samplers and other JMeter tricks, it 
>> doesn't
>> look like there's a way to do this without writing code and extending
>> JMeter.  Am I correct or is there a way to do this?
>>
>> OK, there's one kind of hacky way I thought of doing this, which is to
>> write a web service that returns the tomcat log as an XML document, and 
>> then
>> use an HTTP Request along with an XPath Extractor post processor, and 
>> look
>> for the log line I'm looking for.  But that means I'd have to send back 
>> the
>> whole log file every time, which could be huge - so I don't like that.
>>
>> So I was thinking of writing a new sampler, called maybe the Tomcat Log
>> Sampler, that let's you specify a regex query for log lines that you're
>> looking for, and then returns those as XML, so that you can use the XPath
>> Extractor to pull the log lines you're looking for into a variable which 
>> you
>> can then subsequently use.  The Tomcat Log Sampler would really just be a
>> proxy for a new web service I'd write, that would need to be running on 
>> the
>> tomcat web server.  The Tomcat Log Web Service would perform the actual
>> query and return the results.  That way it could scale.
>>
>> OK, does this make any sense or am I way off somewhere?
>>
>> David
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Mime
View raw message