I am currently developing a system that utilizes JSON data to display server performance statistics in HTML tables. The back-end generates a JSON file every minute, each of which contains information on 10 different areas of server performance. Therefore, each JSON snapshot will correspond to one row in each table.
The goal is to create tables that show the last 15 minutes of data. These tables will update every minute to include the latest data and remove the oldest, ensuring that we always have the most recent 15 minutes of statistics displayed.
As I am new to working with JSON and best practices, any suggestions on the best approach would be greatly appreciated. In terms of loading the data from these files, there are three possible methods that come to mind:
Implementing a central Javascript Object, named currentDataSet, to load the past 15 minutes' worth of JSON files. This object would hold data from 15 JSON files, each containing data for 10 tables. Every minute, currentDataSet would update by replacing the oldest minute with the newest minute's data. Each table renderer function would then extract data from currentDataSet to generate the table.
Alternatively, enabling each table renderer function to fetch its own data independently. This means each table could parse the 15 JSON files and manage its own dataset. For example, having separate JavaScript Objects like performanceByInstance, htmlStatus, databaseStatus, dynacacheStatistics, etc...
Considering using a database to store the JSON data instead of relying solely on parsing and JavaScript Objects for storage.
Exploring other potential methods that I may not have considered due to my limited experience. :-)
My main concern is the efficiency of loading 15 JSON files simultaneously for rendering. In the future, I aim to enable the system to load archived data from specific date/time points quickly and render it into the tables when selected.
Dojo will be utilized to accomplish this task, as it aligns with the tools used to build the UI dashboard for this project.
Thank you for your help and advice!