Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
727 changes: 340 additions & 387 deletions Cargo.lock

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ anyhow = "1.0.71"
smallvec = "1.11.1"
arc-swap = "1.6.0"
base64 = "0.22.0"
egui = "0.26.1"
egui_plot = "0.26.1"
egui_extras = { version = "0.26.1", features = ["image"] }
egui_commonmark = "0.12.0"
egui-phosphor = "0.4.0"
egui = "0.29.1"
egui_plot = "0.29.0"
egui_extras = { version = "0.29.1", features = ["image"] }
egui_commonmark = "0.18.0"
egui-phosphor = "0.7.3"
fallible-iterator = "0.3.0"
chrono = "0.4.31"
indexmap = "2.1.0"
Expand Down Expand Up @@ -74,7 +74,7 @@ default-features = false
features = ["zstd", "jemalloc"]

[dependencies.eframe]
version = "0.26.1"
version = "0.29.1"
default-features = false
features = ["default_fonts", "x11"]

Expand Down
4 changes: 2 additions & 2 deletions src/ui/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,15 +150,15 @@ impl DevfilerUi {
static ADD_DATA_MD: &str = include_str!("./add-data.md");

egui::ScrollArea::vertical().show(ui, |ui| {
CommonMarkViewer::new("add-data-viewer").show(ui, &mut self.md_cache, ADD_DATA_MD);
CommonMarkViewer::new().show(ui, &mut self.md_cache, ADD_DATA_MD);
});
}

fn samples_widget(&mut self, ui: &mut Ui) -> (UtcTimestamp, UtcTimestamp) {
let plot = Plot::new("trace_counts")
.custom_x_axes(vec![timeaxis::mk_time_axis(Axis::X)])
.custom_y_axes(vec![AxisHints::new_y().label("Samples")])
.y_axis_width(2)
.y_axis_min_width(2.0)
.x_grid_spacer(timeaxis::mk_time_grid)
.allow_drag([true, false])
.height(100.0)
Expand Down
2 changes: 1 addition & 1 deletion src/ui/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ pub fn gui_thread(collector: crate::collector::Collector) -> Result<(), eframe::
egui_extras::install_image_loaders(&cc.egui_ctx);
load_phosphor_icons(&cc.egui_ctx);
tokio::spawn(background_ui_waker(cc.egui_ctx.clone()));
Box::new(app::DevfilerUi::new(collector))
Ok(Box::new(app::DevfilerUi::new(collector)))
}),
)
}
Expand Down
67 changes: 51 additions & 16 deletions src/ui/tabs/executables.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,19 +108,48 @@ impl ExecutablesTab {

ui.separator();
let bar_size = Vec2::new(ui.available_width(), 20.0);
let bar_rect = Rect::from_min_size(ui.next_widget_position(), bar_size);
ui.allocate_ui_at_rect(bar_rect, |ui| {
ui.columns(3, |ui| {
ui[0].with_layout(Layout::left_to_right(Align::Center), |ui| {
ui.label(format!("{} executables", self.last_exe_count));
});
ui[1].with_layout(Layout::centered_and_justified(Direction::TopDown), |ui| {
ui.label(ingest_status);
});
ui[2].with_layout(Layout::right_to_left(Align::Center), |ui| {
let hint = format!("{} Filter ...", icons::FUNNEL);
clearable_line_edit(ui, &hint, &mut self.filter);
});

// Allocate space for the entire bar
let (_rect, _) = ui.allocate_space(bar_size);

// Create the horizontal layout directly inside the main UI
ui.horizontal(|ui| {
// Set the width of each column
let available_width = ui.available_width();
let col_width = available_width / 3.0;

// First column - left aligned
ui.with_layout(Layout::left_to_right(Align::Center), |ui| {
ui.allocate_ui_with_layout(
Vec2::new(col_width, bar_size.y),
Layout::left_to_right(Align::Center),
|ui| {
ui.label(format!("{} executables", self.last_exe_count));
},
);
});

// Second column - centered
ui.with_layout(Layout::centered_and_justified(Direction::TopDown), |ui| {
ui.allocate_ui_with_layout(
Vec2::new(col_width, bar_size.y),
Layout::centered_and_justified(Direction::TopDown),
|ui| {
ui.label(ingest_status);
},
);
});

// Third column - right aligned
ui.with_layout(Layout::right_to_left(Align::Center), |ui| {
ui.allocate_ui_with_layout(
Vec2::new(col_width, bar_size.y),
Layout::right_to_left(Align::Center),
|ui| {
let hint = format!("{} Filter ...", icons::FUNNEL);
clearable_line_edit(ui, &hint, &mut self.filter);
},
);
});
});

Expand Down Expand Up @@ -169,9 +198,15 @@ impl ExecutablesTab {
painter.rect_stroke(rect, Rounding::ZERO, Stroke::new(1.0, Color32::BLACK));

if matches!(response.hover_pos(), Some(p) if rect.contains(p)) {
show_tooltip_at_pointer(ui.ctx(), Id::new("executable-bar-tooltip"), |ui| {
ui.label(format!("{}: {:.0}", name, humanize_count(value)));
});
let tooltip_id = Id::new("executable-bar-tooltip");
show_tooltip_at_pointer(
ui.ctx(),
egui::LayerId::new(egui::Order::Tooltip, tooltip_id),
tooltip_id,
|ui: &mut Ui| {
ui.label(format!("{}: {:.0}", name, humanize_count(value)));
},
);
}

offset += width;
Expand Down
9 changes: 7 additions & 2 deletions src/ui/tabs/flamegraph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,12 @@ impl FlameGraphWidget {
if let Some(hover_pos) = cursor_hover_pos {
if screen_rect.contains(hover_pos) {
let id = Id::new("flamegraph-tooltip");
show_tooltip_at_pointer(ctx, id, |ui| self.draw_tooltip(ui, cfg, root, flame));
show_tooltip_at_pointer(
ctx,
egui::LayerId::new(egui::Order::Tooltip, id),
id,
|ui: &mut Ui| self.draw_tooltip(ui, cfg, root, flame),
);

if clicked && flame.weight >= 1 {
self.x_zoom = root.weight as f32 / flame.weight as f32;
Expand Down Expand Up @@ -315,7 +320,7 @@ impl FlameGraphWidget {
});
ui.horizontal(|ui| {
ui.strong("Location:");
ui.add(Label::new(&flame.text).wrap(true));
ui.add(Label::new(&flame.text).wrap());
});
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/ui/tabs/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ impl TabWidget for MetricsTab {
Plot::new("metrics")
.custom_x_axes(vec![timeaxis::mk_time_axis(Axis::X)])
.custom_y_axes(vec![AxisHints::new_y().label("Value")])
.y_axis_width(5)
.y_axis_min_width(5.0)
.x_grid_spacer(timeaxis::mk_time_grid)
.legend(Legend::default())
.label_formatter(|name, val| {
Expand Down
4 changes: 2 additions & 2 deletions src/ui/timeaxis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ pub fn mk_time_grid(input: GridInput) -> Vec<GridMark> {
marks
}

pub fn mk_time_axis(axis: Axis) -> AxisHints {
AxisHints::new(axis).formatter(|x, _, _| {
pub fn mk_time_axis(axis: Axis) -> AxisHints<'static> {
AxisHints::new(axis).formatter(|x, _| {
let t = ts2chrono(x.value as i64);

let has_seconds = t.second() != 0;
Expand Down