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

Function frame_kind_color

src/ui/util.rs:84–110  ·  view source on GitHub ↗

Suggest a color for the given frame kind.

(kind: FrameKind)

Source from the content-addressed store, hash-verified

82
83/// Suggest a color for the given frame kind.
84pub fn frame_kind_color(kind: FrameKind) -> Color32 {
85 let interp = match kind {
86 FrameKind::Regular(x) => x,
87 FrameKind::Error(_) => return Color32::from_rgb(0xfd, 0x84, 0x84),
88 FrameKind::Abort => return Color32::from_rgb(0xfc, 0x4f, 0x4f),
89
90 // Intentionally horrible color to make it obvious that something is wrong:
91 FrameKind::Unknown(_) | FrameKind::UnknownError(_) => return Color32::RED,
92 };
93
94 match interp {
95 InterpKind::Python => Color32::from_rgb(0xfc, 0xae, 0x6b),
96 InterpKind::Php => Color32::from_rgb(0xfc, 0xdb, 0x82),
97 InterpKind::Native => Color32::from_rgb(0x6d, 0xd0, 0xdc),
98 InterpKind::Kernel => Color32::from_rgb(0x7c, 0x9e, 0xff),
99 InterpKind::Jvm => Color32::from_rgb(0x65, 0xd3, 0xac),
100 InterpKind::Ruby => Color32::from_rgb(0xd7, 0x9f, 0xfc),
101 InterpKind::Perl => Color32::from_rgb(0xf9, 0x8b, 0xb9),
102 InterpKind::Js => Color32::from_rgb(0xcb, 0xc3, 0xe3),
103 InterpKind::PhpJit => Color32::from_rgb(0xcc, 0xfc, 0x82),
104 InterpKind::Beam => Color32::from_rgb(0xda, 0x70, 0xd6),
105 InterpKind::Go => Color32::from_rgb(0x00, 0xad, 0xd8),
106
107 // TODO: sync color with Kibana once one is assigned
108 InterpKind::DotNet => Color32::from_rgb(0x6c, 0x60, 0xe1),
109 }
110}
111
112/// Format a count to a nice representation optimized for human readability.
113pub fn humanize_count(x: u64) -> HumanCount {

Callers 2

insert_traceMethod · 0.85
draw_frame_type_squareFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected