Reputation: 16192
I'm currently in the progress of setting up a localhost based web application on port 8080. This application comes with my Java server application, and is used to show statistics related to the server. I currently am using a basic Java GUI to show the statistics of the server, however I wanted to make it accessible from over the web with visual representations of data.
The graphs that I will be using are as follows:
The information displayed by the graph would need to be updated every second. The information that these graphs will display are things such as the servers current network I/O, current RAM usage, current CPU usage, the amount of threads that the server is running on, processing times for threads, etc.
As stated before, I already have all of this information being sent to a GUI in a text-based format.
The problem that I'm running into the most while looking through APIs for charts is that they all call out to another website(Such as google chart API) and then it generates an image, this image is then displayed. Doing this once per second would destroy your bandwidth, if your internet connection could even remotely keep up.
The only solution that I have personally thought of is to create a system in which a layout for a graph is drawn, then have it so the website would ''Connect the dots'' of the points on the graph. Then I would only have to update the points on the graph, then call the draw function again, but there's two problems.
I know for a fact that this has to be possible, because applications such as (Competition)SmartFoxServer use it. Example image:
Upvotes: 0
Views: 560
Reputation: 3031
You can easily use some opensource JS chart library for this. Good options: http://www.chartjs.org/ or http://www.flotcharts.org/ or http://dygraphs.com/
You get the data from your server in i.e. JSON format with AJAX request (5 s period?) and feed it to the chart library. You could use websockets to have updates triggered from server but that is slightly more difficult.
Upvotes: 1