Skip to content

Merge all profiling-related crates into a single datadog-profiling crate#35

Merged
ivoanjo merged 8 commits into
mainfrom
ivoanjo/refactor-crates
Aug 9, 2022
Merged

Merge all profiling-related crates into a single datadog-profiling crate#35
ivoanjo merged 8 commits into
mainfrom
ivoanjo/refactor-crates

Conversation

@ivoanjo

@ivoanjo ivoanjo commented Aug 9, 2022

Copy link
Copy Markdown
Member

What does this PR do?

This PR takes the previously-existing profiling-related crates:

  • ddprof
  • ddprof-exporter
  • ddprof-profiles

and folds them into a single datadog-profiling crate.

Note that I did not touch the ddprof-ffi crate yet. To be decided what do do with it.

Motivation

This follows from our discussions on reducing the number of crates during PRs and the weekly meeting.

Additional Notes

I kept the existing namespacing, in a way:

  • ddprof-exporter -> datadog_profiling::exporter
  • ddprof-profiles -> datadog_profiling::profile

Also, this PR will be really hard to rebase and whatnot, so I suggest any extra adjustments be made as a separate, follow-up PR, rather than letting this live for a long time. (I'll still be up to doing any changes, definitely not saying this to avoid doing any further work)

I also went ahead and reserved the datadog-profiling name on crates.io => https://crates.io/crates/datadog-profiling .

How to test the change?

  • cargo test
  • run test applications

@ivoanjo ivoanjo requested review from a team as code owners August 9, 2022 10:56

@pawelchcki pawelchcki left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Comment thread ddprof-ffi/cbindgen.toml
[parse]
parse_deps = true
include = ["ddcommon", "ddcommon-ffi", "ddprof-exporter", "ddprof-profiles", "ux"]
include = ["ddcommon", "ddcommon-ffi", "datadog-profiling", "ux"]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this makes sense.

@r1viollet r1viollet left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment thread profiling/build.rs
Comment on lines +18 to +21
let protos = &[concat!(
env!("CARGO_MANIFEST_DIR"),
"/src/profile/profile.proto"
)];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm curious: did cargo fmt split these into multiple lines? Doesn't affect PR at all, just curious.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it did. I don't particularly like some of its decisions but... ahaha not going to fight that fight xD

@morrisonlevi morrisonlevi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, but I should probably compile the Rust version of the PHP profiler against it to be sure. I'll do that sometime today. Thanks, Ivo!

@morrisonlevi

Copy link
Copy Markdown
Contributor

Why ddprof-profiles -> datadog_profiling::profile instead of datadog_profiling::profiles? Not asking you to change it, just trying to understand why it wasn't kept in the plural.

@ivoanjo

ivoanjo commented Aug 9, 2022

Copy link
Copy Markdown
Member Author

Why ddprof-profiles -> datadog_profiling::profile instead of datadog_profiling::profiles? Not asking you to change it, just trying to understand why it wasn't kept in the plural.

Good question. I felt it was a bit more in-line with the rest of the names:

  • we have "exporter", not "exporters"
  • we may at some point have "ffi", not "ffis"
  • it seems a bit more natural to talk about profile::Mapping than profiles::Mapping

...but if you feel strongly against it, happy to change -- I did choose between both explicitly, and I do prefer singular, but I'm willing to compromise with profiles :)

@ivoanjo ivoanjo merged commit 86f44d8 into main Aug 9, 2022
@ivoanjo ivoanjo deleted the ivoanjo/refactor-crates branch August 9, 2022 16:25
@ivoanjo

ivoanjo commented Aug 9, 2022

Copy link
Copy Markdown
Member Author

Thanks everyone for the quick turnaround :)

ivoanjo pushed a commit that referenced this pull request Jun 18, 2025
…PIs, and adjust Slices (#34)

* Fix clippy lints and expose dependencies of API

hyper::Uri and chrono::{DateTime, Utc} are used in the public Rust API,
so we need to `pub use` them so consumers can use these types and for
them to be compatible.

* Update for Rust 1.56

* Downgrade ux to 0.1.3 to avoid const new

0.1.4 uses const new, which requires Rust 1.57+

* Fix 3rdparty license paths and clippy lint

* Fix license file

* Remove unused Exporter APIs and adjust Slices (#35)

* Remove unused Exporter APIs and adjust Slices

CharSlice -> intended to be valid utf-8 string.
ByteSlice -> not intended to be valid utf-8 string (like binary data).

* Fix quoting for CMake

* Fix exporter example, address CR
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

Successfully merging this pull request may close these issues.

4 participants