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() }); }
public static void OpenEstimatedExecutionPlan(this JobDefinitionStructure jobDefinitionStructure, bool?forceEvenWithNoDebugger = false) { if (Debugger.IsAttached && !forceEvenWithNoDebugger.Value) { Tools.OpenFile(jobDefinitionStructure.GetEstimatedExecutionPlanHtml(), "html"); } }
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); }
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(); }
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); }
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); }
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() }); }
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() }); }
public static void OpenEstimatedExecutionPlanPlotlySankey(this JobDefinitionStructure jobDefinitionStructure) { Tools.OpenFile(jobDefinitionStructure.GetEstimatedExecutionPlanHtmlPlotlySankey(), "html"); }
public virtual void Initialize(JobDefinitionStructure jobDefinitionStructure) { }
public static string GetEstimatedExecutionPlanJsonD3Sankey(this JobDefinitionStructure jobDefinitionStructure) { return(JsonConvert.SerializeObject(jobDefinitionStructure.GetEstimatedExecutionPlanD3Sankey())); }
public static void OpenEstimatedExecutionPlanVisNetwork(this JobDefinitionStructure jobDefinitionStructure) { Tools.OpenFile(jobDefinitionStructure.GetEstimatedExecutionPlanHtmlVisNetwork(), "html"); }
public static string GetEstimatedExecutionPlanJsonVisNetwork(this JobDefinitionStructure jobDefinitionStructure) { return(JsonConvert.SerializeObject(jobDefinitionStructure.GetEstimatedExecutionPlanVisNetwork()).Replace(@"""\\u", @"""\u")); }