Ask Your Question

Telemetry Aodh calculate the time boundary right or wrong?

asked 2017-03-20 22:03:20 -0500

zero gravatar image

Hello all, I checked the aodh code these days. I have something confused about Aodh setting the time boundary of querying statistics from ceilometer or gnocchi. the code as follow:

    def _bound_duration(self, rule):
    """Bound the duration of the statistics query."""
    now = timeutils.utcnow()
    # when exclusion of weak datapoints is enabled, we extend
    # the look-back period so as to allow a clearer sample count
    # trend to be established
    look_back = (self.look_back if not rule.get('exclude_outliers')
                 else rule['evaluation_periods'])
    window = ((rule.get('period', None) or rule['granularity'])
              * (rule['evaluation_periods'] + look_back) +
    start = now - datetime.timedelta(seconds=window)
    LOG.debug('query stats from %(start)s to '
              '%(now)s', {'start': start, 'now': now})
    return start.isoformat(), now.isoformat()

if I did not set the 'exclude_outliers', the look_back will equals to 'evaluation_periods'. and parameter window will be the rule twice 'evaluation_periods' ??? why is it ? is it correct ? why does not it use only one evaluation_periods, when I did not set the 'exclude_outliers ?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2017-03-22 04:16:57 -0500

yprokule gravatar image

@Cow - if U don't set exclude_outliers then look_back is set to self.look_back:

>>> rule = {}
>>> rule['exclude_outlier'] = None
>>> look_back = ( 123 if not rule.get('exclude_outlier') else 789 )
>>> look_back
>>> rule['exclude_outlier'] = 'Example'
>>> look_back = ( 123 if not rule.get('exclude_outlier') else 789 )
>>> look_back

am I missing smth ?

edit flag offensive delete link more


Thank you. Yes, I got what you meant. I asked to many questions at once, it may miss my question point. I am curious about that I get larger look_back when I set "exclude_outliers"=True. (because self.look_back < rule['evaluation_periods'] usually) . than it may cause time boundary to increase.

zero gravatar imagezero ( 2017-03-22 06:11:51 -0500 )edit

I guess Aodh may get more data samples (by increase time boundary). and use these data samples to exclude weak datapoint. but I am not sure.

zero gravatar imagezero ( 2017-03-22 06:14:44 -0500 )edit

Basically it's used to avoid alarm flapping between states. The data is polled at regular intervals but there is additional processing delay before it ends up at the storage backend, and can be used by AODH

yprokule gravatar imageyprokule ( 2017-03-22 06:23:29 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2017-03-20 22:03:20 -0500

Seen: 58 times

Last updated: Mar 22 '17