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

Refactor error storage data #79

Merged
merged 9 commits into from
Apr 26, 2022
Merged

Refactor error storage data #79

merged 9 commits into from
Apr 26, 2022

Conversation

iaguirre88
Copy link
Member

@iaguirre88 iaguirre88 commented Apr 7, 2022

This is a breaking change

Currently, we are grouping every error information in several lists
according to its error type. Eventually, this could consume a lot of
memory without providing any important benefit (the only piece of
information that changes is the timestamp and the request data).

This commit replaces that with a map structure where its key is the
hashed error info and its value is the actual error info plus:

  • the number of times this error occurred,
  • the first and the last time it happened.

Email example:

image

Webhook example:

image

@iaguirre88 iaguirre88 force-pushed the group-errors-by-hash branch 2 times, most recently from e71e5be to 97d0294 Compare April 7, 2022 16:10
Currently, we are grouping every error information in several lists
according to its error type. Eventually, this could consume a lot of
memory without providing any important benefit (the only piece of
information that changes is the timestamp and the request data).

This commit replaces that with a map structure where its key is the
hashed error info and its value is the actual error info plus:
  * the number of times this error occurred,
  * the first and the list time it happened.
@iaguirre88 iaguirre88 force-pushed the group-errors-by-hash branch from 97d0294 to da24a16 Compare April 7, 2022 16:13
@iaguirre88 iaguirre88 marked this pull request as ready for review April 7, 2022 16:40
mcass19
mcass19 previously approved these changes Apr 11, 2022
Copy link
Contributor

@mcass19 mcass19 left a comment

Choose a reason for hiding this comment

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

🚀 🚀 🚀

Really like how this ended!!! Also like the use of the first entry of the stacktrace for the hash key (but not entirely).

I think we need to update the readme in the Custom Notifiers section, right? I was also thinking that maybe it's worth to let the user know in that part of the readme something of what that ErrorInfo struct could have? (I know it's in the code, but just for attract more 😛)

accumulated_occurrences = Map.get(error_storage_item, :accumulated_occurrences)
max_storage_capacity = Map.get(error_storage_item, :__max_storage_capacity__)

if accumulated_occurrences >= max_storage_capacity, do: true, else: false
Copy link
Contributor

Choose a reason for hiding this comment

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

NIT: is this if necessary? 😅

Copy link
Member Author

Choose a reason for hiding this comment

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

Not at all 😅

mcass19
mcass19 previously approved these changes Apr 22, 2022
@iaguirre88 iaguirre88 merged commit d6d4781 into master Apr 26, 2022
@iaguirre88 iaguirre88 deleted the group-errors-by-hash branch April 26, 2022 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants