|
|
|
@ -109,14 +109,16 @@ namespace CriticalPathAnalyzer.Server.Tool {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
foreach (ClusterNode node in clusterNodes) {
|
|
|
|
|
FillNodeInformation(node);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Collect information about each cluster:
|
|
|
|
|
response = new AnalyzePathResponse() {
|
|
|
|
|
RequestGuid = requestGuid,
|
|
|
|
|
Clusters = clusterNodes.SelectMany(node =>
|
|
|
|
|
node.Clusters.Select(cluster => CollectClusterInformation(cluster, node.Time))).ToList(),
|
|
|
|
|
Nodes = clusterNodes.Select(FillNodeInformation).ToList(),
|
|
|
|
|
CriticalPathLength = criticalPathLength,
|
|
|
|
|
LoopingClusters = loopingNodes.SelectMany(loopingNode => loopingNode.Clusters
|
|
|
|
|
.Select(cluster => CollectClusterInformation(cluster, 0))).ToList(),
|
|
|
|
|
LoopingNodes = loopingNodes.Select(FillNodeInformation).ToList(),
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
logger.Info("Trace end");
|
|
|
|
@ -400,31 +402,36 @@ namespace CriticalPathAnalyzer.Server.Tool {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Obtain additional information about the cluster:
|
|
|
|
|
/// Collect all it's pegs and sockets.
|
|
|
|
|
/// Obtain additional information about the clusters:
|
|
|
|
|
/// Collect all their pegs and sockets.
|
|
|
|
|
/// </summary>
|
|
|
|
|
private static ClusterDetails CollectClusterInformation(Cluster cluster, int time) {
|
|
|
|
|
var details = new ClusterDetails {
|
|
|
|
|
private static Node FillNodeInformation(ClusterNode node) {
|
|
|
|
|
var clientNode = new Node() {
|
|
|
|
|
Index = node.Index,
|
|
|
|
|
NextNodes = node.NextNodes,
|
|
|
|
|
PrevNodeIndexes = node.PrevNodeIndexes,
|
|
|
|
|
Time = node.Time,
|
|
|
|
|
Pegs = new List<PegAddress>(),
|
|
|
|
|
ConnectingComponents = new List<ComponentAddress>(),
|
|
|
|
|
Time = time,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Two lists are never null, according to how it is created and used:
|
|
|
|
|
IReadOnlyList<InputPeg> inputPegs = cluster.ConnectedInputs;
|
|
|
|
|
IReadOnlyList<OutputPeg> outputPegs = cluster.ConnectedOutputs;
|
|
|
|
|
foreach (Cluster cluster in node.Clusters) {
|
|
|
|
|
// Two lists are never null, according to how it is created and used:
|
|
|
|
|
IReadOnlyList<InputPeg> inputPegs = cluster.ConnectedInputs;
|
|
|
|
|
IReadOnlyList<OutputPeg> outputPegs = cluster.ConnectedOutputs;
|
|
|
|
|
|
|
|
|
|
foreach (InputPeg peg in inputPegs) {
|
|
|
|
|
details.Pegs.Add(peg.Address);
|
|
|
|
|
if (peg.SecretLinks != null && peg.SecretLinks.Any()) {
|
|
|
|
|
// Socket
|
|
|
|
|
details.ConnectingComponents.Add(peg.Address.ComponentAddress);
|
|
|
|
|
foreach (InputPeg peg in inputPegs) {
|
|
|
|
|
clientNode.Pegs.Add(peg.Address);
|
|
|
|
|
if (peg.SecretLinks != null && peg.SecretLinks.Any()) {
|
|
|
|
|
// Socket
|
|
|
|
|
clientNode.ConnectingComponents.Add(peg.Address.ComponentAddress);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
details.Pegs.AddRange(outputPegs.Select(peg => peg.Address));
|
|
|
|
|
clientNode.Pegs.AddRange(outputPegs.Select(peg => peg.Address));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return details;
|
|
|
|
|
return clientNode;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|