예제 #1
0
        public Dictionary<string, object> get_chain_details_Hash(ChainDetailsRequest request)
        {
            var dict = new Dictionary<string, object>();

            var chain = _graph.Behaviors.FirstOrDefault(x => x.Title().GetHashCode() == request.Hash);
            if (chain == null)
            {
                dict.Add("not-found", true);
                return dict;
            }

            dict.Add("details", EndpointReport.ForChain(chain).ToDictionary());

            if (chain is RoutedChain)
            {
                var routed = chain.As<RoutedChain>();
                var description = Description.For(routed.Route);

                dict.Add("route", new DescriptionBodyTag(description).ToString());
            }

            var nodes = chain.NonDiagnosticNodes().Select(x => {
                return new Dictionary<string, object>
                {
                    {"title", Description.For(x).Title},
                    {"details", _visualizer.Visualize(x).ToString()},
                    {"category", x.Category.ToString()}
                };
            });

            dict.Add("nodes", nodes);

            return dict;
        }
예제 #2
0
 public bool Equals(ChainDetailsRequest other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(other.Hash.Equals(Hash));
 }
예제 #3
0
        public Dictionary <string, object> get_chain_details_Hash(ChainDetailsRequest request)
        {
            var dict = new Dictionary <string, object>();

            var chain = _graph.FindChain(request.Hash);

            if (chain == null)
            {
                dict.Add("not-found", true);
                return(dict);
            }

            dict.Add("details", EndpointReport.ForChain(chain).ToDictionary());

            if (chain is RoutedChain)
            {
                var routed      = chain.As <RoutedChain>();
                var description = Description.For(routed.Route);


                dict.Add("route", description.ToDictionary());
            }

            var nodes = chain.NonDiagnosticNodes().Select(x =>
            {
                var details = x.ToDescriptiveDictionary();
                details.Add("category", x.Category.ToString());


                return(details);
            });

            addPerformanceData(dict, chain);

            dict.Add("nodes", nodes);


            return(dict);
        }
예제 #4
0
        public Dictionary<string, object> get_chain_details_Hash(ChainDetailsRequest request)
        {
            var dict = new Dictionary<string, object>();

            var chain = _graph.FindChain(request.Hash);
            if (chain == null)
            {
                dict.Add("not-found", true);
                return dict;
            }

            dict.Add("details", EndpointReport.ForChain(chain).ToDictionary());

            if (chain is RoutedChain)
            {
                var routed = chain.As<RoutedChain>();
                var description = Description.For(routed.Route);


                dict.Add("route", description.ToDictionary());
            }

            var nodes = chain.NonDiagnosticNodes().Select(x =>
            {
                var details = x.ToDescriptiveDictionary();
                details.Add("category", x.Category.ToString());


                return details;
            });

            addPerformanceData(dict, chain);

            dict.Add("nodes", nodes);


            return dict;
        }
예제 #5
0
        public Dictionary <string, object> get_chain_details_Hash(ChainDetailsRequest request)
        {
            var dict = new Dictionary <string, object>();

            var chain = _graph.Behaviors.FirstOrDefault(x => x.Title().GetHashCode() == request.Hash);

            if (chain == null)
            {
                dict.Add("not-found", true);
                return(dict);
            }

            dict.Add("details", EndpointReport.ForChain(chain).ToDictionary());

            if (chain is RoutedChain)
            {
                var routed      = chain.As <RoutedChain>();
                var description = Description.For(routed.Route);


                dict.Add("route", new DescriptionBodyTag(description).ToString());
            }

            var nodes = chain.NonDiagnosticNodes().Select(x => {
                return(new Dictionary <string, object>
                {
                    { "title", Description.For(x).Title },
                    { "details", _visualizer.Visualize(x).ToString() },
                    { "category", x.Category.ToString() }
                });
            });

            dict.Add("nodes", nodes);


            return(dict);
        }
예제 #6
0
 public bool Equals(ChainDetailsRequest other)
 {
     if (ReferenceEquals(null, other)) return false;
     if (ReferenceEquals(this, other)) return true;
     return other.Hash.Equals(Hash);
 }