Comments (5)
Ha, funny you should mention this. I was just thinking about how to add some sort of MetricFormatter
trait + impl to StatsdClient
for #41 and it seemed a little ugly to have to start passing another generic param around.
Getting rid of the generic param and wrapping the sink in Arc
(as well as making the client Clone
) makes sense to me. Since this is a breaking change it would probably end up in 0.10.0 or later.
from cadence.
The only problem I see with wrapping the sink in an Arc<MetricSink + Sync + Send>
is that the AsyncMetricSink
, which uses a thread pool, is not Sync
. Since it uses a std::sync::mpsc::Sender
instance, it relies on being .cloned()
between threads.
So, AsyncMetricSink
is not compatible with using an Arc<MetricSink + Sync + Send>
in the client struct. But, I've been wanting to get rid of AsyncMetricSink
anyway.
So my plan is to deprecate AsyncMetricSink
(per #34) and release version 0.10.0. After that I'll remove it and make this change in version 0.11.0.
from cadence.
Yay, excellent!
from cadence.
Hey @robinst,
I submitted a PR to remove the generic param from the client (#52) if you like to check it out. The biggest change was adding some docs to the client on the ways that it could be shared between threads, based on the use cases you've described here. Let me know what you think. Thanks!
from cadence.
Looks good! Just had a single comment. Like the docs as well, very nice.
from cadence.
Related Issues (20)
- Bump minimum Rust version due to Criterion deps
- Add f64 constructors to histograms and distributions
- Add tests for multiple types for each metric in cadence-macros
- Update all examples to have multiple types for each metric
- Datadog Event stream support HOT 1
- Create example of using conversion traits with custom type
- Add tags to all metrics HOT 5
- Instrumented allocator to verify heap allocations
- Remove client uses of Arc
- Remove MetricError description implementation
- Define parts of the API covered by semver
- Edition 2021 update
- Support being able to sample metrics HOT 3
- Add support for incrementing and decrementing a gauge HOT 2
- Distribution missing tags from StatsdClientBuilder HOT 3
- Support for metrics aggregation HOT 3
- Option to observe write errors HOT 4
- Expose network-level telemetry HOT 4
- Support for UDS + SOCK_STREAM ? HOT 3
- macro variants that do not panic if global default client is not set 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 cadence.