Dedupe errors when sending

Summary: Keeps a small ring buffer of errors we're sending and checks if they're tracked. I'm sure there's a better data structure for this out there were we could have O(1) membership checks, but since we're not keeping that many errors to begin with and we're saving a lot of CPU that would go into sending the errors to Scribe, this should be a net positive.

Reviewed By: mweststrate

Differential Revision: D26488825

fbshipit-source-id: fdcf58e88d43864852c13e4741a7ab620d596094
This commit is contained in:
Pascal Hartig
2021-02-18 09:02:21 -08:00
committed by Facebook GitHub Bot
parent 6667a15f2c
commit e3d1e41cc1
2 changed files with 7 additions and 1 deletions

View File

@@ -71,7 +71,8 @@
"uuid": "^8.3.2",
"which": "^2.0.1",
"ws": "^7.4.2",
"xdg-basedir": "^4.0.0"
"xdg-basedir": "^4.0.0",
"cbuffer": "^2.2.0"
},
"optionalDependencies": {
"7zip-bin-mac": "^1.0.1"

View File

@@ -3966,6 +3966,11 @@ caseless@~0.12.0:
resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc"
integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=
cbuffer@^2.2.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/cbuffer/-/cbuffer-2.2.0.tgz#b4c9c9e6f35442b245fd601742509de392a8999f"
integrity sha512-+9554Nki5QIQs3XUaU92/kl/nP+SiSfmkuic5HzH7j2IitLj+DN1YsVmuZlgXDX/vrqG5kEaRr3rnkFxU9UxlA==
chalk@^2.0.0, chalk@^2.0.1, chalk@^2.4.1, chalk@^2.4.2:
version "2.4.2"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424"