File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -87,9 +87,20 @@ func (s *session) start() error {
87
87
// The session is closed by us (on flush or stop call),
88
88
// or the target process has exited.
89
89
for k , v := range p .Samples () {
90
+ // dotnet profiler reports total time v per call stack k.
91
+ // Meanwhile, pyroscope agent expects number of samples is
92
+ // reported. Every sample is a time fraction of second
93
+ // according to sample rate: 1000ms/100 = 10ms by default.
94
+ // To represent reported time v as a number of samples,
95
+ // we divide it by sample duration.
96
+ //
97
+ // Taking into account that under the hood dotnet spy uses
98
+ // Microsoft-DotNETCore-SampleProfiler, which captures a
99
+ // snapshot of each thread's managed callstack every 10 ms,
100
+ // we cannot manage sample rate from outside.
90
101
s .ch <- line {
91
102
name : []byte (k ),
92
- val : int (v .Milliseconds ()),
103
+ val : int (v .Milliseconds ()) / 10 ,
93
104
}
94
105
}
95
106
}
You can’t perform that action at this time.
0 commit comments