Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-smart committed Mar 20, 2024
1 parent 5c13f41 commit 4200bd6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .changeset/breezy-countries-warn.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"effect": minor
---

add preregisteredWords options to frequency metric key type
add preregisteredWords option to frequency metric key type

You can use this to register a list of words to pre-populate the value of the
metric.
Expand Down
4 changes: 2 additions & 2 deletions packages/effect/src/internal/metric/hook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ export const counter = <A extends (number | bigint)>(
}

/** @internal */
export const frequency = (_key: MetricKey.MetricKey.Frequency): MetricHook.MetricHook.Frequency => {
export const frequency = (key: MetricKey.MetricKey.Frequency): MetricHook.MetricHook.Frequency => {
let count = 0
const values = new Map<string, number>()
for (const word of _key.keyType.preregisteredWords) {
for (const word of key.keyType.preregisteredWords) {
values.set(word, 0)
}
const update = (word: string) => {
Expand Down

0 comments on commit 4200bd6

Please sign in to comment.