MCPcopy Create free account
hub / github.com/elastic/devfiler / update

Method update

src/ui/tabs/flamegraph.rs:59–129  ·  view source on GitHub ↗
(
        &mut self,
        ui: &mut Ui,
        cfg: &DevfilerConfig,
        kind: SampleKind,
        start: UtcTimestamp,
        end: UtcTimestamp,
    )

Source from the content-addressed store, hash-verified

57 }
58
59 fn update(
60 &mut self,
61 ui: &mut Ui,
62 cfg: &DevfilerConfig,
63 kind: SampleKind,
64 start: UtcTimestamp,
65 end: UtcTimestamp,
66 ) -> Option<TabAction> {
67 let show_inline = self.show_inline;
68 let root = self
69 .cached_root
70 .get_or_create((start, end, show_inline), move || {
71 build_flame_graph(kind, start, end, show_inline)
72 });
73
74 ui.add_space(5.0);
75 ui.columns(2, |ui| {
76 ui[0].with_layout(Layout::left_to_right(Align::Min), |ui| {
77 ui.checkbox(&mut self.show_inline, "Show inline");
78
79 // Show sandwich view indicator
80 if self.widget.sandwich_view.is_some() {
81 ui.label(
82 egui::RichText::new(" 🔍 Sandwich View Active (Double-click to exit)")
83 .color(Color32::YELLOW),
84 );
85 } else {
86 ui.label(
87 egui::RichText::new(" Ctrl+Click on a frame to show callers/callees")
88 .color(Color32::DARK_GRAY)
89 .italics(),
90 );
91 }
92 });
93 ui[1].with_layout(Layout::right_to_left(Align::Min), |ui| {
94 let hint = format!("{} Filter ...", icons::FUNNEL);
95 let prev_filter = self.widget.filter.clone();
96
97 let status_text = if self.widget.filter.len() >= 3 {
98 if self.widget.match_count > 0 {
99 let current = self.widget.current_match_index + 1;
100 Some((
101 format!("{}/{}", current, self.widget.match_count),
102 Color32::from_rgb(100, 200, 100),
103 ))
104 } else {
105 Some(("No matches".to_string(), Color32::from_rgb(200, 100, 100)))
106 }
107 } else {
108 None
109 };
110
111 clearable_line_edit_with_status(
112 ui,
113 &hint,
114 &mut self.widget.filter,
115 status_text
116 .as_ref()

Callers

nothing calls this directly

Calls 4

build_flame_graphFunction · 0.85
get_or_createMethod · 0.80
drawMethod · 0.80

Tested by

no test coverage detected