[ grinder-Bugs-3505114 ] Bug in StatisticsIndexMap - Grinder 3.7.1
SourceForge.net <[email protected]> Thu, 15 Mar 2012 10:39:24 -0700
| Newsgroups | gmane.comp.java.grinder.devel |
|---|---|
| Message-ID | <[email protected]> |
Bugs item #3505114, was opened at 2012-03-15 03:33
Message generated for change (Comment added) made by philipa
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=118598&aid=3505114&group_id=18598
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Core engine
Group: None
>Status: Pending
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: Fei (ffan)
>Assigned to: Philip Aston (philipa)
Summary: Bug in StatisticsIndexMap - Grinder 3.7.1
Initial Comment:
As I explore the user defined statistics for Grinder, I found some problem. The “userLong4” value is not set correctly during the test.
In data log file, userLong4 has the same value as Test Time. After some investigation, I think the problem is with StatisticsIndexMap. When initializing the longIndexMap, prefix of ++ is used, which leaves out the index 0; but afterwards, when creating the sampleIndex, postfix of ++ is used which causes index collision: timedTests.sum overwrites the index of userLong4.
for (String longName : longNames) {
m_longMap.put(longName, new LongIndex(++nextLongIndex));
}
createLongSampleIndex("timedTests",
new LongIndex(nextLongIndex++), //collision occurs
new LongIndex(nextLongIndex++),
new DoubleIndex(nextDoubleIndex++));
# Sample Script
from net.grinder.script.Grinder import grinder
from net.grinder.script import Test
from net.grinder.plugin.http import HTTPRequest
test1 = Test(1, "Request resource")
request1 = test1.wrap(HTTPRequest())
grinder.statistics.registerDataLogExpression("userLong0", "userLong0");
grinder.statistics.registerDataLogExpression("userLong1", "userLong1");
grinder.statistics.registerDataLogExpression("userLong2", "userLong2");
grinder.statistics.registerDataLogExpression("userLong3", "userLong3");
grinder.statistics.registerDataLogExpression("userLong4", "userLong4");
class TestRunner:
def __call__(self):
grinder.statistics.delayReports = 1
request1.GET("http://www.google.com")
runNumber = grinder.getRunNumber()
if(0 == (runNumber % 3)):
grinder.statistics.forLastTest.success = 0
grinder.statistics.forLastTest.setLong("userLong0",1000)
grinder.statistics.forLastTest.setLong("userLong1",1001)
grinder.statistics.forLastTest.setLong("userLong2",1002)
grinder.statistics.forLastTest.setLong("userLong3",1003)
grinder.statistics.forLastTest.setLong("userLong4",1004)
grinder.statistics.report()
grinder.statistics.delayReports = 0
----------------------------------------------------------------------
>Comment By: Philip Aston (philipa)
Date: 2012-03-15 10:39
Message:
Fixed for next release:
http://grinder.git.sourceforge.net/git/gitweb.cgi?p=grinder/grinder;a=commitdiff;h=946124a737b2475a9b5563a270827685bb839552
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=118598&aid=3505114&group_id=18598
------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Grinder-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/grinder-development