Alignak-monitoring-contrib / alignak-app

Desktop application in system tray for Alignak users.
GNU Affero General Public License v3.0
6 stars 2 forks source link

Review App #201

Closed algorys closed 7 years ago

algorys commented 7 years ago

App was at the base intended to display only notifications about hosts and services and to use only the system tray.

     Backend Data                           ]
------------------------------------------- ] -> request Backend when UI requests
alignakdaemon - livesynthesis -  items data ]    and dont store all data.
            |
            |
            |
Hosts / Services Views ]
Banners                ] -> They make request each time for display / refresh
Menus                  ]

Since then it has evolved considerably and deserves to be reviewed. This issue is intended to define the global future processes. I'm not very friendly with :

To resume:

     Backend Data                           ]
------------------------------------------- ] -> request periodically Alignak Backend
alignakdaemon - livesynthesis -  items data ]    and store each data
            |
            |
Controllers give Data when needed
            |
            |
Hosts / Services Views ]
Banners                ] -> They only need to display what the controllers give
Menus                  ]

With this system, App should be much more fluid and this will really separate the interface from the data.

App will be also able to keep the old data and make some diff more easily.

algorys commented 7 years ago

af42a31 add first version of Threadmanager and DataManager.

Threadmanager:

This class manage the BackendQThread who make requests. ThreadManager will make periodic threads to get items data and feed the DataManager.

Currently, BackendQThread makes its requests every 30 seconds.

DataManager:

This class now manage the App data. It will be the link between the queries and the GUI. So later, she will have accessor to give data to GUI and also keep other informations, like alignakdaemon states or livesynthesis. Currently, she only get all items (hosts and services) with the minimum informations used by App (thanks to projection).

This class make NO requests because she is feed by BackendQThread.

Next Steps:

If I update schema:

 Threadmanager & BackendQThread          ]
" Request periodically Alignak Backend " ] 
 " Feed DataManager "                    ]
---------------------------------------- ]   
            |
            |
DataManager: " Store and give Data when needed "
(alignakdaemon - livesynthesis -  items data)
            |
            |
Hosts / Services Views ]
Banners                ] -> They only need to display what the datamanager have stored,
Menus                  ]    by simple GET functions

So next is:

algorys commented 7 years ago

Finally, finish by:

Missing two endpoint:

Integrate DataManager and Threads:

Normally then App will execute 2 tasks: the QApplication run and the ThreadManager in parallel.

algorys commented 7 years ago

Done.

All requests are now replaced by accessors in DAtaManager.

Application wait DataManager is ready before start.

For the moment only some functions have been retained for the ActionManager and therefore need to be reviewed. See #207.