View previous topic :: View next topic |
Author |
Message |
Robert_in_MTL
Joined: 20 Jun 2006 Posts: 229 Location: Montreal, Quebec
|
Posted: Thu May 03, 2007 6:50 am Post subject: Macro in a report gives me an unexpected value... |
|
|
Hi Alex,
I created a custom html report containing 2 tests and the code goes like this:
Test Items:
Code: | <table border=0 cellspacing=0 cellpadding=0 >
<tr><td nowrap>Test name:</td><td> </td><td nowrap><b>%TestName%</b></td></tr>
<tr><td nowrap>Test type:</td><td> </td><td nowrap>%TestMethod%</td></tr>
<tr><td nowrap>Last Test Time</td><td> </td><td nowrap>%LastTestTime%</td></tr>
<tr><td nowrap>Status was</td><td> </td><td nowrap><b>%LastSimpleStatus%</b></td></tr>
<tr><td nowrap>Status Duration</td><td> </td><td nowrap>%CurrentStatusDuration%</td></tr>
<tr><td nowrap>Since</td><td> </td><td nowrap>%StatusChangedTime%</td></tr>
<tr><td nowrap>Last Reply</td><td> </td><td nowrap>%LastReply%</td></tr>
<tr><td nowrap>Interval</td><td> </td><td nowrap>%Interval% </td></tr>
<tr><td nowrap><u>Global Info (this test):</u></td></tr>
<tr><td nowrap colspan=3>
<table border=0 cellspacing=0 cellpadding=0 >
<tr><td nowrap>Total tests</td><td> </td><td nowrap align="right">%TotalTests%</td></tr>
<tr><td nowrap>Good count / (ratio)</td><td></td><td nowrap align="right" >%PassedCnt%</td><td> </td><td nowrap align="right"> ( %AliveRatio% )</td></tr>
<tr><td nowrap>Bad count / (ratio)</td><td></td><td nowrap align="right">%FailedCnt%</td><td> </td><td nowrap align="right"> ( %DeadRatio% )</td></tr>
</table></td></tr>
<tr><td nowrap colspan=3><hr></td></tr>
</table> |
Folder Summary Code: | <table border=0 cellspacing=0 cellpadding=0>
<tr><td nowrap ><u>Global Info (All tests):</u></td></tr>
<tr><td nowrap>Good count (ratio) </td><td> </td><td nowrap align="right">%FolderTotal_PassedTests% </td><td nowrap align="right">( %FolderAverage_AliveRatio% % )</td></tr>
<tr><td nowrap>Bad count (ratio) </td><td> </td><td nowrap align="right">%FolderTotal_FailedTests% </td><td nowrap align="right">( %FolderAverage_DeadRatio% % )</td></tr>
</table> |
Here is my problem...
the first test gives me total 1442 tests, good 1416 (98.20%), bad 26 (1.80%)
the second test, total: 1177, good 1163 (98.81%) , bad 14 (1.19%)
If you calculate these numbers, they all work..
Total is 1142+1177=2619 tests.
but for the folder results...
good count: 2579 (97.34%)
bad count: 40 (2.66%)
2579+40=2619 tests (same amount)
2579/2619 gives me 98.472% for good
40/2619 gives me 1.527% for bad
Then I thought... the macro is named %FolderAverage_AliveRatio%, so if I calculate the average, (98.20+98.81)/2 gives me 98.505%
How come I get these results?
I should expect to get either 98.47%(real) ou 98.51%(average) right?
Or maybe I am just blindly using the wrong macro...
Thank you for your time. |
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12795 Location: USA
|
Posted: Thu May 03, 2007 12:52 pm Post subject: |
|
|
%FolderAverage_AliveRatio% calculates average ratio using AliveTime/TotalTime ratio. While calculation of %AliveRatio% variable depends on Statistics option located on Misc page in the Options dialog:
- Display Alive/Dead ratio of passed/failed tests
- Display Alive/Dead ratio of alive/dead time
This switch defines how Alive/Dead/Unknown ratio should be calculated: it is either based on quantity of passed/failed probes or based on alive/dead time.
In other words: if consistency between folder and test related statistics is important, use "Display Alive/Dead ratio of alive/dead time" option
Regards
Alex |
|
Back to top |
|
|
Robert_in_MTL
Joined: 20 Jun 2006 Posts: 229 Location: Montreal, Quebec
|
Posted: Thu May 03, 2007 1:03 pm Post subject: |
|
|
I have the feeling it doesn't make sense!
Why should I use Display "Alive/Dead ratio of alive/dead time"
to be consistent with calculations with results that doesn't refer to time!!!
My results show real numbers Quote: | First test gives me total 1442 tests, good 1416 (98.20%), bad 26 (1.80%) |
these numbers do not refer to time...
My setting in the options dialog is set to ration of passed/failed tests which seems to be what I want.
Also, in the custom HTML report help, the macro list for Folder specific macro variables do no include %AliveRatio% |
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12795 Location: USA
|
Posted: Thu May 03, 2007 1:17 pm Post subject: |
|
|
Well, its how program was designed.
You don't like this behaviour? Ok, lets vote. Who else wants to change this behaviour?
Regards
Alex |
|
Back to top |
|
|
Robert_in_MTL
Joined: 20 Jun 2006 Posts: 229 Location: Montreal, Quebec
|
Posted: Thu May 03, 2007 1:33 pm Post subject: |
|
|
Sorry if I got you mad,
I honestly think that my question is legitimate.
I was only trying to work things out for my report problem. |
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12795 Location: USA
|
Posted: Thu May 03, 2007 1:47 pm Post subject: |
|
|
I am not mad at all. However we are not going to change code immediately because we have a lot of customers and these modifications may have effect for most of customers that use Custom HTML reports.
Quote: | I was only trying to work things out for my report problem |
I have offered solution. Why you don't like it? Just because you want to use number of checks (test probes) to calculate ratio? I think time related counters are not worse for this purpose. Its even better to use time counters when you are using master tests or "Repeat test" and/or "Change test interval" actions.
Regards
Alex |
|
Back to top |
|
|
Robert_in_MTL
Joined: 20 Jun 2006 Posts: 229 Location: Montreal, Quebec
|
Posted: Fri May 04, 2007 6:56 am Post subject: |
|
|
You.............
Again you are right
I should learn not to challenge you beyond a certain point.
Quote: | I think time related counters are not worse for this purpose. Its even better to use time counters when you are using master tests or "Repeat test" and/or "Change test interval" actions. |
My report was not reflective of the reality on the client point of view, it was responding to the technical settings ratio (like you said, test interval), which was not "real" for the recipient of the report.
I understand your point and I agree with you.
Thank you for taking the time to answer my questionings! |
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12795 Location: USA
|
Posted: Fri May 04, 2007 12:31 pm Post subject: |
|
|
No problem. If more customers will vote for modifications, we will change the code.
Regards
Alex |
|
Back to top |
|
|
Robert_in_MTL
Joined: 20 Jun 2006 Posts: 229 Location: Montreal, Quebec
|
Posted: Fri May 04, 2007 12:41 pm Post subject: |
|
|
To be more simple...
I suggest that you Leave your code as is and provide a simple macro for each value that would reflect this ratio.
... when you have time.
Have a nice week-end. (up to 20° in Dover tomorrow! ) |
|
Back to top |
|
|
|