public static VisNetworkDescription GetEstimatedExecutionPlanVisNetwork(this JobDefinitionStructure jobDefinitionStructure) { var nameToIdDictionary = jobDefinitionStructure.Nodes.Select((Structure, Idx) => new { Structure.Name, Idx }).ToDictionary(i => i.Name, 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.Name], label = i.Name, shape = icon != null ? "icon" : null, icon = icon, color = GetNodeColor(i) }; }).ToList() }); }
public ExecutionStatus(JobDefinitionStructure jobDefinitionStructure, StreamStatistics streamStatistics, TraceEvent endOfProcessTraceEvent) { this.JobDefinitionStructure = jobDefinitionStructure; this.StreamStatisticCounters = streamStatistics.StreamStatisticCounters; this.StreamStatisticErrors = streamStatistics.StreamStatisticErrors; this.EndOfProcessTraceEvent = endOfProcessTraceEvent; this.Failed = this.EndOfProcessTraceEvent != null; }
public static string GetEstimatedExecutionPlanHtmlVisNetwork(this JobDefinitionStructure jobDefinitionStructure) { var json = jobDefinitionStructure.GetEstimatedExecutionPlanJsonVisNetwork(); string file; var assembly = typeof(ExecutionStatusEx).Assembly; using (var stream = assembly.GetManifestResourceStream("Paillave.Etl.ExecutionPlan.EstimatedExecutionPlan.VisNetwork.html")) using (var reader = new StreamReader(stream)) file = reader.ReadToEnd(); string html = file.Replace("'<<STATISTICS>>'", json); return(html); }
//public static async Task<string> GetJsonPlotlySankeyStatisticsAsync<T>(this ExecutionContext<T> executionStatus) //{ // return JsonConvert.SerializeObject(await executionStatus.GetPlotlySankeyStatisticsAsync()); //} 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.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.Name, Idx }).ToDictionary(i => i.Name, 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.Name]).Select(i => "blue").ToList(), NodeNames = jobDefinitionStructure.Nodes.OrderBy(i => nameToIdDictionary[i.Name]).Select(i => i.Name).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.Name, Idx }).ToDictionary(i => i.Name, 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.Name], name = i.Name, color = null }).ToList() }); }
public static string GetEstimatedExecutionPlanJsonVisNetwork(this JobDefinitionStructure jobDefinitionStructure) { return(JsonConvert.SerializeObject(jobDefinitionStructure.GetEstimatedExecutionPlanVisNetwork()).Replace(@"""\\u", @"""\u")); }
public static void OpenEstimatedExecutionPlanVisNetwork(this JobDefinitionStructure jobDefinitionStructure) { Tools.OpenFile(jobDefinitionStructure.GetEstimatedExecutionPlanHtmlVisNetwork(), "html"); }
public static void OpenEstimatedExecutionPlanD3Sankey(this JobDefinitionStructure jobDefinitionStructure) { Tools.OpenFile(jobDefinitionStructure.GetEstimatedExecutionPlanHtmlD3Sankey(), "html"); }
public static string GetEstimatedExecutionPlanJsonD3Sankey(this JobDefinitionStructure jobDefinitionStructure) { return(JsonConvert.SerializeObject(jobDefinitionStructure.GetEstimatedExecutionPlanD3Sankey())); }
public ExecutionStatus(JobDefinitionStructure jobDefinitionStructure, StreamStatistics streamStatistics) { this.JobDefinitionStructure = jobDefinitionStructure; this.StreamStatisticCounters = streamStatistics.StreamStatisticCounters; this.StreamStatisticErrors = streamStatistics.StreamStatisticErrors; }