yaconsult has asked for the wisdom of the Perl Monks concerning the following question:
I did some experimenting with generating reports and there seemed to be lots of overhead (read SLOW) when doing very large numbers of queries from a script. I got much better results by letting sqlite do the work by grouping the query results by timestamp (epoch seconds) to get back big arrays containing the data for an entire period and then processing that.
This turned out not to be a problem because I found that I needed to do some post-processing anyway because what wasn't happening, and therefore wasn't in the log, was also important. For example, when looking at load balancing across ports, I needed to know which ports had no activity while other ports were hammered, so my post-processing step fills in zeros in these cases.
I output CSV files which the concerned people load into their favorite spreadsheet for graphing. This has worked well, but now I'm looking at eliminating that last part and automating the report generation. I know I could generate the spreadsheets and have done so before, but spreadsheets aren't really needed as the data will not be changed. And working with huge spreadsheets gets cumbersome. We're just using them as a tool for displaying the data.
I experimented with GD::Graph yesterday and generated GIFs from the CSVs.
An important factor is that I'm going to be done with this project at the end of this month and it will have to be maintained and modified by people with probably limited programming experience.
I'm envisioning having something that can be run which opens an sqlite database which contains log on 24-hour period (spanning two dates).
What would be great would be if the user could select the results they want from some kind of pulldown or checkbox. This would determine the query to be run. Maybe they would then be able to select the start and end times within the log that they were interested in. And the result would be either a graph or table depending on the query.
I don't know if the results should be displayed in some kind of interface or produce output files. I suppose the simple way would be to just have a lot of script options that could be specified on the command line.
So, I've got the Perl Template Toolkit book on my desk but haven't had time to go through it yet. There's an available web server that's used to display Nagios output, so I suppose I could use a web framework, like catalyst, but that might not be the best approach since I won't be around to take care of it.
So, how would you appoach this? Web framework? CGI? Web pages from TT? TK something? Or would you just have a bunch of script arguments to use to specify input, process, output?
Thanks!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Generating graphs and tables for admins - templates, frameworks, files or what?
by leighsharpe (Monk) on Aug 06, 2009 at 03:26 UTC | |
|
Re: Generating graphs and tables for admins - templates, frameworks, files or what?
by jrsimmon (Hermit) on Aug 06, 2009 at 05:43 UTC | |
|
Re: Generating graphs and tables for admins - templates, frameworks, files or what?
by pileofrogs (Priest) on Aug 06, 2009 at 16:51 UTC | |
|
Re: Generating graphs and tables for admins - templates, frameworks, files or what?
by tmiklas (Hermit) on Aug 07, 2009 at 09:41 UTC |