KS-Soft. Network Management Solutions
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister    ProfileProfile    Log inLog in 

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

 
Post new topic   Reply to topic    KS-Soft Forum Index -> Configuration, Maintenance, Troubleshooting
View previous topic :: View next topic  
Author Message
Robert_in_MTL



Joined: 20 Jun 2006
Posts: 229
Location: Montreal, Quebec

PostPosted: Thu May 03, 2007 6:50 am    Post subject: Macro in a report gives me an unexpected value... Reply with quote

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>&nbsp;</td><td nowrap><b>%TestName%</b></td></tr>
<tr><td nowrap>Test type:</td><td>&nbsp;</td><td nowrap>%TestMethod%</td></tr>
<tr><td nowrap>Last Test Time</td><td>&nbsp;</td><td nowrap>%LastTestTime%</td></tr>
<tr><td nowrap>Status was</td><td>&nbsp;</td><td nowrap><b>%LastSimpleStatus%</b></td></tr>
<tr><td nowrap>Status Duration</td><td>&nbsp;</td><td nowrap>%CurrentStatusDuration%</td></tr>
<tr><td nowrap>Since</td><td>&nbsp;</td><td nowrap>%StatusChangedTime%</td></tr>
<tr><td nowrap>Last Reply</td><td>&nbsp;</td><td nowrap>%LastReply%</td></tr>
<tr><td nowrap>Interval</td><td>&nbsp;</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>&nbsp;&nbsp;&nbsp;</td><td nowrap align="right">%TotalTests%</td></tr>
<tr><td nowrap>Good&nbsp;count / (ratio)</td><td></td><td nowrap align="right" >%PassedCnt%</td><td>&nbsp;&nbsp;</td><td nowrap align="right">&nbsp;(&nbsp;%AliveRatio% )</td></tr>
<tr><td nowrap>Bad&nbsp;&nbsp;count / (ratio)</td><td></td><td nowrap align="right">%FailedCnt%</td><td>&nbsp;&nbsp;</td><td nowrap align="right">&nbsp;(&nbsp;%DeadRatio%&nbsp;)</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&nbsp;count (ratio)&nbsp;&nbsp;</td><td>&nbsp;</td><td nowrap align="right">%FolderTotal_PassedTests%&nbsp;&nbsp;</td><td nowrap align="right">(&nbsp;%FolderAverage_AliveRatio% %&nbsp;)</td></tr>
<tr><td nowrap>Bad&nbsp;&nbsp;count (ratio)&nbsp;&nbsp;</td><td>&nbsp;</td><td nowrap align="right">%FolderTotal_FailedTests%&nbsp;&nbsp;</td><td nowrap align="right">(&nbsp;%FolderAverage_DeadRatio% %&nbsp;)</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
View user's profile Send private message
KS-Soft



Joined: 03 Apr 2002
Posts: 12795
Location: USA

PostPosted: Thu May 03, 2007 12:52 pm    Post subject: Reply with quote

%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
View user's profile Send private message Visit poster's website
Robert_in_MTL



Joined: 20 Jun 2006
Posts: 229
Location: Montreal, Quebec

PostPosted: Thu May 03, 2007 1:03 pm    Post subject: Reply with quote

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
View user's profile Send private message
KS-Soft



Joined: 03 Apr 2002
Posts: 12795
Location: USA

PostPosted: Thu May 03, 2007 1:17 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Robert_in_MTL



Joined: 20 Jun 2006
Posts: 229
Location: Montreal, Quebec

PostPosted: Thu May 03, 2007 1:33 pm    Post subject: Reply with quote

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
View user's profile Send private message
KS-Soft



Joined: 03 Apr 2002
Posts: 12795
Location: USA

PostPosted: Thu May 03, 2007 1:47 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Robert_in_MTL



Joined: 20 Jun 2006
Posts: 229
Location: Montreal, Quebec

PostPosted: Fri May 04, 2007 6:56 am    Post subject: Reply with quote

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
View user's profile Send private message
KS-Soft



Joined: 03 Apr 2002
Posts: 12795
Location: USA

PostPosted: Fri May 04, 2007 12:31 pm    Post subject: Reply with quote

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

Regards
Alex
Back to top
View user's profile Send private message Visit poster's website
Robert_in_MTL



Joined: 20 Jun 2006
Posts: 229
Location: Montreal, Quebec

PostPosted: Fri May 04, 2007 12:41 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    KS-Soft Forum Index -> Configuration, Maintenance, Troubleshooting All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

KS-Soft Forum Index