feat(capabilities): trait architecture http draft#1555
feat(capabilities): trait architecture http draft#1555Aaalibaba42 wants to merge 15 commits intomainfrom
Conversation
📚 Documentation Check Results✅ No documentation warnings found! 📦
|
Clippy Allow Annotation ReportComparing clippy allow annotations between branches:
Summary by Rule
Annotation Counts by File
Annotation Stats by Crate
About This ReportThis report tracks Clippy allow annotations for specific rules, showing how they've changed in this PR. Decreasing the number of these annotations generally improves code quality. |
🔒 Cargo Deny Results✅ No issues found! 📦
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1555 +/- ##
==========================================
- Coverage 70.91% 70.74% -0.18%
==========================================
Files 423 425 +2
Lines 61780 61875 +95
==========================================
- Hits 43810 43772 -38
- Misses 17970 18103 +133
🚀 New features to boost your workflow:
|
91daca7 to
b727c1c
Compare
Artifact Size Benchmark Reportaarch64-alpine-linux-musl
aarch64-unknown-linux-gnu
libdatadog-x64-windows
libdatadog-x86-windows
x86_64-alpine-linux-musl
x86_64-unknown-linux-gnu
|
b727c1c to
624bdac
Compare
a7a3941 to
3941878
Compare
|
✅ Tests 🎉 All green!❄️ No new flaky tests detected 🔗 Commit SHA: 892ff60 | Docs | Datadog PR Page | Was this helpful? Give us feedback! |
libdd-capabilities/src/http.rs
Outdated
| pub enum HttpRequest { | ||
| Get(RequestHead), | ||
| Head(RequestHead), | ||
| Delete(RequestHead), | ||
| Options(RequestHead), | ||
| Post(RequestWithBody), | ||
| Put(RequestWithBody), | ||
| Patch(RequestWithBody), | ||
| } |
There was a problem hiding this comment.
This doesn't really make sense to me
You'd remove a lot of enum dispatch code by doing this instead.
struct HttpRequest {
method: Method,
// check that the Method accepts a Body when we set it
body: Option<Body>,
// ....rest of the request
}
Of course it doesn't encode the invariant the Get doesn't have a body, but I don't think that's really necessary...
There was a problem hiding this comment.
I aired to the side of encoding invariants within the type system, but I agree it might be overkill on this occasion. I'll change that.
… for httpresponse
dd6ca9d to
853e0db
Compare
c0843b5 to
280cf5d
Compare
BenchmarksComparisonBenchmark execution time: 2026-02-19 18:38:36 Comparing candidate commit 892ff60 in PR branch Found 8 performance improvements and 11 performance regressions! Performance is the same for 38 metrics, 2 unstable metrics. scenario:credit_card/is_card_number/x371413321323331
scenario:credit_card/is_card_number_no_luhn/x371413321323331
scenario:normalization/normalize_name/normalize_name/Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Lo...
scenario:normalization/normalize_name/normalize_name/bad-name
scenario:normalization/normalize_name/normalize_name/good
scenario:normalization/normalize_service/normalize_service/A0000000000000000000000000000000000000000000000000...
scenario:normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters
scenario:normalization/normalize_service/normalize_service/[empty string]
scenario:profile_add_sample2_frames_x1000
scenario:profile_add_sample_frames_x1000
scenario:sdk_test_data/rules-based
CandidateCandidate benchmark detailsGroup 1
Group 2
Group 3
Group 4
Group 5
Group 6
Group 7
Group 8
Group 9
Group 10
Group 11
Group 12
Group 13
Group 14
Group 15
Group 16
Group 17
Group 18
Group 19
BaselineOmitted due to size. |
…pat without complicating wasm effort, and improvements that ensued therein
What does this PR do?
Add capability trait architecture, and few native implementations.
Motivation
Ongoing effort to make libdatadog wasm compatible.
Additional Notes
In the long run, several other parts of the codebase ought to use these capabilities via the provided public structure, so that it can automagically choose the correct underlying implementation when compiling or not to wasm.
How to test the change?
I should add some tests...