Skip to content

Commit

Permalink
Add "rerun_example_" prefix to all our user-visible app-ids (#3112)
Browse files Browse the repository at this point in the history
### What
* Closes #2967

The exact prefix is not super important. Once there, we can
search-replace easily.

I also added the `app_id_starts_with_rerun_example` analytics signal for
this (needed since we hash the app id).
The old `is_official_example` is still there (its not implemented for
C++ though).

Review commit-by-commit

### Checklist
* [x] I have read and agree to [Contributor
Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and
the [Code of
Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md)
* [x] I've included a screenshot or gif (if applicable)
* [x] I have tested [demo.rerun.io](https://demo.rerun.io/pr/3112) (if
applicable)

- [PR Build Summary](https://build.rerun.io/pr/3112)
- [Docs
preview](https://rerun.io/preview/fd985a5a2b561385c581bdf66e8bb1d4fe684ccb/docs)
<!--DOCS-PREVIEW-->
- [Examples
preview](https://rerun.io/preview/fd985a5a2b561385c581bdf66e8bb1d4fe684ccb/examples)
<!--EXAMPLES-PREVIEW--><!--EXAMPLES-PREVIEW--><!--EXAMPLES-PREVIEW--><!--EXAMPLES-PREVIEW--><!--EXAMPLES-PREVIEW--><!--EXAMPLES-PREVIEW-->
- [Recent benchmark results](https://ref.rerun.io/dev/bench/)
- [Wasm size tracking](https://ref.rerun.io/dev/sizes/)
  • Loading branch information
emilk authored Aug 29, 2023
1 parent 29043cd commit b55e818
Show file tree
Hide file tree
Showing 196 changed files with 299 additions and 245 deletions.
2 changes: 1 addition & 1 deletion ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ The logging data can be written to disk as `.rrd` files, or transmitted over TCP
The Rerun Viewer is where log data is visualized. It is usually run as a native app, but can also be compiled to WebAssembly (Wasm) and run in a browser.

#### Native viewer
The easiest way to launch the viewer is directly from the logging API with `rr.init("my_app", spawn=True)`. However, the standalone viewer can also be run from the command line, for example to view an `.rrd` file: `rerun mydata.rrd`.
The easiest way to launch the viewer is directly from the logging API with `rr.init("rerun_example_app", spawn=True)`. However, the standalone viewer can also be run from the command line, for example to view an `.rrd` file: `rerun mydata.rrd`.

#### Web viewer
You can try running the viewer in a browser using `rr.serve()` in python, or using `rerun --web-viewer mydata.rrd`.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Use one of our logging APIs (Python or Rust) to log rich data, such as images an
```py
import rerun as rr

rr.init("my_app", spawn = True) # Spawn a Rerun Viewer and stream log events to it
rr.init("rerun_example_app", spawn = True) # Spawn a Rerun Viewer and stream log events to it

rr.log_image("rgb_image", image)
rr.log_points("points", positions)
Expand Down
21 changes: 12 additions & 9 deletions crates/re_sdk/src/global.rs
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,9 @@ mod tests {
assert!(RecordingStream::get(StoreKind::Blueprint, None).is_none());

// nothing is set -- explicit wins
let explicit = RecordingStreamBuilder::new("explicit").buffered().unwrap();
let explicit = RecordingStreamBuilder::new("rerun_example_explicit")
.buffered()
.unwrap();
check_store_id(
&explicit,
RecordingStream::get(StoreKind::Recording, explicit.clone().into()),
Expand All @@ -297,14 +299,14 @@ mod tests {
RecordingStream::get(StoreKind::Blueprint, explicit.clone().into()),
);

let global_data = RecordingStreamBuilder::new("global_data")
let global_data = RecordingStreamBuilder::new("rerun_example_global_data")
.buffered()
.unwrap();
assert!(
RecordingStream::set_global(StoreKind::Recording, Some(global_data.clone())).is_none()
);

let global_blueprint = RecordingStreamBuilder::new("global_blueprint")
let global_blueprint = RecordingStreamBuilder::new("rerun_example_global_blueprint")
.buffered()
.unwrap();
assert!(
Expand Down Expand Up @@ -347,7 +349,7 @@ mod tests {
RecordingStream::get(StoreKind::Blueprint, None),
);

let local_data = RecordingStreamBuilder::new("local_data")
let local_data = RecordingStreamBuilder::new("rerun_example_local_data")
.buffered()
.unwrap();
assert!(RecordingStream::set_thread_local(
Expand All @@ -356,9 +358,10 @@ mod tests {
)
.is_none());

let local_blueprint = RecordingStreamBuilder::new("local_blueprint")
.buffered()
.unwrap();
let local_blueprint =
RecordingStreamBuilder::new("rerun_example_local_blueprint")
.buffered()
.unwrap();
assert!(RecordingStream::set_thread_local(
StoreKind::Blueprint,
Some(local_blueprint.clone())
Expand Down Expand Up @@ -400,15 +403,15 @@ mod tests {
RecordingStream::get(StoreKind::Blueprint, None),
);

let local_data = RecordingStreamBuilder::new("local_data")
let local_data = RecordingStreamBuilder::new("rerun_example_local_data")
.buffered()
.unwrap();
assert!(
RecordingStream::set_thread_local(StoreKind::Recording, Some(local_data.clone()))
.is_none()
);

let local_blueprint = RecordingStreamBuilder::new("local_blueprint")
let local_blueprint = RecordingStreamBuilder::new("rerun_example_local_blueprint")
.buffered()
.unwrap();
assert!(RecordingStream::set_thread_local(
Expand Down
22 changes: 11 additions & 11 deletions crates/re_sdk/src/recording_stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ pub type RecordingStreamResult<T> = Result<T, RecordingStreamError>;
///
/// ``` no_run
/// # use re_sdk::RecordingStreamBuilder;
/// let rec_stream = RecordingStreamBuilder::new("my_app").save("my_recording.rrd")?;
/// let rec_stream = RecordingStreamBuilder::new("rerun_example_app").save("my_recording.rrd")?;
/// # Ok::<(), Box<dyn std::error::Error>>(())
/// ```
#[derive(Debug)]
Expand All @@ -75,7 +75,7 @@ impl RecordingStreamBuilder {
///
/// ```no_run
/// # use re_sdk::RecordingStreamBuilder;
/// let rec_stream = RecordingStreamBuilder::new("my_app").save("my_recording.rrd")?;
/// let rec_stream = RecordingStreamBuilder::new("rerun_example_app").save("my_recording.rrd")?;
/// # Ok::<(), Box<dyn std::error::Error>>(())
/// ```
//
Expand Down Expand Up @@ -165,7 +165,7 @@ impl RecordingStreamBuilder {
/// ## Example
///
/// ```
/// let rec_stream = re_sdk::RecordingStreamBuilder::new("my_app").buffered()?;
/// let rec_stream = re_sdk::RecordingStreamBuilder::new("rerun_example_app").buffered()?;
/// # Ok::<(), Box<dyn std::error::Error>>(())
/// ```
pub fn buffered(self) -> RecordingStreamResult<RecordingStream> {
Expand All @@ -190,7 +190,7 @@ impl RecordingStreamBuilder {
/// ```
/// # fn log_data(_: &re_sdk::RecordingStream) { }
///
/// let (rec_stream, storage) = re_sdk::RecordingStreamBuilder::new("my_app").memory()?;
/// let (rec_stream, storage) = re_sdk::RecordingStreamBuilder::new("rerun_example_app").memory()?;
///
/// log_data(&rec_stream);
///
Expand Down Expand Up @@ -226,7 +226,7 @@ impl RecordingStreamBuilder {
/// ## Example
///
/// ```no_run
/// let rec_stream = re_sdk::RecordingStreamBuilder::new("my_app")
/// let rec_stream = re_sdk::RecordingStreamBuilder::new("rerun_example_app")
/// .connect(re_sdk::default_server_addr(), re_sdk::default_flush_timeout())?;
/// # Ok::<(), Box<dyn std::error::Error>>(())
/// ```
Expand Down Expand Up @@ -254,7 +254,7 @@ impl RecordingStreamBuilder {
/// ## Example
///
/// ```no_run
/// let rec_stream = re_sdk::RecordingStreamBuilder::new("my_app").save("my_recording.rrd")?;
/// let rec_stream = re_sdk::RecordingStreamBuilder::new("rerun_example_app").save("my_recording.rrd")?;
/// # Ok::<(), Box<dyn std::error::Error>>(())
/// ```
#[cfg(not(target_arch = "wasm32"))]
Expand Down Expand Up @@ -300,7 +300,7 @@ impl RecordingStreamBuilder {
/// };
/// let _tokio_runtime_guard = tokio_runtime_handle.enter();
///
/// let rec_stream = re_sdk::RecordingStreamBuilder::new("my_app")
/// let rec_stream = re_sdk::RecordingStreamBuilder::new("rerun_example_app")
/// .serve("0.0.0.0", Default::default(), Default::default(), true)?;
/// # Ok::<(), Box<dyn std::error::Error>>(())
/// ```
Expand Down Expand Up @@ -1099,7 +1099,7 @@ mod tests {

#[test]
fn never_flush() {
let rec_stream = RecordingStreamBuilder::new("never_flush")
let rec_stream = RecordingStreamBuilder::new("rerun_example_never_flush")
.enabled(true)
.batcher_config(DataTableBatcherConfig::NEVER)
.buffered()
Expand Down Expand Up @@ -1164,7 +1164,7 @@ mod tests {

#[test]
fn always_flush() {
let rec_stream = RecordingStreamBuilder::new("always_flush")
let rec_stream = RecordingStreamBuilder::new("rerun_example_always_flush")
.enabled(true)
.batcher_config(DataTableBatcherConfig::ALWAYS)
.buffered()
Expand Down Expand Up @@ -1244,7 +1244,7 @@ mod tests {

#[test]
fn flush_hierarchy() {
let (rec_stream, storage) = RecordingStreamBuilder::new("flush_hierarchy")
let (rec_stream, storage) = RecordingStreamBuilder::new("rerun_example_flush_hierarchy")
.enabled(true)
.batcher_config(DataTableBatcherConfig::NEVER)
.memory()
Expand Down Expand Up @@ -1300,7 +1300,7 @@ mod tests {

#[test]
fn disabled() {
let (rec_stream, storage) = RecordingStreamBuilder::new("disabled")
let (rec_stream, storage) = RecordingStreamBuilder::new("rerun_example_disabled")
.enabled(false)
.batcher_config(DataTableBatcherConfig::ALWAYS)
.memory()
Expand Down
2 changes: 1 addition & 1 deletion crates/re_types/source_hash.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion crates/re_types/src/archetypes/annotation_context.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/re_types/src/archetypes/arrows3d.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion crates/re_types/src/archetypes/disconnected_space.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions crates/re_types/src/archetypes/line_strips2d.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions crates/re_types/src/archetypes/line_strips3d.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/re_types/src/archetypes/points2d.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion crates/re_types/src/archetypes/points3d.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion crates/re_types/src/archetypes/transform3d.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/re_ui/examples/re_ui_example.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ fn main() -> eframe::Result<()> {
re_log::setup_native_logging();

let native_options = eframe::NativeOptions {
app_id: Some("re_ui_example".to_owned()),
app_id: Some("rerun_example_re_ui_example".to_owned()),

initial_window_size: Some([1200.0, 800.0].into()),
follow_system_theme: false,
Expand Down
2 changes: 1 addition & 1 deletion crates/re_viewer/src/native.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub fn run_native_app(app_creator: AppCreator) -> eframe::Result<()> {
pub fn eframe_options() -> eframe::NativeOptions {
eframe::NativeOptions {
// Controls where on disk the app state is persisted.
app_id: Some("rerun".to_owned()),
app_id: Some("rerun_example_rerun".to_owned()),

initial_window_size: Some([1600.0, 1200.0].into()),
min_window_size: Some([320.0, 450.0].into()), // Should be high enough to fit the rerun menu
Expand Down
7 changes: 7 additions & 0 deletions crates/re_viewer/src/viewer_analytics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,13 @@ impl ViewerAnalytics {

self.register("store_source", store_source);
self.register("is_official_example", store_info.is_official_example);
self.register(
"app_id_starts_with_rerun_example",
store_info
.application_id
.as_str()
.starts_with("rerun_example"),
);
}

if let Some(data_source) = &store_db.data_source {
Expand Down
6 changes: 3 additions & 3 deletions crates/rerun/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
//! # fn capture_image() -> image::DynamicImage { Default::default() }
//! # fn positions() -> Vec<rerun::components::Point3D> { Default::default() }
//! # fn colors() -> Vec<rerun::components::Color> { Default::default() }
//! let rec_stream = rerun::RecordingStreamBuilder::new("my_app").buffered()?;
//! let rec_stream = rerun::RecordingStreamBuilder::new("rerun_example_app").buffered()?;
//!
//! let points: Vec<rerun::components::Point3D> = positions();
//! let colors: Vec<rerun::components::Color> = colors();
Expand All @@ -61,7 +61,7 @@
//! Then do this:
//!
//! ```no_run
//! let rec_stream = rerun::RecordingStreamBuilder::new("my_app")
//! let rec_stream = rerun::RecordingStreamBuilder::new("rerun_example_app")
//! .connect(rerun::default_server_addr(), rerun::default_flush_timeout());
//! ```
//!
Expand All @@ -70,7 +70,7 @@
//! ```no_run
//! # fn log_using(rec_stream: &rerun::RecordingStream) {}
//!
//! let (rec_stream, storage) = rerun::RecordingStreamBuilder::new("my_app").memory()?;
//! let (rec_stream, storage) = rerun::RecordingStreamBuilder::new("rerun_example_app").memory()?;
//! log_using(&rec_stream);
//! rerun::native_viewer::show(storage.take());
//!
Expand Down
2 changes: 1 addition & 1 deletion docs/code-examples/annotation_context_arrows_v2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace rr = rerun;

int main() {
auto rr_stream = rr::RecordingStream("annotation_context_rects");
auto rr_stream = rr::RecordingStream("rerun_example_annotation_context_rects");
rr_stream.connect("127.0.0.1:9876").throw_on_failure();

// Log an annotation context to assign a label and color to each class
Expand Down
2 changes: 1 addition & 1 deletion docs/code-examples/annotation_context_connections.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import rerun as rr

rr.init("annotation_context_connections", spawn=True)
rr.init("rerun_example_annotation_context_connections", spawn=True)

rr.log_annotation_context(
"/",
Expand Down
3 changes: 2 additions & 1 deletion docs/code-examples/annotation_context_connections.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ use rerun::datatypes::{AnnotationInfo, ClassDescription, Color, KeypointPair, La
use rerun::{MsgSender, RecordingStreamBuilder};

fn main() -> Result<(), Box<dyn std::error::Error>> {
let (rec_stream, storage) = RecordingStreamBuilder::new(env!("CARGO_BIN_NAME")).memory()?;
let (rec_stream, storage) =
RecordingStreamBuilder::new("rerun_example_annotation_context_connections").memory()?;

// Log an annotation context to assign a label and color to each class
// Create a class description with labels and color for each keypoint ID as well as some
Expand Down
2 changes: 1 addition & 1 deletion docs/code-examples/annotation_context_rects.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import rerun as rr

rr.init("annotation_context_rects", spawn=True)
rr.init("rerun_example_annotation_context_rects", spawn=True)

# Log an annotation context to assign a label and color to each class
rr.log_annotation_context(
Expand Down
3 changes: 2 additions & 1 deletion docs/code-examples/annotation_context_rects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ use rerun::{
};

fn main() -> Result<(), Box<dyn std::error::Error>> {
let (rec_stream, storage) = RecordingStreamBuilder::new(env!("CARGO_BIN_NAME")).memory()?;
let (rec_stream, storage) =
RecordingStreamBuilder::new("rerun_example_annotation_context_rects").memory()?;

// Log an annotation context to assign a label and color to each class
let annotation = AnnotationContext::new([
Expand Down
Loading

0 comments on commit b55e818

Please sign in to comment.