You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+3-7Lines changed: 3 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,7 @@ Want to make your app faster and don't want to spend on extra infrastructure ? [
21
21
**HA-store** is a generic wrapper for your data queries, it features:
22
22
23
23
- Smart micro-caching for 'hot' information (in-memory or using the [redis-adapter](https://github.com/fed135/ha-redis-adapter))
24
-
- Request coalescing, batching, retrying and circuit-breaking
24
+
- Request coalescing, batchingand retrying
25
25
- Insightful stats and [events](#Monitoring-and-events)
26
26
- Lightweight, configurable and has **zero dependencies**
27
27
@@ -60,8 +60,7 @@ timeout | false | `null` | The maximum time allowed for the resolver to resolve.
60
60
cache | false | <pre>{ base: 1000, step: 5, limit: 30000, curve: <function(progress, start, end)> }</pre> | Caching options for the data
61
61
batch | false | <pre>{ tick: 50, max: 100 }</pre> | Batching options for the requests
62
62
retry | false | <pre>{ base: 5, step: 3, limit: 5000, curve: <function(progress, start, end)> }</pre> | Retry options for the requests
63
-
breaker | false | <pre>{ base: 1000, step: 10, limit: 65535, curve: <function(progress, start, end)>, tolerance: 1, toleranceFrame: 10000 }</pre> | Circuit-breaker options, enabled by default and triggers after the retry limit
64
-
storeOptions | false | <pre>{ pluginFallback: true, pluginRecoveryDelay: 10000, recordLimit: Infinity }</pre> | If the store plugin errors and `pluginFallback` is true, the Store instance will attempt to fallback to the default in-memory store. It will then attempt to recover the original store every `storePluginRecoveryDelay`.
63
+
storeOptions | false | <pre>{ pluginFallback: true, pluginRecoveryDelay: 10000, recordLimit: Infinity, dropFactor: 1, scavengeCycle: 50 }</pre> | If the store plugin errors and `pluginFallback` is true, the Store instance will attempt to fallback to the default in-memory store. It will then attempt to recover the original store every `storePluginRecoveryDelay`. `dropFactor` is the tuning element for the algorithm that marks records as relevant or not. A higher value (>1) means a more agressive marker, while a lower value (<1) makes it more allowing. `scavengeCycle` is the delay in ms between GC cycles for the store.
65
64
66
65
*All options are in (ms)
67
66
*Scaling options are represented via and exponential curve with base and limit being the 2 edge values while steps is the number of events over that curve.
@@ -74,17 +73,14 @@ Event | Description
74
73
--- | ---
75
74
cacheHit | When the requested item is present in the microcache, or is already being fetched. Prevents another request from being created.
76
75
cacheMiss | When the requested item is not present in the microcache and is not currently being fetched. A new request will be made.
77
-
cacheFull | Whenever a store set is denied because the maximum number of records was reached for that store.
76
+
cacheSkip | Whenever a store set is denied because the maximum number of records was reached for that store, or it was marked as extraneous.
78
77
coalescedHit | When a record query successfully hooks to the promise of the same record in transit.
79
78
query | When a batch of requests is about to be sent.
80
79
queryFailed | Indicates that the batch has failed. Retry policy will dictate if it should be re-attempted.
81
80
retryCancelled | Indicates that the batch has reached the allowed number of retries and is now abandoning.
82
81
querySuccess | Indicates that the batch request was successful.
83
82
bumpCache | When a call for an item fully loaded in the microcache succeeds, its ttl gets extended.
84
83
clearCache | When an item in the microcache has reached its ttl and is now being evicted.
85
-
circuitBroken | When a batch call fails after the limit amount of retries, the circuit gets broken - all calls in the next ttl will automatically fail. It is assumed that there is a problem with the data-source.
86
-
circuitRestored | Circuit temporarily restored, a tentative to the data-source may be sent.
87
-
circuitRecovered | The tentative request was successful and the wrapper assumes that the data-source has recovered.
88
84
storePluginErrored | The custom store has encountered an error
89
85
storePluginRestored | The custom store has been re-instantiated
0 commit comments