Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(profiling): Add platform field to profile frames #2629

Merged
merged 4 commits into from
Oct 19, 2023
Merged
Changes from 3 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
49 changes: 8 additions & 41 deletions relay-profiling/src/sample.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use crate::MAX_PROFILE_DURATION;

const MAX_PROFILE_DURATION_NS: u64 = MAX_PROFILE_DURATION.as_nanos() as u64;

#[derive(Debug, Serialize, Deserialize, Clone)]
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
krystofwoldrich marked this conversation as resolved.
Show resolved Hide resolved
struct Frame {
#[serde(skip_serializing_if = "Option::is_none")]
abs_path: Option<String>,
Expand All @@ -32,6 +32,8 @@ struct Frame {
lineno: Option<u32>,
#[serde(skip_serializing_if = "Option::is_none")]
module: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
platform: Option<String>,
}

impl Frame {
Expand Down Expand Up @@ -535,14 +537,7 @@ mod tests {
let mut profile = generate_profile();

profile.profile.frames.push(Frame {
abs_path: Some("".to_string()),
colno: Some(0),
filename: Some("".to_string()),
function: Some("".to_string()),
in_app: Some(false),
instruction_addr: Some(Addr(0)),
lineno: Some(0),
module: Some("".to_string()),
..Default::default()
});
profile.metadata.transaction = Some(TransactionMetadata {
active_thread_id: 1,
Expand Down Expand Up @@ -593,14 +588,7 @@ mod tests {
let mut profile = generate_profile();

profile.profile.frames.push(Frame {
abs_path: Some("".to_string()),
colno: Some(0),
filename: Some("".to_string()),
function: Some("".to_string()),
in_app: Some(false),
instruction_addr: Some(Addr(0)),
lineno: Some(0),
module: Some("".to_string()),
..Default::default()
});
profile.metadata.transaction = Some(TransactionMetadata {
active_thread_id: 1,
Expand Down Expand Up @@ -662,14 +650,7 @@ mod tests {

profile.metadata.transactions.push(transaction.clone());
profile.profile.frames.push(Frame {
abs_path: Some("".to_string()),
colno: Some(0),
filename: Some("".to_string()),
function: Some("".to_string()),
in_app: Some(false),
instruction_addr: Some(Addr(0)),
lineno: Some(0),
module: Some("".to_string()),
..Default::default()
});
profile.profile.stacks.push(vec![0]);
profile.profile.samples.extend(vec![
Expand Down Expand Up @@ -729,14 +710,7 @@ mod tests {

profile.metadata.transaction = Some(transaction);
profile.profile.frames.push(Frame {
abs_path: Some("".to_string()),
colno: Some(0),
filename: Some("".to_string()),
function: Some("".to_string()),
in_app: Some(false),
instruction_addr: Some(Addr(0)),
lineno: Some(0),
module: Some("".to_string()),
..Default::default()
});
profile.profile.stacks = vec![vec![0], vec![]];
profile.profile.samples = vec![
Expand Down Expand Up @@ -849,14 +823,7 @@ mod tests {

profile.metadata.transaction = Some(transaction);
profile.profile.frames.push(Frame {
abs_path: Some("".to_string()),
colno: Some(0),
filename: Some("".to_string()),
function: Some("".to_string()),
in_app: Some(false),
instruction_addr: Some(Addr(0)),
lineno: Some(0),
module: Some("".to_string()),
..Default::default()
});
profile.profile.stacks = vec![vec![0]];

Expand Down
Loading