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

Document dotnet magic denominator #255

Merged
merged 1 commit into from
Jun 22, 2021
Merged
Changes from all 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
13 changes: 12 additions & 1 deletion pkg/agent/dotnetspy/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,20 @@ func (s *session) start() error {
// The session is closed by us (on flush or stop call),
// or the target process has exited.
for k, v := range p.Samples() {
// dotnet profiler reports total time v per call stack k.
// Meanwhile, pyroscope agent expects number of samples is
// reported. Every sample is a time fraction of second
// according to sample rate: 1000ms/100 = 10ms by default.
// To represent reported time v as a number of samples,
// we divide it by sample duration.
//
// Taking into account that under the hood dotnet spy uses
// Microsoft-DotNETCore-SampleProfiler, which captures a
// snapshot of each thread's managed callstack every 10 ms,
// we cannot manage sample rate from outside.
s.ch <- line{
name: []byte(k),
val: int(v.Milliseconds()),
val: int(v.Milliseconds()) / 10,
}
}
}
Expand Down