public void NonProxyableComponent() { var container = new ProfilingContainer(); container.AddComponent <NonProxyable>(); container.Resolve <NonProxyable>().LongOperation(); var profile = container.GetProfile(); Assert.AreEqual(0, profile.Children.Count); }
public void ProxyableComponent() { var container = new ProfilingContainer(); container.AddComponent <Proxyable>(); container.Resolve <Proxyable>().LongOperation(); var profile = container.GetProfile(); Assert.AreEqual(1, profile.Children.Count); Console.WriteLine("{0}: {1}", profile.Children[0].Value.Key, profile.Children[0].Value.Value); var fProfile = Flatten(profile); var q = from n in fProfile group n.Value by n.Key into x let kv = new KeyValuePair <MethodInfo, double>(x.Key, x.Sum(t => t.TotalMilliseconds)) orderby kv.Value descending select kv; foreach (var i in q) { Console.WriteLine("{0}: {1}", i.Key, i.Value); } //Console.WriteLine(profile.Values.ToList()[0][0].TotalMilliseconds); }