Stats collector main application.
Executes counting SQL query and returns the result.
The query should return cnt
field, for example, SELECT count(*) AS cnt FROM Users
.
Parameters:
q
SQL query.
Returns:
Result of counting.
inline getMedian (q:String):Float
Returns the median value for values returned by query. The query must use "val" field and be ordered from min to max, for example "SELECT ID AS Val FROM Users ORDER BY Time".
Parameters:
q
Query string.
Returns:
Median value.
getStats (key:String, ?date:String):Float
Returns the statistics value for that key.
Parameters:
key
Statistics key.
date
Statistics date. Will use "'yesterday'" by default. Note that the given string will not be quoted in the query.
Returns:
Statistics value.
inline query (q:String):PostgresResultSet
Executes SQL query in database.
Parameters:
q
SQL query.
Returns:
Database result set.
inline queryTrace (q:String):PostgresResultSet
Executes SQL query in database tracing it.
Parameters:
q
SQL query.
Returns:
Database result set.