VMware Modern Apps Community
AbhishekSK
Hot Shot
Hot Shot

How can I parse the components of a decimal based metric

I'm publishing my application version to Wavefront through a single metric of the format "yyyymmdd.xxx" - Unfortunately when this gets consumed by Wavefront it interprets it a literal number, and does not show me the full string - instead it displays "20160808.1234" as 20.16 million.

Is there a way to get Wavefront to either correctly display this data, or a function to parse the latter half of the number?

Reply
0 Kudos
3 Replies
AbhishekSK
Hot Shot
Hot Shot

Hi Darragh,

If you hold the 'Shift' key before hovering over the legend, it will display the number "as is" - and if you need to extract just a fractional part of your metric's value, you can use the following recipe:

ts(metric.name) - floor(ts(metric.name))

Please let us know if this helps!

-Vasily

Reply
0 Kudos
AbhishekSK
Hot Shot
Hot Shot

Hi Vasily,

Yeah that does help, it gets the minor [sub point] data out of the metric for me, thanks a lot!

I still need to apply a multiplier to get it to appear as a whole number after that rather than a decimal, but it's progress

So my new output is 0.658 - other than [0.658 * 1000] to get a whole number, is there a function that will do this?

Reply
0 Kudos
AbhishekSK
Hot Shot
Hot Shot

Darragh,

Glad I could help! Multiplying your value by 1000 is probably your best bet here, if you know that the fractional portion always has a specific number of digits - so the values like 0.65 and 0.658 can be converted correctly to 650 and 658 respectively.

-Vasily

Reply
0 Kudos