Comments (3)
This is in the plans but I haven't had time to work on it yet. I'd like a design where creating e.g. a counter indexed by N dimensions (e.g. integers and strings) can be done in a type safe manner i.e. once the counter is created calling inc
on that counter requires that you pass N dimension values of the right type. Here's how to not do it:
data Dim = T Text | I Int
newCounter :: [Dim] -> IO Counter
inc :: Counter -> [Dim] -> IO ()
I was thinking of using e.g. a phantom type to track the dimensions for a given counter by using a more untyped representation internally. Needs some thought.
from ekg-core.
Interesting idea. Keep me posted!
from ekg-core.
Just saw this issue, was replying on #12 (comment) that I've started a patch.
I'll be updating only this issue starting from now.
I'll fix ekg-json soon (very likely adding a key to the ToJSON instance), then ekg will take me more work (in particular, the HTML+JS rendering).
Then, we can imagine a typeful API using typelevel strings or a typeclass to add a variable number of arguments. This typeful API could live in another package.
I'm still unsure whether we should add a hashmap-like interface to "manage" counters for points using new dimensional breakdowns. In particular, there's a risk to have an unbounded number of counters growth if library users do not pay attention + I don't like exposing a lookupOrCreate function when I often use counters in tight-loops on-the-fly -- imho, such a lookupOrCreate function should live in another package.
from ekg-core.
Related Issues (20)
- [Feature Request] Distributions should track percentiles HOT 3
- Dynamically creating metrics HOT 11
- Export `Stats(..)` HOT 3
- Build failure with GHC HEAD
- Make a release HOT 7
- GHC 8.2.1 warnings HOT 4
- GHC 8.2.1 compilation error: Constructor ‘Stats.GCStats’ does not have the required strict field(s) HOT 5
- Distribution has N/A variance and mean HOT 5
- Support base-4.12 HOT 2
- Follow new naming in GHC.Stats? HOT 9
- `Stats` `min` is always 0 HOT 5
- build failure on ghc881 HOT 1
- RFC: Move all ekg-* packages into a monorepo HOT 4
- Linker error on Win32 — undefined reference to `__sync_fetch_and_add_8' etc. HOT 9
- Atomic C functions are not atomic. HOT 6
- Expand bounds for base + ghc-prim HOT 1
- publish to Hackage for GHC 9 support? HOT 6
- Allow ghc-prim == 0.10.0 HOT 1
- Cannot build with GHC 7.10.1 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ekg-core.