Can't do calculation on PerfMon replys

When you post information about some problem, please include the following details: - OS version (e.g. Windows 2000 Professional SP3); HostMonitor version; problem description.
Post Reply
Offer
Posts: 21
Joined: Mon Dec 13, 2010 10:43 am

Can't do calculation on PerfMon replys

Post by Offer »

Hello.

I'm using a performance monitor to retrive numbers that are between 0 and 1. For convience purposes - I want to multiply the answers by 10, so I'll get numbers between up to ten.

The problem is that when I try to enter the expression %suggestedreply% * 10 - I get error "unknown operand "0.74"".

I understand the reason is that HM treats the answer as string instead of real number. Using the %suggestedreply_integer% will not help me, because it truncates the fraction after the decimal point.

Many thanks at advance for a possible solution.
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

Use ['%SuggestedReply%' * 10] expression

Regards
Alex
Offer
Posts: 21
Joined: Mon Dec 13, 2010 10:43 am

Post by Offer »

Thanks, Alex.

Simply a genious. (I assume the ''' is converter from string to numeric value?)

Just a little problem stayed:
When I use that formula, I get only Integer numbers as result. (For example - 0.74 becomes 7 after the formula). How can I get 7.4?

Thanks!
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

Sorry, don't see such option :roll:
HostMonitor rounds results of "Tune up Reply" expression because most of test methods provide integer results only...

Regards
Alex
Offer
Posts: 21
Joined: Mon Dec 13, 2010 10:43 am

Post by Offer »

Dear Alex.

Thanks for your answer.

I've tried to be a little genious myself, and here what I came with:
[('%SuggestedReply%' * 1000) div 100].[('%SuggestedReply%' * 1000) mod 100]

What do you think about this? It seems to give the wanted results. Isn't it?

Thanks again.
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

Goog idea!
I was thinking about similar expressions but was worried by rounding.
This expression should work fine when 1-2 digits after dot is enough.

Regards
Alex
Post Reply