Macro in a report gives me an unexpected value...

All questions related to installations, configurations and maintenance of Advanced Host Monitor (including additional tools such as RMA for Windows, RMA Manager, Web Servie, RCC).
Post Reply
Robert_in_MTL
Posts: 229
Joined: Tue Jun 20, 2006 1:20 pm
Location: Montreal, Quebec

Macro in a report gives me an unexpected value...

Post by Robert_in_MTL »

Hi Alex,

I created a custom html report containing 2 tests and the code goes like this:
Test Items:

Code: Select all

<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: Select all

<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.
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

%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
Robert_in_MTL
Posts: 229
Joined: Tue Jun 20, 2006 1:20 pm
Location: Montreal, Quebec

Post by Robert_in_MTL »

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
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%
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

Well, its how program was designed.
You don't like this behaviour? Ok, lets vote. Who else wants to change this behaviour?

Regards
Alex
Robert_in_MTL
Posts: 229
Joined: Tue Jun 20, 2006 1:20 pm
Location: Montreal, Quebec

Post by Robert_in_MTL »

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.
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

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.
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
Robert_in_MTL
Posts: 229
Joined: Tue Jun 20, 2006 1:20 pm
Location: Montreal, Quebec

Post by Robert_in_MTL »

You.............


Again you are right :oops:
I should learn not to challenge you beyond a certain point.:wink:
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! :roll:
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

No problem. If more customers will vote for modifications, we will change the code.

Regards
Alex
Robert_in_MTL
Posts: 229
Joined: Tue Jun 20, 2006 1:20 pm
Location: Montreal, Quebec

Post by Robert_in_MTL »

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. :wink:

Have a nice week-end. (up to 20° in Dover tomorrow! 8) )
Post Reply