Skip to content

Commit

Permalink
comment
Browse files Browse the repository at this point in the history
  • Loading branch information
javierhonduco committed Jul 21, 2024
1 parent 84f1f7d commit 081e3d4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion proto/src/profile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ pub mod pprof {
}

use anyhow::{anyhow, Result};
use pprof::Label;
use std::collections::hash_map::Entry;
use std::collections::HashMap;

Expand Down Expand Up @@ -288,6 +289,11 @@ impl Pprof {
unit: self.get_or_insert_string("nanoseconds"),
};

// Used to identify that the profile was generated by lightswitch.
// This matters because the mapping ID is used in a non-standard way
// which should not be interpreted like this by other profiles.
let comments = vec![self.get_or_insert_string("lightswitch")];

pprof::Profile {
sample_type: vec![sample_type, period_type.clone()],
sample: self.samples,
Expand All @@ -301,7 +307,7 @@ impl Pprof {
duration_nanos: 0,
period_type: Some(period_type),
period: 1_000_000_000 / self.freq_in_hz,
comment: vec![],
comment: comments,
default_sample_type: 0,
}
}
Expand Down

0 comments on commit 081e3d4

Please sign in to comment.