Ask Your Question
0

Telemetry Aodh calculate the time boundary right or wrong?

asked 2017-03-20 22:03:20 -0600

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) +
              self.conf.additional_ingestion_lag)
    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
0

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

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
123
>>> rule['exclude_outlier'] = 'Example'
>>> look_back = ( 123 if not rule.get('exclude_outlier') else 789 )
>>> look_back
789
>>>

am I missing smth ?

edit flag offensive delete link more

Comments

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 -0600 )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 -0600 )edit
1

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 -0600 )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

Stats

Asked: 2017-03-20 22:03:20 -0600

Seen: 58 times

Last updated: Mar 22 '17