Report 3: Coding Week 3

Progress

  • Opted for a class level design similar to PluginService, and now the PluginResourceMonitor instance is created and started at the same levels as PluginService.
  • The instance of the PluginResourceMonitor now serves as a daemon for the whole app, related plugin resource consumption data can be fetched from here, from any package, ensuring integrity.
  • The test app (app-cli) and the GUI now has coherent data access, resulting in ease of writing tests.

Plans

  • Finalising the UI for the plugins and their resources display.
  • Writing basic tests for the UI.
  • Looking into the alert system, (deferred the development due to priority reassignment).

Problems

  • As the data in PluginResourceMonitor is updated independently, (using a setInterval() that fetched data from the Electron API every 5 secs), the React state needs to be updated separately, this can be done in the following ways:
    • The most straightforward way is to use another setInterval() in the Electron App, that syncs the React State variable to the updated monitor service data.
    • Another way may be to use events to trigger a React State update.
      I have yet to determine which one is better in terms of performance, in other cases, the former would be more performance heavy if it had to fetch data every 5 seconds or so, however, here, as the plugin resource usage data is quite small, it may be prudent to just go for the former method. Also, the setInterval() can be cleared on useEffect() cleanup.