This is a Cross Platform Console Application which Logs system Statistics to provided plugin. Plugins can be inserted dynamically to the application.
-
Plugin-Architecture
- Plugin Architecture makes the application more modular providing self-contained components (Plugins) for specific behaviours making system testable,maintainable.
- Application follows Open-Close Principle when used plugin architecture where applications usage is open to extension but closed to modification.
-
SOLID principle:
- Solid principles should always be implemented whenever a code is written it makes core more readable and maintainable.
-
Strategy Pattern:
- This application needs some platform specific code so that it can work on multiple platforms.
- Using strategy pattern with interface to abstract the platform specific logic.
-
Producer Consumer Design
- When getting stats for each interval there can be some delay while logging tha data through different mechanisms which can delay reading for next iteration.
- Producer (in case our host app) produces data at each interval and Consumer (plugins in our case) can consume them at any rate.
-
Clean(Onion) Architecture:
- I have used Layered Onion architecture so that services are accessed using Exposed Apis only.
- If the Core is changed it will impact all the plugins and Host.
- BackPressure Issue :
- I am using UnBounded Channels to produce the data. if this data is not consumed at a rate better than production then there can be BackPressure.
- Manually needs to copy plugins dll to the plugins path it can be automated.
- Extract the Downloaded Setup.
- Open the folder in terminal and run following command:
.\SystemMonitor.Host logtofile 2000
.\SystemMonitor.Hostis our application namelogtofileis plugin command for logging to file, and2000represents interval in milliseconds in which to get the data (2sec)
This command will create a log.txt file in Output/ directory.
- To run for remote logger plugin:
- First make sure you update
appsettings.jsonwith proper baseUrl and path. - now run command:
.\SystemMonitor.Host logtofile 2000 - you should see logs which states the requests send in the terminal.
- First make sure you update
