Thanks for response, sebb. Here's bugzilla with patch: https://issues.apache.org/bugzilla/show_bug.cgi?id=56807
-- Andrey Pohilko On 04.08.2014 13:57, sebb wrote: > On 4 August 2014 07:37, Andrey Pohilko <[email protected]> wrote: >> Hi, >> >> I stuck with the situation where I have a child of ResultCollector and want >> to process resulting JTL on testEnded(), but because of buffered writing to >> file (which is good) I get the incomplete file. For short tests the file is >> empty. >> >> In the code I found that writer field is private: >> https://github.com/apache/jmeter/blob/trunk/src/core/org/apache/jmeter/reporters/ResultCollector.java#L141 > Yes, as far as possible all mutable fields are private. > Data encapsulation and thread safety are the reasons. > >> Also the method to flush all files is also private: >> https://github.com/apache/jmeter/blob/trunk/src/core/org/apache/jmeter/reporters/ResultCollector.java#L597 > Yes, that is also deliberate; it must only be called at shutdown. > >> So I have no ability to tell JMeter to flush the file, to have its full >> contents available in testEnded(). I'd like either to have 'out' field as >> protected > No. > >> , or have a protected (maybe even public) method flush() to do a >> flush on the writer. > A protected flush() method would be OK. > It does not make sense to have a public method as only subclasses > would need to use it. > >> I'm ready to create and send a patch (it's trivial), but would like to ask >> the team first if this is possible and which way if preferred. >> >> Thanks, >> Andrey >> >>
