So you mean the integers in the samples array are indexes of 
CpuProfileNodes?  But does CpuProfileNode have an index?  Still struggling 
to see how to get the integers in the samples array.

On Wednesday, December 9, 2015 at 4:08:09 AM UTC-8, Ben Noordhuis wrote:
>
> On Wed, Dec 9, 2015 at 2:32 AM, Jane Chen <[email protected] <javascript:>> 
> wrote: 
> > I'm trying to serialize the CpuProfile object to a JSON serialization 
> > compatible to Chrome's .cpuprofile file.  The part I'm not clear about 
> is 
> > the samples array in the .cpuprofile file: 
> > 
> > "head": 
> > {} 
> > , 
> > "startTime": 1611259.054962, 
> > "endTime": 1611262.312964, 
> > "samples": [ 
> > 2, 
> > 3, 
> > 3, 
> > 3, 
> > 
> > So it looks like an integer array, but what are they?  Line numbers? 
>  How do 
> > I get it from CpuProfileNode returned from CpuProfile::GetSample()? 
> > 
> > Thanks a lot! 
>
> "samples" corresponds to the record_samples argument to 
> v8::StartProfiling::CpuProfiler().  When false, you get the aggregated 
> hit count.  When true, you get data that can be plotted on a timeline. 
> Put another way, record_samples=false only tells you "how much", 
> record_samples=true also tells you "when". 
>
> The array itself is basically a mapping of CpuProfileNodes from 
> CpuProfile::GetSample() to integers and sorted by timestamp in 
> ascending order. 
>

-- 
-- 
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
"v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to