[ZBX-4837] Hitting Float limits with big numbers Created: 2012 Apr 04  Updated: 2017 Oct 25  Resolved: 2017 Feb 15

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Documentation (D)
Affects Version/s: 1.8.10
Fix Version/s: None

Type: Incident report Priority: Major
Reporter: Ghozlane TOUMI Assignee: Unassigned
Resolution: Fixed Votes: 1
Labels: documentation
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Sub-task
depends on ZBX-12935 Incorrect displaying(rounding) of Num... Closed
Team: Team A
Sprint: Sprint 1

 Description   

I have a bunch of NAS box that implement host-resource-mib
in this mib, hrStorageSize returns the size of the considered storage in units of hrStorageAllocationUnits witch is 4kB in my case.

I've setup my item as float, multiplier 4096, unit B

for small NASes it works OK, and I get the right Size, but for bigger NASes, I get a
I have a bunch of NAS box that implement host-resource-mib
in this mib, hrStorageSize returns the size of the considered storage in units of hrStorageAllocationUnits witch is 4kB in my case.

I've setup my item as float, multiplier 4096, unit B

for small NASes it works OK, and I get the right Size, but for bigger NASes, I get a

"Type of received value [hugenumber.0000] is not suitable for value type [Numeric (float)]"

This is a 1.7TB Nas, not that big according to actual standards.

Apparently this is related to ZBX-1126.



 Comments   
Comment by richlv [ 2012 Apr 04 ]

i don't see why would you set it to be float, if it's returned in 4kb allocation blocks anyway. just set it to integer...

Comment by Ghozlane TOUMI [ 2012 Apr 19 ]

Integer indeed works.

Is there a documentation on the limits of integer vs floats ?

I thought that floats could be used for very big and very small numbers, I'm a bit surprised that a terabyte can't fit in a float...

Thanks

Comment by richlv [ 2013 Feb 22 ]

reopening to doublecheck the docs.

we should find out whether limits for various data types (int, float, char, text, log) are documented

Comment by Oleg Ivanivskyi [ 2013 Apr 01 ]

In documentation I can't find information about limits for various data types.
But, I found two pages where it can be placed (urls for 2.0 version):
https://www.zabbix.com/documentation/2.0/manual/config/items/item#configuration
https://www.zabbix.com/documentation/2.0/manual/appendix/api/generic#supported_data_types

Comment by Aleksandrs Saveljevs [ 2016 Feb 03 ]

(1) [D] This seems to have already been documented at https://www.zabbix.com/documentation/3.0/manual/config/items/item . Quoting:

Type of data as stored in the database after performing conversions, if any.
Numeric (unsigned) - 64bit unsigned integer
Numeric (float) - floating point number
Negative values can be stored.
Allowed range (for MySQL): -999999999999.9999 to 999999999999.9999 (double(16,4)).
Starting with Zabbix 2.2, receiving values in scientific notation is also supported. E.g. 1e+70, 1e-70.
Character - character (string) data limited to 255 bytes
Log - log file. Must be set for log*, eventlog item keys (unless you plan to extract another type of data from these items, with the output parameter).
Text - text of unlimited size

Is there anything left to do here?

sasha Size of log and text values must be described for each supported database.

Text - text of unlimited size <-- it isn't truth!

wiper Fixed character, log and text type descriptions:

RESOLVED

glebs.ivanovskis Numeric (float) boundaries are documented for MySQL, although Zabbix server applies same restrictions to all backends disrespecting underlying type differences. I guess text limits are not 64 Kchars, but 64 KB. Definitely 2 KB for IBM DB2.

REOPENED

wiper Changed to bytes
RESOLVED

glebs.ivanovskis Changed "K ... bytes" to "KB". (Would it better to use "KiB" for less ambiguity?) What about Numeric (float) limits? Also scientific notation examples ("1e+70" and "1e-70") look a bit too optimistic next to them.
REOPENED

wiper Removed MYSQL from floating number range description, reduced scientific notation example values and left KB as it is.

glebs.ivanovskis I would remove "double(16,4)" too. And "1e-7" is still too optimistic, the closest we can get to zero without bumping into it is 10‍-4.

wiper RESOLVED
wiper Actually there are still discrepancies between description and various databases. We decided to create a separate table to properly document history data limits or all databases. Closing this subissue and opening new one.
CLOSED

Comment by Glebs Ivanovskis (Inactive) [ 2016 Nov 23 ]

More detailed information on what or Numeric (float) actually is.

As you see, we use a mix of binary/decimal and exact/approximate data types across DB backends.

Zabbix does not accept anything outside of (-10‍12;10‍12) range, uses double precision binary representation internally (which guarantees 15 decimal digits of precision, usually even 16) and rounds off values to 4 decimal places when printing insert statements. These measures effectively mean that Numeric (float) is capable of storing fixed point number of a very limited range.

Comment by Andris Zeila [ 2017 Feb 15 ]

(2) [D] Create a new table to properly specify history data limits for all supported database.

RESOLVED

sasha Perfect! CLOSED

Generated at Fri Mar 29 15:10:23 EET 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.