views:

164

answers:

3

I have a simple task that I feel there has to be an app out there for (or is easy to build or extend an open-source version).

I need to run a mysql query repeatedly and look for changes in the results between runs (the data is coming in in real time).

I have built several of these queries and throughout the day find myself jumping between tabs in my mysql client running them, and trying to see what has changed. This becomes difficult as there are hundreds of rows of data and you can't remember the previous values easily.

Ideally I could have a simple app (or web app) that stores the query, and refreshes over and over again. As the data is filled into the table it could compare the old results and change the color to red or green (or something).

I would need sorting, and simple filtering (possibly with string replaces into the query based on the inputs.

We run Ubuntu at work and I have tried doing this via terminal scripts (we use Ruby), but I feel a more-visual output would give me better results.

Googling around I see several for-pay apps, but there has to be something out there to do this.

I don't mind coding one up, but I don't like to re-invent the wheel if I don't have to.

Many thanks!

A: 

I've done something similar in the past using Excel. Just build a connected spreadsheet, make your queries and the result will be outputed to Excel, then you format the way you like it. Very flexible, and if you need some kind of logic beyond the query itself, there are always Excel's built in functions and VBA.

Here is a useful link to help you. It is very simple:

http://port25.technet.com/archive/2007/04/10/connecting-office-applications-to-mysql-and-postgresql-via-odbc.aspx

Pedro
I've done this with some success as well. The only issue is the lack of flexibility of excel's built in charts. I think you need something like the ggplot2 package for the R statistical programming language to create the really good charts and graphs that Tufte and Few talk about.
+1  A: 

For simple things like this you are not reinventing the wheel as much as making your own sandwich -- some things don't make much sense to buy. Just build the simplest web page possible (e.g. a table with the table names you are interested in and maybe a timestamp for the last time it was checked. Have some javascipt run your query and color the cells based on the change you are looking for...repeating this operation as needed. I could give you more specific info if you can tell me how the data changes...more entries into a table? Updates to existing data?

Ichorus
Here are a few sample rows|identifier|value1|value2|value3||identifier|value1|value2|value3|The value fields would be changing for each identifier. So lets say value1 is 5,000, and after the next refresh goes up to 5,500. I would want that turning green. Value2 might be heading downwards so I would want that turning red.I'd also want to sort by any of these fields.At my old job I did some windows development so I could write a c# app to do this except we run ubuntu and I don't want to have to convince everyone to install wine. Any javascript help would be great.
Poul
A: 

I often use JDBC servlets via Tomcat for this. Here's an excellent tutorial and a very simple example.

trashgod