diff --git a/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/LocalCollector/Connections/ConnectionMonitor.cs b/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/LocalCollector/Connections/ConnectionMonitor.cs index cbba3e013..13c991fdc 100644 --- a/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/LocalCollector/Connections/ConnectionMonitor.cs +++ b/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/LocalCollector/Connections/ConnectionMonitor.cs @@ -10,14 +10,22 @@ // or implied. See the License for the specific language governing permissions // and limitations under the License. +using ProcessExplorer.Abstractions.Entities.Connections; + namespace LocalCollector.Connections; public class ConnectionMonitor : IConnectionMonitor { - private ConnectionMonitorInfo Data { get; } = new(); - ConnectionMonitorInfo IConnectionMonitor.Data + private readonly ConnectionMonitorInfo _connections = new(); + ConnectionMonitorInfo IConnectionMonitor.Connections { - get => Data; + get + { + lock (_locker) + { + return _connections; + } + } } private readonly object _locker = new(); @@ -26,14 +34,14 @@ ConnectionMonitorInfo IConnectionMonitor.Data public ConnectionMonitor(SynchronizedCollection connections) { - Data.Connections = connections; + _connections.Connections = connections; } public void AddConnection(ConnectionInfo connectionInfo) { lock (_locker) { - Data.Connections.Add(connectionInfo); + _connections.Connections.Add(connectionInfo); } } @@ -41,7 +49,7 @@ public void RemoveConnection(ConnectionInfo connectionInfo) { lock (_locker) { - var element = Data.Connections + var element = _connections.Connections .FirstOrDefault(x => x.Id == connectionInfo.Id); if (element == null) @@ -49,8 +57,8 @@ public void RemoveConnection(ConnectionInfo connectionInfo) return; } - var index = Data.Connections.IndexOf(element); - Data.Connections.RemoveAt(index); + var index = _connections.Connections.IndexOf(element); + _connections.Connections.RemoveAt(index); } } @@ -60,7 +68,7 @@ public void AddConnections(SynchronizedCollection connections) { foreach (var conn in connections) { - var element = Data.Connections + var element = _connections.Connections .FirstOrDefault(item => item.Id == conn.Id); if (element == null) @@ -68,14 +76,14 @@ public void AddConnections(SynchronizedCollection connections) continue; } - var index = Data.Connections.IndexOf(element); + var index = _connections.Connections.IndexOf(element); if (index != -1) { - Data.Connections[index] = conn; + _connections.Connections[index] = conn; } else { - Data.Connections.Add(conn); + _connections.Connections.Add(conn); } } } @@ -83,14 +91,14 @@ public void AddConnections(SynchronizedCollection connections) public void UpdateConnection(Guid connId, ConnectionStatus status) { - if (Data.Connections.Count <= 0) - { - return; - } - lock (_locker) { - var conn = Data.Connections + if (_connections.Connections.Count <= 0) + { + return; + } + + var conn = _connections.Connections .FirstOrDefault(c => c.Id == connId); if (conn == null || conn.Status == status.ToStringCached()) diff --git a/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/LocalCollector/IProcessInfoCollector.cs b/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/LocalCollector/IProcessInfoCollector.cs index 4560438da..2ec6620a0 100644 --- a/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/LocalCollector/IProcessInfoCollector.cs +++ b/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/LocalCollector/IProcessInfoCollector.cs @@ -10,11 +10,13 @@ // or implied. See the License for the specific language governing permissions // and limitations under the License. -using LocalCollector.Communicator; using LocalCollector.Connections; using LocalCollector.EnvironmentVariables; using LocalCollector.Modules; using LocalCollector.Registrations; +using ProcessExplorer.Abstractions.Entities; +using ProcessExplorer.Abstractions.Entities.Connections; +using ProcessExplorer.Abstractions.Infrastructure; namespace LocalCollector; @@ -23,7 +25,7 @@ public interface IProcessInfoCollector /// /// Contains information of the environment variables, connections, registrations, modules /// - ProcessInfoCollectorData Data { get; } + ProcessInfoCollectorData ProcessInformation { get; } /// /// Adds a list of connections to the existing one. diff --git a/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/LocalCollector/LocalCollector.csproj b/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/LocalCollector/LocalCollector.csproj index 47adfa83f..7997411dd 100644 --- a/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/LocalCollector/LocalCollector.csproj +++ b/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/LocalCollector/LocalCollector.csproj @@ -8,11 +8,14 @@ - - - - - + + + + + + + + diff --git a/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/LocalCollector/Modules/ModuleMonitorInfo.cs b/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/LocalCollector/Modules/ModuleMonitorInfo.cs index 07910f0ae..b16f7c5ff 100644 --- a/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/LocalCollector/Modules/ModuleMonitorInfo.cs +++ b/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/LocalCollector/Modules/ModuleMonitorInfo.cs @@ -10,6 +10,8 @@ // or implied. See the License for the specific language governing permissions // and limitations under the License. +using ProcessExplorer.Abstractions.Entities.Modules; + namespace LocalCollector.Modules; public class ModuleMonitorInfo diff --git a/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/LocalCollector/ProcessInfoCollector.cs b/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/LocalCollector/ProcessInfoCollector.cs index cf7d94aa0..a62bae80c 100644 --- a/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/LocalCollector/ProcessInfoCollector.cs +++ b/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/LocalCollector/ProcessInfoCollector.cs @@ -11,86 +11,69 @@ // and limitations under the License. using System.Diagnostics; -using LocalCollector.Communicator; using LocalCollector.Connections; using LocalCollector.EnvironmentVariables; using LocalCollector.Logging; using LocalCollector.Modules; using LocalCollector.Registrations; -using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; +using ProcessExplorer.Abstractions.Entities; +using ProcessExplorer.Abstractions.Entities.Connections; +using ProcessExplorer.Abstractions.Infrastructure; namespace LocalCollector; public class ProcessInfoCollector : IProcessInfoCollector { - public ProcessInfoCollectorData Data { get; } = new(); + public ProcessInfoCollectorData ProcessInformation { get; } = new(); private ICommunicator? _communicator; private readonly ILogger _logger; - private readonly AssemblyInformation _assemblyID = new(); + private readonly RuntimeInformation _runtimeId = new(); private readonly object _locker = new(); - ProcessInfoCollector(ICommunicator? channel = null, ILogger? logger = null, - string? assemblyId = null, int? pid = null) + public ProcessInfoCollector( + ILogger? logger = null, + ICommunicator? communicator = null, + EnvironmentMonitorInfo? environmentVariables = null, + IConnectionMonitor? connections = null, + RegistrationMonitorInfo? registrations = null, + ModuleMonitorInfo? modules = null, + string? assemblyId = null, + int? processId = null) { - this._communicator = channel; - this._logger = logger ?? NullLogger.Instance; + _logger = logger ?? NullLogger.Instance; - if (assemblyId != null) - { - this._assemblyID.Name = assemblyId; - } + ProcessInformation.Id = processId ?? Process.GetCurrentProcess().Id; - if (pid != null) - { - Data.Id = Convert.ToInt32(pid); - } - } + ProcessInformation.EnvironmentVariables = environmentVariables != null + ? environmentVariables.EnvironmentVariables + : EnvironmentMonitorInfo.FromEnvironment().EnvironmentVariables; - public ProcessInfoCollector(EnvironmentMonitorInfo envs, IConnectionMonitor cons, ICommunicator? channel = null, - ILogger? logger = null, string? assemblyId = null, int? pid = null) - : this(channel, logger, assemblyId, pid) - { - Data.Id = Process.GetCurrentProcess().Id; - Data.EnvironmentVariables = envs.EnvironmentVariables; - Data.Connections = cons.Data.Connections; + ProcessInformation.Modules = modules != null + ? modules.CurrentModules + : ModuleMonitorInfo.FromAssembly().CurrentModules; - SetConnectionChangedEvent(cons); - } + if (assemblyId != null) _runtimeId.Name = assemblyId; - public ProcessInfoCollector(EnvironmentMonitorInfo envs, IConnectionMonitor cons, - RegistrationMonitorInfo registrations, ModuleMonitorInfo modules, ICommunicator? channel = null, - ILogger? logger = null, string? assemblyId = null, int? pid = null) - : this(envs, cons, channel, logger, assemblyId, pid) - { - Data.Registrations = registrations.Services; - Data.Modules = modules.CurrentModules; - } + if (connections != null) + { + ProcessInformation.Connections = connections.Connections.Connections; - public ProcessInfoCollector(IConnectionMonitor cons, ICollection regs, - ICommunicator? channel = null, ILogger? logger = null, string? assemblyId = null, - int? pid = null) - : this(EnvironmentMonitorInfo.FromEnvironment(), cons, RegistrationMonitorInfo.FromCollection(regs), - ModuleMonitorInfo.FromAssembly(), channel, logger, assemblyId, pid) - { - } + SetConnectionChangedEvent(connections); + } - public ProcessInfoCollector(IConnectionMonitor cons, IServiceCollection regs, ICommunicator? channel = null, - ILogger? logger = null, string? assemblyId = null, int? pid = null) - : this(EnvironmentMonitorInfo.FromEnvironment(), cons, RegistrationMonitorInfo.FromCollection(regs), - ModuleMonitorInfo.FromAssembly(), channel, logger, assemblyId, pid) - { - } + if (registrations != null) + { + ProcessInformation.Registrations = registrations.Services; + } - public ProcessInfoCollector(IConnectionMonitor cons, RegistrationMonitorInfo regs, ICommunicator? channel = null, - ILogger? logger = null, string? assemblyId = null, int? pid = null) - : this(EnvironmentMonitorInfo.FromEnvironment(), cons, regs, ModuleMonitorInfo.FromAssembly(), channel, - logger, assemblyId, pid) - { + if (communicator != null) + { + _communicator = communicator; + } } - private void SetConnectionChangedEvent(IConnectionMonitor connectionMonitor) { connectionMonitor._connectionStatusChanged += ConnectionStatusChangedHandler; @@ -98,10 +81,10 @@ private void SetConnectionChangedEvent(IConnectionMonitor connectionMonitor) public void SetCommunicator(ICommunicator communicator) { - this._communicator = communicator; - var runtimeInfo = new List>() + _communicator = communicator; + var runtimeInfo = new List>() { - new KeyValuePair(_assemblyID, Data) + new(_runtimeId, ProcessInformation) }; _communicator.AddRuntimeInfo(runtimeInfo); @@ -119,13 +102,13 @@ private void ConnectionStatusChangedHandler(object? sender, ConnectionInfo conne { lock (_locker) { - var info = Data.Connections.FirstOrDefault(p => p.Id == connection.Id); + var info = ProcessInformation.Connections.FirstOrDefault(p => p.Id == connection.Id); if (info != null) { - var index = Data.Connections.IndexOf(info); - if (index >= 0 && Data.Connections.Count <= index) + var index = ProcessInformation.Connections.IndexOf(info); + if (index >= 0 && ProcessInformation.Connections.Count <= index) { - Data.Connections[Convert.ToInt32(index)] = connection; + ProcessInformation.Connections[Convert.ToInt32(index)] = connection; } } } @@ -135,9 +118,9 @@ private void ConnectionStatusChangedHandler(object? sender, ConnectionInfo conne _logger.ConnectionStatusChangedError(exception); } - var connections = new List>() + var connections = new List>() { - new(_assemblyID, connection) + new(_runtimeId, connection) }; _communicator.UpdateConnectionInformation(connections) @@ -148,9 +131,9 @@ public async Task SendRuntimeInfo() { if (_communicator != null) { - var runtimeInfo = new List>() + var runtimeInfo = new List>() { - new(_assemblyID, Data) + new(_runtimeId, ProcessInformation) }; await _communicator.AddRuntimeInfo(runtimeInfo); @@ -162,25 +145,23 @@ public async Task AddConnectionMonitor(ConnectionMonitorInfo connections) if(_communicator != null) await AddOrUpdateElements( connections.Connections, - Data.Connections, + ProcessInformation.Connections, (item) => (conn) => conn.Id == item.Id, _communicator.AddConnectionCollection); } - public async Task AddConnectionMonitor(IConnectionMonitor connections) { - await AddConnectionMonitor(connections.Data); + await AddConnectionMonitor(connections.Connections); } - public async Task AddEnvironmentVariables(EnvironmentMonitorInfo environmentVariables) { - if (Data.EnvironmentVariables.IsEmpty) + if (ProcessInformation.EnvironmentVariables.IsEmpty) { lock (_locker) { - Data.EnvironmentVariables = environmentVariables.EnvironmentVariables; + ProcessInformation.EnvironmentVariables = environmentVariables.EnvironmentVariables; } } else @@ -189,7 +170,7 @@ public async Task AddEnvironmentVariables(EnvironmentMonitorInfo environmentVari { lock (_locker) { - Data.EnvironmentVariables.AddOrUpdate(env.Key, env.Value, (_, _) => env.Value); + ProcessInformation.EnvironmentVariables.AddOrUpdate(env.Key, env.Value, (_, _) => env.Value); } } @@ -197,9 +178,9 @@ public async Task AddEnvironmentVariables(EnvironmentMonitorInfo environmentVari if (_communicator != null) { - var info = new List>>>() + var info = new List>>>() { - new(_assemblyID, environmentVariables.EnvironmentVariables) + new(_runtimeId, environmentVariables.EnvironmentVariables) }; await _communicator.UpdateEnvironmentVariableInformation(info); @@ -210,7 +191,7 @@ private async Task AddOrUpdateElements( SynchronizedCollection source, SynchronizedCollection target, Func> predicate, - Func>>, ValueTask> handler) + Func>>, ValueTask> handler) { if (!target.Any()) { @@ -246,9 +227,9 @@ private async Task AddOrUpdateElements( if(_communicator != null) { - var info = new List>>() + var info = new List>>() { - new(_assemblyID, source) + new(_runtimeId, source) }; await handler(info); @@ -260,7 +241,7 @@ public async Task AddRegistrations(RegistrationMonitorInfo registrations) if (_communicator != null) await AddOrUpdateElements( registrations.Services, - Data.Registrations, + ProcessInformation.Registrations, (item) => (reg) => reg.LifeTime == item.LifeTime && reg.ImplementationType == item.ImplementationType && reg.LifeTime == item.LifeTime, _communicator.UpdateRegistrationInformation); } @@ -270,7 +251,7 @@ public async Task AddModules(ModuleMonitorInfo modules) if (_communicator != null) await AddOrUpdateElements( modules.CurrentModules, - Data.Modules, + ProcessInformation.Modules, (item) => (mod) => mod.Name == item.Name && mod.PublicKeyToken == item.PublicKeyToken && mod.Version == item.Version, _communicator.UpdateModuleInformation); } @@ -287,11 +268,11 @@ public async Task AddRuntimeInformation(IConnectionMonitor connections, public void SetAssemblyId(string assemblyId) { - this._assemblyID.Name = assemblyId; + _runtimeId.Name = assemblyId; } public void SetClientPid(int clientPid) { - Data.Id = clientPid; + ProcessInformation.Id = clientPid; } } diff --git a/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/LocalCollector/Registrations/RegistrationsMonitorInfo.cs b/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/LocalCollector/Registrations/RegistrationsMonitorInfo.cs index 7abe03c06..92617d3de 100644 --- a/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/LocalCollector/Registrations/RegistrationsMonitorInfo.cs +++ b/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/LocalCollector/Registrations/RegistrationsMonitorInfo.cs @@ -11,6 +11,7 @@ // and limitations under the License. using Microsoft.Extensions.DependencyInjection; +using ProcessExplorer.Abstractions.Entities.Registrations; namespace LocalCollector.Registrations; diff --git a/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/LocalCollector/Connections/ConnectionInfo.cs b/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/ProcessExplorer.Abstractions/Entities/Connections/ConnectionInfo.cs similarity index 94% rename from Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/LocalCollector/Connections/ConnectionInfo.cs rename to Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/ProcessExplorer.Abstractions/Entities/Connections/ConnectionInfo.cs index a60b40375..b51b95884 100644 --- a/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/LocalCollector/Connections/ConnectionInfo.cs +++ b/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/ProcessExplorer.Abstractions/Entities/Connections/ConnectionInfo.cs @@ -12,7 +12,7 @@ using System.Collections.Concurrent; -namespace LocalCollector.Connections; +namespace ProcessExplorer.Abstractions.Entities.Connections; public record ConnectionInfo { diff --git a/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/LocalCollector/Connections/ConnectionMonitorInfo.cs b/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/ProcessExplorer.Abstractions/Entities/Connections/ConnectionMonitorInfo.cs similarity index 90% rename from Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/LocalCollector/Connections/ConnectionMonitorInfo.cs rename to Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/ProcessExplorer.Abstractions/Entities/Connections/ConnectionMonitorInfo.cs index c8df353b7..f3506fc3b 100644 --- a/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/LocalCollector/Connections/ConnectionMonitorInfo.cs +++ b/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/ProcessExplorer.Abstractions/Entities/Connections/ConnectionMonitorInfo.cs @@ -10,9 +10,9 @@ // or implied. See the License for the specific language governing permissions // and limitations under the License. -namespace LocalCollector.Connections; +namespace ProcessExplorer.Abstractions.Entities.Connections; public class ConnectionMonitorInfo { - public SynchronizedCollection Connections { get; internal set; } = new(); + public SynchronizedCollection Connections { get; set; } = new(); } diff --git a/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/LocalCollector/Connections/ConnectionStatus.cs b/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/ProcessExplorer.Abstractions/Entities/Connections/ConnectionStatus.cs similarity index 92% rename from Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/LocalCollector/Connections/ConnectionStatus.cs rename to Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/ProcessExplorer.Abstractions/Entities/Connections/ConnectionStatus.cs index fa9bd4f44..2509a65e7 100644 --- a/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/LocalCollector/Connections/ConnectionStatus.cs +++ b/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/ProcessExplorer.Abstractions/Entities/Connections/ConnectionStatus.cs @@ -10,7 +10,7 @@ // or implied. See the License for the specific language governing permissions // and limitations under the License. -namespace LocalCollector.Connections; +namespace ProcessExplorer.Abstractions.Entities.Connections; public enum ConnectionStatus { diff --git a/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/LocalCollector/Connections/ConnectionStatusExtensions.cs b/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/ProcessExplorer.Abstractions/Entities/Connections/ConnectionStatusExtensions.cs similarity index 94% rename from Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/LocalCollector/Connections/ConnectionStatusExtensions.cs rename to Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/ProcessExplorer.Abstractions/Entities/Connections/ConnectionStatusExtensions.cs index 16c5218f9..c98edad2c 100644 --- a/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/LocalCollector/Connections/ConnectionStatusExtensions.cs +++ b/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/ProcessExplorer.Abstractions/Entities/Connections/ConnectionStatusExtensions.cs @@ -10,7 +10,7 @@ // or implied. See the License for the specific language governing permissions // and limitations under the License. -namespace LocalCollector.Connections; +namespace ProcessExplorer.Abstractions.Entities.Connections; public static class ConnectionStatusExtensions { diff --git a/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/LocalCollector/Connections/IConnectionMonitor.cs b/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/ProcessExplorer.Abstractions/Entities/Connections/IConnectionMonitor.cs similarity index 94% rename from Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/LocalCollector/Connections/IConnectionMonitor.cs rename to Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/ProcessExplorer.Abstractions/Entities/Connections/IConnectionMonitor.cs index 9e818407b..36c754cb9 100644 --- a/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/LocalCollector/Connections/IConnectionMonitor.cs +++ b/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/ProcessExplorer.Abstractions/Entities/Connections/IConnectionMonitor.cs @@ -10,14 +10,15 @@ // or implied. See the License for the specific language governing permissions // and limitations under the License. -namespace LocalCollector.Connections; + +namespace ProcessExplorer.Abstractions.Entities.Connections; public interface IConnectionMonitor { /// /// Contains the information of the relevant connections. /// - ConnectionMonitorInfo Data { get; } + ConnectionMonitorInfo Connections { get; } /// /// Event for status change of a connection. diff --git a/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/LocalCollector/Modules/ModuleInfo.cs b/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/ProcessExplorer.Abstractions/Entities/Modules/ModuleInfo.cs similarity index 90% rename from Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/LocalCollector/Modules/ModuleInfo.cs rename to Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/ProcessExplorer.Abstractions/Entities/Modules/ModuleInfo.cs index 6ee7446e0..476a83331 100644 --- a/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/LocalCollector/Modules/ModuleInfo.cs +++ b/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/ProcessExplorer.Abstractions/Entities/Modules/ModuleInfo.cs @@ -12,7 +12,7 @@ using System.Reflection; -namespace LocalCollector.Modules; +namespace ProcessExplorer.Abstractions.Entities.Modules; public class ModuleInfo { @@ -22,7 +22,7 @@ public class ModuleInfo public byte[]? PublicKeyToken { get; set; } public string? Location { get; set; } - internal static ModuleInfo FromModule(Assembly assembly, Module module) + public static ModuleInfo FromModule(Assembly assembly, System.Reflection.Module module) { string? location; try diff --git a/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/LocalCollector/ProcessInfoCollectorData.cs b/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/ProcessExplorer.Abstractions/Entities/ProcessInfoCollectorData.cs similarity index 91% rename from Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/LocalCollector/ProcessInfoCollectorData.cs rename to Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/ProcessExplorer.Abstractions/Entities/ProcessInfoCollectorData.cs index 7e90f414a..db1778f08 100644 --- a/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/LocalCollector/ProcessInfoCollectorData.cs +++ b/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/ProcessExplorer.Abstractions/Entities/ProcessInfoCollectorData.cs @@ -12,21 +12,20 @@ using System.Collections.Concurrent; using System.Diagnostics; -using LocalCollector.Connections; -using LocalCollector.EnvironmentVariables; -using LocalCollector.Modules; -using LocalCollector.Registrations; +using ProcessExplorer.Abstractions.Entities.Connections; +using ProcessExplorer.Abstractions.Entities.Modules; +using ProcessExplorer.Abstractions.Entities.Registrations; -namespace LocalCollector; +namespace ProcessExplorer.Abstractions.Entities; [Serializable] public class ProcessInfoCollectorData { public int Id { get; set; } = Process.GetCurrentProcess().Id; public SynchronizedCollection Registrations { get; set; } = new(); - public ConcurrentDictionary EnvironmentVariables { get; set; } = EnvironmentMonitorInfo.FromEnvironment().EnvironmentVariables; + public ConcurrentDictionary EnvironmentVariables { get; set; } = new(); public SynchronizedCollection Connections { get; set; } = new(); - public SynchronizedCollection Modules { get; set; } = ModuleMonitorInfo.FromAssembly().CurrentModules; + public SynchronizedCollection Modules { get; set; } = new(); private readonly object _locker = new(); diff --git a/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/LocalCollector/Registrations/RegistrationInfo.cs b/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/ProcessExplorer.Abstractions/Entities/Registrations/RegistrationInfo.cs similarity index 92% rename from Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/LocalCollector/Registrations/RegistrationInfo.cs rename to Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/ProcessExplorer.Abstractions/Entities/Registrations/RegistrationInfo.cs index edb82aa6d..f61d157d3 100644 --- a/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/LocalCollector/Registrations/RegistrationInfo.cs +++ b/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/ProcessExplorer.Abstractions/Entities/Registrations/RegistrationInfo.cs @@ -10,7 +10,7 @@ // or implied. See the License for the specific language governing permissions // and limitations under the License. -namespace LocalCollector.Registrations; +namespace ProcessExplorer.Abstractions.Entities.Registrations; public class RegistrationInfo { diff --git a/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/LocalCollector/Communicator/AssemblyInformation.cs b/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/ProcessExplorer.Abstractions/Entities/RuntimeInformation.cs similarity index 89% rename from Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/LocalCollector/Communicator/AssemblyInformation.cs rename to Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/ProcessExplorer.Abstractions/Entities/RuntimeInformation.cs index 483a35b8d..ccb6083c6 100644 --- a/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/LocalCollector/Communicator/AssemblyInformation.cs +++ b/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/ProcessExplorer.Abstractions/Entities/RuntimeInformation.cs @@ -10,10 +10,10 @@ // or implied. See the License for the specific language governing permissions // and limitations under the License. -namespace LocalCollector.Communicator; +namespace ProcessExplorer.Abstractions.Entities; [Serializable] -public class AssemblyInformation +public class RuntimeInformation { public string Name { get; set; } = string.Empty; } diff --git a/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/ProcessExplorer.Abstractions/IProcessInfoAggregator.cs b/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/ProcessExplorer.Abstractions/IProcessInfoAggregator.cs index 063832ba0..2177592b9 100644 --- a/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/ProcessExplorer.Abstractions/IProcessInfoAggregator.cs +++ b/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/ProcessExplorer.Abstractions/IProcessInfoAggregator.cs @@ -10,10 +10,10 @@ // or implied. See the License for the specific language governing permissions // and limitations under the License. -using LocalCollector; -using LocalCollector.Connections; -using LocalCollector.Modules; -using LocalCollector.Registrations; +using ProcessExplorer.Abstractions.Entities; +using ProcessExplorer.Abstractions.Entities.Connections; +using ProcessExplorer.Abstractions.Entities.Modules; +using ProcessExplorer.Abstractions.Entities.Registrations; using ProcessExplorer.Abstractions.Infrastructure; using ProcessExplorer.Abstractions.Processes; using ProcessExplorer.Abstractions.Subsystems; diff --git a/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/LocalCollector/Communicator/ICommunicator.cs b/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/ProcessExplorer.Abstractions/Infrastructure/ICommunicator.cs similarity index 70% rename from Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/LocalCollector/Communicator/ICommunicator.cs rename to Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/ProcessExplorer.Abstractions/Infrastructure/ICommunicator.cs index aea554a6d..dd8cf6cce 100644 --- a/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/LocalCollector/Communicator/ICommunicator.cs +++ b/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/ProcessExplorer.Abstractions/Infrastructure/ICommunicator.cs @@ -10,11 +10,12 @@ // or implied. See the License for the specific language governing permissions // and limitations under the License. -using LocalCollector.Connections; -using LocalCollector.Modules; -using LocalCollector.Registrations; +using ProcessExplorer.Abstractions.Entities; +using ProcessExplorer.Abstractions.Entities.Connections; +using ProcessExplorer.Abstractions.Entities.Modules; +using ProcessExplorer.Abstractions.Entities.Registrations; -namespace LocalCollector.Communicator; +namespace ProcessExplorer.Abstractions.Infrastructure; public interface ICommunicator { @@ -23,40 +24,40 @@ public interface ICommunicator /// /// /// - ValueTask AddRuntimeInfo(IEnumerable> listOfRuntimeInfos); + ValueTask AddRuntimeInfo(IEnumerable> listOfRuntimeInfos); /// /// Sends a message to the UI, if a new list of connections has been added. /// /// /// - ValueTask AddConnectionCollection(IEnumerable>> connections); + ValueTask AddConnectionCollection(IEnumerable>> connections); /// /// Sends a message to the UI, if a connection has been updated. /// /// /// - ValueTask UpdateConnectionInformation(IEnumerable> connections); + ValueTask UpdateConnectionInformation(IEnumerable> connections); /// /// Sends a message to the UI, if the environment variables of the collector has been updated. /// /// /// - ValueTask UpdateEnvironmentVariableInformation(IEnumerable>>> environmentVariables); + ValueTask UpdateEnvironmentVariableInformation(IEnumerable>>> environmentVariables); /// /// Sends a message to the UI, if the registrations of the collector has been updated. /// /// /// - ValueTask UpdateRegistrationInformation(IEnumerable>> registrations); + ValueTask UpdateRegistrationInformation(IEnumerable>> registrations); /// /// Sends a message to the UI, if the modules of the collector has been updated. /// /// /// - ValueTask UpdateModuleInformation(IEnumerable>> modules); + ValueTask UpdateModuleInformation(IEnumerable>> modules); } diff --git a/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/ProcessExplorer.Abstractions/Infrastructure/IUIHandler.cs b/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/ProcessExplorer.Abstractions/Infrastructure/IUIHandler.cs index 7c88911d7..5da3fe657 100644 --- a/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/ProcessExplorer.Abstractions/Infrastructure/IUIHandler.cs +++ b/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/ProcessExplorer.Abstractions/Infrastructure/IUIHandler.cs @@ -10,10 +10,10 @@ // or implied. See the License for the specific language governing permissions // and limitations under the License. -using LocalCollector; -using LocalCollector.Connections; -using LocalCollector.Modules; -using LocalCollector.Registrations; +using ProcessExplorer.Abstractions.Entities; +using ProcessExplorer.Abstractions.Entities.Connections; +using ProcessExplorer.Abstractions.Entities.Modules; +using ProcessExplorer.Abstractions.Entities.Registrations; using ProcessExplorer.Abstractions.Processes; using ProcessExplorer.Abstractions.Subsystems; diff --git a/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/ProcessExplorer.Abstractions/Infrastructure/Protos/ProcessExplorerMessages.proto b/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/ProcessExplorer.Abstractions/Infrastructure/Protos/ProcessExplorerMessages.proto index fe6b2e697..599ddcc61 100644 --- a/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/ProcessExplorer.Abstractions/Infrastructure/Protos/ProcessExplorerMessages.proto +++ b/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/ProcessExplorer.Abstractions/Infrastructure/Protos/ProcessExplorerMessages.proto @@ -20,7 +20,7 @@ message Message{ repeated Registration registrations = 4; repeated Module modules = 5; map environmentVariables = 6; - optional int32 pid = 7; + optional int32 processId = 7; map subsystems = 8; repeated ProcessInfoCollectorData runtimeInfo = 9; repeated Connection connections = 10; @@ -61,7 +61,7 @@ message Process{ optional google.protobuf.Duration processorUsageTime = 5; optional int64 physicalMemoryUsageBit = 6; optional string processName = 7; - optional int32 pid = 8; + optional int32 processId = 8; optional string processPriorityClass = 9; repeated ProcessThreadInfo threads = 10; optional int64 virtualMemorySize = 11; diff --git a/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/ProcessExplorer.Abstractions/ProcessExplorer.Abstractions.csproj b/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/ProcessExplorer.Abstractions/ProcessExplorer.Abstractions.csproj index fe056a69d..eb6e04734 100644 --- a/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/ProcessExplorer.Abstractions/ProcessExplorer.Abstractions.csproj +++ b/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/ProcessExplorer.Abstractions/ProcessExplorer.Abstractions.csproj @@ -27,10 +27,6 @@ - - - - Both diff --git a/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/ProcessExplorer.Core/Infrastructure/Communicator.cs b/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/ProcessExplorer.Core/Infrastructure/Communicator.cs index f60d8e645..92dadb80e 100644 --- a/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/ProcessExplorer.Core/Infrastructure/Communicator.cs +++ b/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/ProcessExplorer.Core/Infrastructure/Communicator.cs @@ -10,12 +10,12 @@ // or implied. See the License for the specific language governing permissions // and limitations under the License. -using LocalCollector; -using LocalCollector.Communicator; -using LocalCollector.Connections; -using LocalCollector.Modules; -using LocalCollector.Registrations; using ProcessExplorer.Abstractions; +using ProcessExplorer.Abstractions.Entities; +using ProcessExplorer.Abstractions.Entities.Connections; +using ProcessExplorer.Abstractions.Entities.Modules; +using ProcessExplorer.Abstractions.Entities.Registrations; +using ProcessExplorer.Abstractions.Infrastructure; namespace ProcessExplorer.Core.Infrastructure; @@ -29,7 +29,7 @@ public Communicator(IProcessInfoAggregator processAggregator) _aggregator = processAggregator; } - public async ValueTask AddRuntimeInfo(IEnumerable> listOfRuntimeInfos) + public async ValueTask AddRuntimeInfo(IEnumerable> listOfRuntimeInfos) { if (listOfRuntimeInfos == null) return; @@ -42,7 +42,7 @@ public async ValueTask AddRuntimeInfo(IEnumerable>> connections) + public async ValueTask AddConnectionCollection(IEnumerable>> connections) { if (connections == null) return; @@ -53,7 +53,7 @@ public async ValueTask AddConnectionCollection(IEnumerable> connections) + public async ValueTask UpdateConnectionInformation(IEnumerable> connections) { if (connections == null) return; @@ -64,7 +64,7 @@ public async ValueTask UpdateConnectionInformation(IEnumerable>>> environmentVariables) + public async ValueTask UpdateEnvironmentVariableInformation(IEnumerable>>> environmentVariables) { if (environmentVariables == null) return; @@ -75,7 +75,7 @@ public async ValueTask UpdateEnvironmentVariableInformation(IEnumerable>> registrations) + public async ValueTask UpdateRegistrationInformation(IEnumerable>> registrations) { if (registrations == null) return; @@ -86,7 +86,7 @@ public async ValueTask UpdateRegistrationInformation(IEnumerable>> modules) + public async ValueTask UpdateModuleInformation(IEnumerable>> modules) { if (modules == null) return; diff --git a/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/ProcessExplorer.Core/ProcessExplorer.Core.csproj b/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/ProcessExplorer.Core/ProcessExplorer.Core.csproj index bc67c26d3..9d9664d53 100644 --- a/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/ProcessExplorer.Core/ProcessExplorer.Core.csproj +++ b/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/ProcessExplorer.Core/ProcessExplorer.Core.csproj @@ -12,7 +12,6 @@ - diff --git a/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/ProcessExplorer.Core/ProcessInfoAggregator.cs b/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/ProcessExplorer.Core/ProcessInfoAggregator.cs index b31f799e5..a107d8ce3 100644 --- a/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/ProcessExplorer.Core/ProcessInfoAggregator.cs +++ b/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/ProcessExplorer.Core/ProcessInfoAggregator.cs @@ -12,13 +12,13 @@ using System.Collections.Concurrent; using System.Diagnostics; -using LocalCollector; -using LocalCollector.Connections; -using LocalCollector.Modules; -using LocalCollector.Registrations; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; using ProcessExplorer.Abstractions; +using ProcessExplorer.Abstractions.Entities; +using ProcessExplorer.Abstractions.Entities.Connections; +using ProcessExplorer.Abstractions.Entities.Modules; +using ProcessExplorer.Abstractions.Entities.Registrations; using ProcessExplorer.Abstractions.Infrastructure; using ProcessExplorer.Abstractions.Logging; using ProcessExplorer.Abstractions.Processes; diff --git a/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/ProcessExplorer.Server/Server/Helper/ProtoConvertHelper.cs b/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/ProcessExplorer.Server/Server/Helper/ProtoConvertHelper.cs index 3a8b837d0..97b390237 100644 --- a/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/ProcessExplorer.Server/Server/Helper/ProtoConvertHelper.cs +++ b/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/ProcessExplorer.Server/Server/Helper/ProtoConvertHelper.cs @@ -13,7 +13,9 @@ using Google.Protobuf; using Google.Protobuf.Collections; using Google.Protobuf.WellKnownTypes; -using LocalCollector.Connections; +using ProcessExplorer.Abstractions.Entities.Connections; +using ProcessExplorer.Abstractions.Entities.Modules; +using ProcessExplorer.Abstractions.Entities.Registrations; using ProcessExplorer.Abstractions.Extensions; using ProcessExplorer.Abstractions.Infrastructure.Protos; using ProcessExplorer.Abstractions.Processes; @@ -64,7 +66,7 @@ public static Process DeriveProtoProcessType(this ProcessInfoData process) : Duration.FromTimeSpan(TimeSpan.Zero), PhysicalMemoryUsageBit = process.PhysicalMemoryUsageBit ?? 0, ProcessName = process.ProcessName ?? string.Empty, - Pid = process.ProcessId, + ProcessId = process.ProcessId, ProcessPriorityClass = process.ProcessPriorityClass ?? string.Empty, Threads = { threads }, VirtualMemorySize = process.VirtualMemorySize ?? 0, @@ -90,7 +92,7 @@ public static Connection DeriveProtoConnectionType(this ConnectionInfo connectio }; } - public static ProcessInfoCollectorData DeriveProtoRuntimeInfoType(this LocalCollector.ProcessInfoCollectorData runtimeInfo) + public static ProcessInfoCollectorData DeriveProtoRuntimeInfoType(this ProcessExplorer.Abstractions.Entities.ProcessInfoCollectorData runtimeInfo) { return new() { @@ -102,7 +104,7 @@ public static ProcessInfoCollectorData DeriveProtoRuntimeInfoType(this LocalColl }; } - public static Registration DeriveProtoRegistrationType(this LocalCollector.Registrations.RegistrationInfo registration) + public static Registration DeriveProtoRegistrationType(this RegistrationInfo registration) { return new() { @@ -112,7 +114,7 @@ public static Registration DeriveProtoRegistrationType(this LocalCollector.Regis }; } - public static Module DeriveProtoModuleType(this LocalCollector.Modules.ModuleInfo module) + public static Module DeriveProtoModuleType(this ModuleInfo module) { return new() { diff --git a/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/ProcessExplorer.Server/Server/Infrastructure/Grpc/GrpcUIHandler.cs b/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/ProcessExplorer.Server/Server/Infrastructure/Grpc/GrpcUIHandler.cs index e58087d5c..aa8e7fa90 100644 --- a/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/ProcessExplorer.Server/Server/Infrastructure/Grpc/GrpcUIHandler.cs +++ b/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/src/ProcessExplorer.Server/Server/Infrastructure/Grpc/GrpcUIHandler.cs @@ -12,11 +12,11 @@ using System.Collections.Concurrent; using Google.Protobuf.Collections; -using LocalCollector.Connections; -using LocalCollector.Modules; -using LocalCollector.Registrations; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; +using ProcessExplorer.Abstractions.Entities.Connections; +using ProcessExplorer.Abstractions.Entities.Modules; +using ProcessExplorer.Abstractions.Entities.Registrations; using ProcessExplorer.Abstractions.Infrastructure; using ProcessExplorer.Abstractions.Infrastructure.Protos; using ProcessExplorer.Abstractions.Logging; @@ -140,7 +140,7 @@ public Task AddProcesses(IEnumerable processes) return Task.CompletedTask; } - public Task AddRuntimeInfo(string assemblyId, LocalCollector.ProcessInfoCollectorData dataObject) + public Task AddRuntimeInfo(string assemblyId, ProcessExplorer.Abstractions.Entities.ProcessInfoCollectorData dataObject) { lock (_uiHandlersLock) { @@ -171,7 +171,7 @@ public Task AddRuntimeInfo(string assemblyId, LocalCollector.ProcessInfoCollecto return Task.CompletedTask; } - public Task AddRuntimeInfo(IEnumerable> runtimeInfo) + public Task AddRuntimeInfo(IEnumerable> runtimeInfo) { lock (_uiHandlersLock) { @@ -208,7 +208,7 @@ public Task TerminateProcess(int pid) var message = new Message() { Action = ActionType.RemoveProcessByIdAction, - Pid = pid + ProcessId = pid }; return UpdateInfoOnUI(handler => handler.SendMessage(message)); diff --git a/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/test/ProcessExplorer.Core.Tests/ProcessInfoAggregator.Tests.cs b/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/test/ProcessExplorer.Core.Tests/ProcessInfoAggregator.Tests.cs index ec4f5a16e..2c3b4a410 100644 --- a/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/test/ProcessExplorer.Core.Tests/ProcessInfoAggregator.Tests.cs +++ b/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/test/ProcessExplorer.Core.Tests/ProcessInfoAggregator.Tests.cs @@ -17,13 +17,13 @@ using System.Reflection; using System.Threading; using System.Threading.Tasks; -using LocalCollector; -using LocalCollector.Connections; -using LocalCollector.Modules; -using LocalCollector.Registrations; using Microsoft.Extensions.Logging.Abstractions; using Moq; using ProcessExplorer.Abstractions; +using ProcessExplorer.Abstractions.Entities; +using ProcessExplorer.Abstractions.Entities.Connections; +using ProcessExplorer.Abstractions.Entities.Modules; +using ProcessExplorer.Abstractions.Entities.Registrations; using ProcessExplorer.Abstractions.Infrastructure; using ProcessExplorer.Abstractions.Processes; using ProcessExplorer.Abstractions.Subsystems; diff --git a/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/test/ProcessExplorer.Server.EndToEndTests/EndToEndTests.cs b/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/test/ProcessExplorer.Server.EndToEndTests/EndToEndTests.cs index 88a8d9856..7b5d57ae2 100644 --- a/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/test/ProcessExplorer.Server.EndToEndTests/EndToEndTests.cs +++ b/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/test/ProcessExplorer.Server.EndToEndTests/EndToEndTests.cs @@ -47,7 +47,7 @@ public async Task Client_can_connect() { var client = CreateGrpcClient(); - using var cancellationTokenSource = new CancellationTokenSource(TimeSpan.FromSeconds(1)); + using var cancellationTokenSource = new CancellationTokenSource(TimeSpan.FromSeconds(2)); var messages = new List(); @@ -98,7 +98,7 @@ public async Task Client_can_subscribe_and_receive_messages() } var client = CreateGrpcClient(); - var cancellationTokenSource = new CancellationTokenSource(TimeSpan.FromSeconds(1)); + var cancellationTokenSource = new CancellationTokenSource(TimeSpan.FromSeconds(2)); var messages = new List(); var call = client.Subscribe(new Empty(), cancellationToken: cancellationTokenSource.Token); @@ -140,7 +140,7 @@ public async Task Client_can_subscribe_and_receive_messages() public void Client_can_send_message() { var client = CreateGrpcClient(); - var cancellationTokenSource = new CancellationTokenSource(TimeSpan.FromSeconds(1)); + var cancellationTokenSource = new CancellationTokenSource(TimeSpan.FromSeconds(2)); var message = new Message() { diff --git a/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/test/ProcessExplorer.Server.EndToEndTests/ProcessExplorer.Server.IntegrationTests.csproj b/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/test/ProcessExplorer.Server.EndToEndTests/ProcessExplorer.Server.IntegrationTests.csproj index e03cfda7e..1f3f47e98 100644 --- a/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/test/ProcessExplorer.Server.EndToEndTests/ProcessExplorer.Server.IntegrationTests.csproj +++ b/Tryouts/Plugins/ApplicationPlugins/MorganStanley.ComposeUI.ProcessExplorer/dotnet/test/ProcessExplorer.Server.EndToEndTests/ProcessExplorer.Server.IntegrationTests.csproj @@ -4,7 +4,6 @@ net6.0 enable false - true