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
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.
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 methodtoStat(t: T): Stat
and produces aStat
object that roughly resembles JSON.io.circe.Json
could be implicitly adapted, as couldcom.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
The text was updated successfully, but these errors were encountered: