Exemplo n.º 1
0
        public static VisNetworkDescription GetEstimatedExecutionPlanVisNetwork(this JobDefinitionStructure jobDefinitionStructure)
        {
            var nameToIdDictionary = jobDefinitionStructure.Nodes.Select((Structure, Idx) => new { Structure.NodeName, Idx }).ToDictionary(i => i.NodeName, i => i.Idx);

            return(new VisNetworkDescription
            {
                edges = jobDefinitionStructure.StreamToNodeLinks.Select(link => new VisNetworkStatisticEdge
                {
                    from = nameToIdDictionary[link.SourceNodeName],
                    to = nameToIdDictionary[link.TargetNodeName],
                    value = 1,
                    color = new VisNetworkStatisticColorEdge {
                        color = "#ccd5e2", inherit = false
                    }
                }
                                                                        ).ToList(),
                nodes = jobDefinitionStructure.Nodes.Select(i =>
                {
                    var icon = GetIcon(i);
                    return new VisNetworkStatisticNode
                    {
                        borderWidth = GetNodeBorderWidth(i),
                        id = nameToIdDictionary[i.NodeName],
                        label = i.NodeName,
                        shape = icon != null ? "icon" : null,
                        icon = icon,
                        color = GetNodeColor(i)
                    };
                }).ToList()
            });
        }
Exemplo n.º 2
0
 public static void OpenEstimatedExecutionPlan(this JobDefinitionStructure jobDefinitionStructure, bool?forceEvenWithNoDebugger = false)
 {
     if (Debugger.IsAttached && !forceEvenWithNoDebugger.Value)
     {
         Tools.OpenFile(jobDefinitionStructure.GetEstimatedExecutionPlanHtml(), "html");
     }
 }
Exemplo n.º 3
0
 public override void Initialize(JobDefinitionStructure jobDefinitionStructure)
 {
     Console.WriteLine("Running processes...");
     _stopwatch.Start();
     this._taskUnits = jobDefinitionStructure.Nodes.Select(node => new TaskUnit
     {
         Type = node.TypeName,
         Node = node.NodeName
     }).ToDictionary(i => i.Node);
 }
Exemplo n.º 4
0
 public override void Initialize(JobDefinitionStructure jobDefinitionStructure)
 {
     this._taskUnits = jobDefinitionStructure.Nodes.Select(node => new TaskUnit
     {
         Type = node.TypeName,
         Node = node.NodeName
     }).ToDictionary(i => i.Node);
     _stopwatch.Start();
     _consoleApp.SetData(this._taskUnits.Values.ToList());
     _timer.Start();
 }
Exemplo n.º 5
0
        public static string GetEstimatedExecutionPlanHtmlD3Sankey(this JobDefinitionStructure jobDefinitionStructure)
        {
            var    json = jobDefinitionStructure.GetEstimatedExecutionPlanJsonD3Sankey();
            string file;

            var assembly = typeof(ExecutionStatusEx).Assembly;

            using (var stream = assembly.GetManifestResourceStream("Paillave.Etl.ExecutionPlan.Resources.EstimatedExecutionPlan.D3Sankey.html"))
                using (var reader = new StreamReader(stream))
                    file = reader.ReadToEnd();

            string html = file.Replace("'<<SANKEY_STATISTICS>>'", json);

            return(html);
        }
Exemplo n.º 6
0
        public static string GetEstimatedExecutionPlanHtmlPlotlySankey(this JobDefinitionStructure jobDefinitionStructure)
        {
            var    stats = jobDefinitionStructure.GetEstimatedExecutionPlanPlotlySankey();
            string file;

            var assembly = typeof(JobDefinitionStructureEx).Assembly;

            using (var stream = assembly.GetManifestResourceStream("Paillave.Etl.ExecutionPlan.Resources.EstimatedExecutionPlan.PlotySankey.html"))
                using (var reader = new StreamReader(stream))
                    file = reader.ReadToEnd();

            string html = file.Replace("'<<NODE_NAMES>>'", JsonConvert.SerializeObject(stats.NodeNames));

            html = html.Replace("'<<NODE_COLORS>>'", JsonConvert.SerializeObject(stats.NodeColors));
            html = html.Replace("'<<LINK_SOURCES>>'", JsonConvert.SerializeObject(stats.LinkSources));
            html = html.Replace("'<<LINK_TARGETS>>'", JsonConvert.SerializeObject(stats.LinkTargets));
            html = html.Replace("'<<LINK_VALUES>>'", JsonConvert.SerializeObject(stats.LinkValues));
            return(html);
        }
Exemplo n.º 7
0
        public static PlotlySankeyDescription GetEstimatedExecutionPlanPlotlySankey(this JobDefinitionStructure jobDefinitionStructure)
        {
            var nameToIdDictionary = jobDefinitionStructure.Nodes.Select((Structure, Idx) => new { Structure.NodeName, Idx }).ToDictionary(i => i.NodeName, i => i.Idx);
            var links = jobDefinitionStructure.StreamToNodeLinks.Select(link => new
            {
                source = nameToIdDictionary[link.SourceNodeName],
                target = nameToIdDictionary[link.TargetNodeName],
                value  = 1
            }
                                                                        ).ToList();

            return(new PlotlySankeyDescription
            {
                NodeColors = jobDefinitionStructure.Nodes.OrderBy(i => nameToIdDictionary[i.NodeName]).Select(i => "blue").ToList(),
                NodeNames = jobDefinitionStructure.Nodes.OrderBy(i => nameToIdDictionary[i.NodeName]).Select(i => i.NodeName).ToList(),
                LinkSources = links.Select(i => i.source).ToList(),
                LinkTargets = links.Select(i => i.target).ToList(),
                LinkValues = links.Select(i => i.value).ToList()
            });
        }
Exemplo n.º 8
0
        public static D3SankeyDescription GetEstimatedExecutionPlanD3Sankey(this JobDefinitionStructure jobDefinitionStructure)
        {
            var nameToIdDictionary = jobDefinitionStructure.Nodes.Select((Structure, Idx) => new { Structure.NodeName, Idx }).ToDictionary(i => i.NodeName, i => i.Idx);

            return(new D3SankeyDescription
            {
                links = jobDefinitionStructure.StreamToNodeLinks.Select(link => new D3SankeyStatisticsLink
                {
                    source = nameToIdDictionary[link.SourceNodeName],
                    target = nameToIdDictionary[link.TargetNodeName],
                    value = 1
                }
                                                                        ).ToList(),
                nodes = jobDefinitionStructure.Nodes.Select(i => new D3SankeyStatisticsNode
                {
                    id = nameToIdDictionary[i.NodeName],
                    name = i.NodeName,
                    color = "blue"
                }).ToList()
            });
        }
Exemplo n.º 9
0
 public static void OpenEstimatedExecutionPlanPlotlySankey(this JobDefinitionStructure jobDefinitionStructure)
 {
     Tools.OpenFile(jobDefinitionStructure.GetEstimatedExecutionPlanHtmlPlotlySankey(), "html");
 }
Exemplo n.º 10
0
 public virtual void Initialize(JobDefinitionStructure jobDefinitionStructure)
 {
 }
Exemplo n.º 11
0
 public static string GetEstimatedExecutionPlanJsonD3Sankey(this JobDefinitionStructure jobDefinitionStructure)
 {
     return(JsonConvert.SerializeObject(jobDefinitionStructure.GetEstimatedExecutionPlanD3Sankey()));
 }
Exemplo n.º 12
0
 public static void OpenEstimatedExecutionPlanVisNetwork(this JobDefinitionStructure jobDefinitionStructure)
 {
     Tools.OpenFile(jobDefinitionStructure.GetEstimatedExecutionPlanHtmlVisNetwork(), "html");
 }
Exemplo n.º 13
0
 public static string GetEstimatedExecutionPlanJsonVisNetwork(this JobDefinitionStructure jobDefinitionStructure)
 {
     return(JsonConvert.SerializeObject(jobDefinitionStructure.GetEstimatedExecutionPlanVisNetwork()).Replace(@"""\\u", @"""\u"));
 }