Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a crate for the nice control API #542

Merged
merged 2 commits into from Dec 5, 2019
Merged

Add a crate for the nice control API #542

merged 2 commits into from Dec 5, 2019

Conversation

badboy
Copy link
Member

@badboy badboy commented Dec 4, 2019

For now this only supports a minimal interface on top of Glean

let cfg = Configuration {
    data_path,
    application_id: "org.mozilla.glean_core.example".into(),
    upload_enabled: true,
    max_events: None,
};
glean::initialize(cfg)?;
glean::register_ping_type(&PrototypePing);

if glean::send_ping_by_name("prototype") {
    log::info!("Successfully collected a prototype ping");
} else {
    log::info!("Prototype ping failed");
}

glean-core/preview/Cargo.toml Outdated Show resolved Hide resolved
glean-core/preview/Cargo.toml Outdated Show resolved Hide resolved
glean-core/preview/Cargo.toml Outdated Show resolved Hide resolved
glean-core/preview/Cargo.toml Outdated Show resolved Hide resolved
glean-core/preview/examples/prototype.rs Show resolved Hide resolved
@badboy badboy requested a review from Dexterp37 December 4, 2019 11:25
Copy link
Contributor

@Dexterp37 Dexterp37 left a comment

Choose a reason for hiding this comment

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

Does this need to change or do you want to update the script ?

@badboy
Copy link
Member Author

badboy commented Dec 4, 2019

Does this need to change or do you want to update the script ?

IMO this should not yet be part of the regular release cycle. It's preview after all and we might just scrape it by January
(also means we can iterate faster on the API part than we need to iterate on Glean-core)

@codecov-io
Copy link

codecov-io commented Dec 4, 2019

Codecov Report

Merging #542 into master will decrease coverage by 0.78%.
The diff coverage is 0%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #542      +/-   ##
============================================
- Coverage     75.61%   74.82%   -0.79%     
+ Complexity      334      333       -1     
============================================
  Files            98      100       +2     
  Lines          5736     5795      +59     
  Branches        715      718       +3     
============================================
- Hits           4337     4336       -1     
- Misses          879      939      +60     
  Partials        520      520
Impacted Files Coverage Δ Complexity Δ
glean-core/preview/src/lib.rs 0% <0%> (ø) 0 <0> (?)
glean-core/preview/src/metrics/ping.rs 0% <0%> (ø) 0 <0> (?)
...ozilla/telemetry/glean/debug/GleanDebugActivity.kt 75% <0%> (-0.76%) 6% <0%> (-1%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4915dbc...f2e420a. Read the comment docs.

Copy link
Contributor

@chutten chutten left a comment

Choose a reason for hiding this comment

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

Let's see if I understand this properly: it currently depends on and builds on the existing glean-ffi (with its handle) because I've been unreasonably impatient about getting an API in place before those refactors can manifest? : D

Looks good, I found a few instances of leftovers but nothing blocking.

glean-core/preview/src/lib.rs Outdated Show resolved Hide resolved
glean-core/preview/src/metrics/ping.rs Outdated Show resolved Hide resolved
glean-core/preview/src/metrics/ping.rs Outdated Show resolved Hide resolved
For now this only supports a minimal interface on top of Glean
Because we now expose some re-exported structs, the links might not be
correct.
I prefer to ignore that for now and fix it later (hopefully with
intra-docs links soon)
@badboy badboy merged commit 51dfd6d into master Dec 5, 2019
@badboy badboy deleted the preview-the-api branch December 5, 2019 10:16
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.

None yet

4 participants