示例#1
0
 public static IEnumerable <Label> Labels(this Perftools.Profiles.Sample sample, Profile profile)
 {
     return(sample.Label.Select(
                label => new Label {
         Name = profile.StringTable[(int)label.Key], Value = profile.StringTable[(int)label.Str]
     }));
 }
示例#2
0
        public void AddNextSample()
        {
            _lastSample = new PProfProto.Sample();
            _lastSample.Value.AddRange(OwnerBuilder.SampleValuesUnset);

            _profile.Sample.Add(_lastSample);
            SamplesCount = SamplesCount + 1;
        }
示例#3
0
 public static StackTrace StackTrace(this Perftools.Profiles.Sample sample, Profile profile)
 {
     return(new StackTrace(
                sample.LocationId
                .Select(id => profile.Location.First(l => l.Id == id))
                .Select(l => l.Line[0].FunctionId)
                .Select(l => profile.Function.First(f => f.Id == l))
                .Select(f => profile.StringTable[(int)f.Name])
                .Select(s => new StackFrame(s))));
 }
示例#4
0
        internal PProfBuildSession(PProfBuilder owner, PProfBuildSessionState ownerBuildState)
        {
            Validate.NotNull(owner, nameof(owner));
            Validate.NotNull(ownerBuildState, nameof(ownerBuildState));

            _ownerBuildState = ownerBuildState;

            this.OwnerBuilder = owner;
            _profile          = new PProfProto.Profile();
            _lastSample       = null;
            this.SamplesCount = 0;
        }