MCPcopy Create free account
hub / github.com/CodSpeedHQ/codspeed / get_group_event

Function get_group_event

src/logger.rs:67–87  ·  view source on GitHub ↗

Returns the group event if the record is a group event, otherwise returns `None`.

(record: &log::Record)

Source from the content-addressed store, hash-verified

65
66/// Returns the group event if the record is a group event, otherwise returns `None`.
67pub(super) fn get_group_event(record: &log::Record) -> Option<GroupEvent> {
68 match record.target() {
69 OPENED_GROUP_TARGET => {
70 let args = record.args().to_string();
71 if args.is_empty() {
72 None
73 } else {
74 Some(GroupEvent::StartOpened(args))
75 }
76 }
77 GROUP_TARGET => {
78 let args = record.args().to_string();
79 if args.is_empty() {
80 Some(GroupEvent::End)
81 } else {
82 Some(GroupEvent::Start(args))
83 }
84 }
85 _ => None,
86 }
87}
88
89pub(super) fn get_announcement_event(record: &log::Record) -> Option<String> {
90 if record.target() != ANNOUNCEMENT_TARGET {

Callers 4

logMethod · 0.85
logMethod · 0.85
logMethod · 0.85
logMethod · 0.85

Calls 2

argsMethod · 0.80
is_emptyMethod · 0.45

Tested by

no test coverage detected