Ad Widget

Collapse

PATCH [1.3.6] Units conversion for milliseconds

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Farzad FARID
    Member
    • Apr 2007
    • 79

    #1

    PATCH [1.3.6] Units conversion for milliseconds

    Hi,

    I want to use the icmppingsec item and read the response time in milliseconds. For this I use a multiplier of 1000 and "ms" as a unit.

    The problem is, if the value exceeds 1000, the conversion function convert_units() in frontends/php/include/config.inc.php will rewrite this incorrectly using 1024 as a divider. For example "2000 ms" would be converted to "1.95 Kms" which is not really what you'd expect

    This patch creates a special case for "ms" in convert_units, and does not apply any division. What do you think?

    Actually, I think the default case of this function should use 1000 as a divider and not 1024. It's the conversion of bytes that should be a special case and not the opposite.

    Regards
    Attached Files
  • Virtul
    Junior Member
    • Jun 2011
    • 7

    #2
    Originally posted by Farzad FARID
    Hi,

    I want to use the icmppingsec item and read the response time in milliseconds. For this I use a multiplier of 1000 and "ms" as a unit.

    The problem is, if the value exceeds 1000, the conversion function convert_units() in frontends/php/include/config.inc.php will rewrite this incorrectly using 1024 as a divider. For example "2000 ms" would be converted to "1.95 Kms" which is not really what you'd expect

    This patch creates a special case for "ms" in convert_units, and does not apply any division. What do you think?

    Actually, I think the default case of this function should use 1000 as a divider and not 1024. It's the conversion of bytes that should be a special case and not the opposite.

    Regards
    Just curious, why this patch was never merged? Despite lot of software (especially the java one) returns milli- and even nanoseconds, however Zabbix still can't convert them properly. This is frustrating.
    Was it some kind of higher reason to not merge this patch?

    Comment

    • richlv
      Senior Member
      Zabbix Certified Trainer
      Zabbix Certified SpecialistZabbix Certified Professional
      • Oct 2005
      • 3112

      #3
      unit blacklist was implemented in early 1.8 versions, and that also included "ms" unit, so a functionality, offered by that patch, should be in zabbix for a long time by now
      Zabbix 3.0 Network Monitoring book

      Comment

      Working...