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

BN-777 ⁃ Refine Stats and StatsInterpreter #2722

Open
sync-by-unito bot opened this issue Jan 10, 2023 · 0 comments
Open

BN-777 ⁃ Refine Stats and StatsInterpreter #2722

sync-by-unito bot opened this issue Jan 10, 2023 · 0 comments
Assignees

Comments

@sync-by-unito
Copy link

sync-by-unito bot commented Jan 10, 2023

The Stats algebra is meant to be a general-purpose utility for surfacing statistics about a computation. For example, it could surface statistics about VRF hits. The initial use-case was to log these statistics to CSV files for post-analysis.

The approach could also be used to replace typical logging. Instead of logging being basic strings (in which data is usually encoded in some arbitrary format), the logs could literally be structured according to stats (and be encoded in a standardized format like key=value or JSON).

The implementation could be improved to use a typeclass pattern on the data that gets logged. For example, ContainsStat[T] which contains a method toStat(t: T): Stat and produces a Stat object that roughly resembles JSON. io.circe.Json could be implicitly adapted, as could com.google.protobuf.Message. For everything else, a custom instance would be created.

Eventually, these stats should be incorporated into as many parts of the system as possible.

┆Issue is synchronized with this Jira Task by Unito

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

No branches or pull requests

1 participant