Minor cleanup in the query-times scanner.

This commit is contained in:
j2blake 2014-09-29 14:43:05 -04:00
parent 337c6b4c8b
commit 61fcd6f37b
3 changed files with 8 additions and 3 deletions

View file

@ -3,6 +3,7 @@ class Criterion
attr_accessor :count
attr_accessor :total_time
def initialize(expr)
expr = expr.gsub(/\s+/, ' ')
@expression = Regexp.new(expr, Regexp::MULTILINE)
@count = 0
@total_time = 0.0
@ -14,7 +15,7 @@ class Criterion
end
def to_s()
"#{self.class}: count=#{@count}, total_time=#{format("%.3f", @total_time)}, expression='#{@expression}'"
format("%19s: count=%5d, total_time=%9.3f, expression='%s'", self.class, @count, @total_time, @expression)
end
end

View file

@ -9,7 +9,11 @@ list of partitioning expressions.
2) The log file is scanned for records from the RDFServiceLogger, which are
accumulated in the program storage.
3) The partitioning expressions are tested against each log record, and matches
are recorded.
are recorded.
Strings of white space are treated as single spaces, both in the
partitioning expressions and in the log records. This makes the
expressions easier to read, both in the partitions file and in the program
output.
4) For each partioning expression, report:
a) the expression
b) how many queries matched it

View file

@ -36,7 +36,7 @@ class LogFileParser
log_record = LogRecord.new
log_record.time = match[1].to_f
log_record.query = match[3].strip
log_record.query = match[3].strip.gsub(/\s+/, ' ')
log_record.stack = []
return log_record
end