You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ambari.apache.org by "CZ Haung (JIRA)" <ji...@apache.org> on 2019/01/28 20:05:00 UTC

[jira] [Updated] (AMBARI-25125) Bugs in port_alert.py prevent alerts from being generated correctly

     [ https://issues.apache.org/jira/browse/AMBARI-25125?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

CZ Haung updated AMBARI-25125:
------------------------------
    Affects Version/s:     (was: 2.6.2)
                       2.5.2

> Bugs in port_alert.py prevent alerts from being generated correctly
> -------------------------------------------------------------------
>
>                 Key: AMBARI-25125
>                 URL: https://issues.apache.org/jira/browse/AMBARI-25125
>             Project: Ambari
>          Issue Type: Bug
>          Components: alerts
>    Affects Versions: 2.5.2
>            Reporter: CZ Haung
>            Priority: Major
>
> We have observed bugs in port_alerrt.py, which prevent alerts from being generated correctly.
> Specially, the highlighted code below has bugs.
> end_time = time.time()
> {color:#FF0000}milliseconds = end_time - start_time{color}
> {color:#FF0000}seconds = milliseconds / 1000.0{color}
> It should be
> {color:#FF0000}seconds = end_time - start_time{color}
> {color:#FF0000}milliseconds = seconds * 1000.0 ### Not referenced anymore and can be removed{color}
> {color:#333333}{color}So to have ambari agent report a 1-second response time, the actual response time need to be 1000 seconds!
> Here is what Python time.time() does:
> Help on built-in function time in module time:
> time(...)
>  time() -> floating point number
> Return the current time {color:#d04437}*in seconds*{color} since the Epoch.
>  Fractions of a second may be present if the system clock provides them.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)