Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Few fixes of checking exceptions #107

Merged
merged 3 commits into from
Aug 14, 2018
Merged

Few fixes of checking exceptions #107

merged 3 commits into from
Aug 14, 2018

Conversation

titusjaka
Copy link
Contributor

  • since now we don't want to notify user if something goes wrong. So, I remove checkData.State = EXCEPTION
  • if there are 0 metrics in trigger, we want to switch trigger in TTLState instead of NODATA

- since now we don't want to notify user if something goes wrong. So, I remove checkData.State = EXCEPTION
- if there are 0 metrics in trigger, we want to switch trigger in TTLState instead of NODATA
@coveralls
Copy link

coveralls commented Aug 13, 2018

Coverage Status

Coverage increased (+0.02%) to 84.047% when pulling 897f085 on hotfix/exception-fixes into 90375fd on master.

Copy link
Contributor

@borovskyav borovskyav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Смотри комменты, там кажется можно еще немного прибраться

return checkData, nil
}
case ErrTriggerHasOnlyWildcards:
case ErrTriggerHasNoTimeSeries, ErrTriggerHasOnlyWildcards:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ох, ты тут что-то опасное пытаешься сделать.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Но вроде все норм)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Я покопался в логике. Они очень похожие, поэтому я объединил.

checker/check.go Outdated
return checkData, nil
}
case ErrTriggerHasOnlyWildcards:
case ErrTriggerHasNoTimeSeries, ErrTriggerHasOnlyWildcards:
triggerChecker.Logger.Debugf("Trigger %s: %s", triggerChecker.TriggerID, checkingError.Error())
triggerState := ToTriggerState(triggerChecker.ttlState)
if len(checkData.Metrics) == 0 && triggerState != OK {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

triggerState != OK не хотим сразу убрать? Это условие нужно тут теперь вообще?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

len(checkData.Metrics) == 0 Точно нужно, ибо мы реально хотим кидать эту ошибку только тогда, когда метрик еще не было

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

с != OK согласен

@titusjaka
Copy link
Contributor Author

@borovskyav вливаю?

@borovskyav
Copy link
Contributor

На стейджинге я бы это глянул

@titusjaka
Copy link
Contributor Author

Ок, завтра катну

@titusjaka
Copy link
Contributor Author

Кажется, всё работает как надо.

@titusjaka
Copy link
Contributor Author

Ничосе, аж дважды заапрувил =)

@titusjaka titusjaka merged commit 0d88709 into master Aug 14, 2018
@titusjaka titusjaka deleted the hotfix/exception-fixes branch August 14, 2018 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants