[Statsig] Track like/follow metadata (#3435)

* Track becoming mutuals

* Track poster/liker status

* Track post and followee clout

* Track follower and liker clout

* Extract utility
This commit is contained in:
dan 2024-04-08 18:38:51 +01:00 committed by GitHub
parent 8188f61e7d
commit 887fedabea
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 75 additions and 11 deletions

View file

@ -43,6 +43,14 @@ export function attachRouteToLogEvents(
getCurrentRouteName = getRouteName
}
export function toClout(n: number | null | undefined): number | undefined {
if (n == null) {
return undefined
} else {
return Math.max(0, Math.round(Math.log(n)))
}
}
export function logEvent<E extends keyof LogEvents>(
eventName: E & string,
rawMetadata: LogEvents[E] & FlatJSONRecord,