Script execution
This commit is contained in:
@@ -3,8 +3,7 @@ import java.sql.ResultSet as ResultSet
|
||||
import java.util.Properties as Properties
|
||||
|
||||
stmt = None
|
||||
STAT_COLUMNS = ["Command","Args","Source","Start","End","Background","Result","Return"]
|
||||
|
||||
STAT_COLUMN_NAMES = ["Command","Args","Source","Start","End","Background","Result","Return"]
|
||||
def get_stats_connection():
|
||||
global stmt
|
||||
Class.forName("org.relique.jdbc.csv.CsvDriver");
|
||||
@@ -73,12 +72,12 @@ def get_errors(command = "%", start = None, end = None):
|
||||
def get_cmd_info(command = "%", start = None, end = None):
|
||||
sql = "SELECT * FROM . WHERE Command LIKE '"+ command +"'"
|
||||
sql = _add_sql_time(sql, start, end)
|
||||
print sql
|
||||
results = stmt.executeQuery(sql)
|
||||
ret = []
|
||||
while results.next():
|
||||
print "X"
|
||||
rec={}
|
||||
for col in STAT_COLUMNS:
|
||||
for col in STAT_COLUMN_NAMES:
|
||||
rec[col]= results.getString(col)
|
||||
ret.append(rec)
|
||||
return ret
|
||||
@@ -128,12 +127,12 @@ def print_cmd_stats(command = "%", start = None, end = None):
|
||||
|
||||
def print_cmd_info(command = "%", start = None, end = None):
|
||||
info = get_cmd_info(command, start, end)
|
||||
for col in STAT_COLUMNS:
|
||||
for col in STAT_COLUMN_NAMES:
|
||||
print col,
|
||||
print
|
||||
for cmd in info:
|
||||
for col in STAT_COLUMNS:
|
||||
print cmd[col],
|
||||
for col in STAT_COLUMN_NAMES:
|
||||
print cmd[col].strip(),
|
||||
print
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user