class ApacheCrunch::ProcedureEnvironment

The environment in which a procedure file is evaluated.

A procedure file is some ruby code that uses our DSL.

Public Class Methods

new(log_parser) click to toggle source
# File lib/procedure_dsl.rb, line 276
def initialize(log_parser)
    @_log_parser = log_parser
end

Public Instance Methods

confidence_interval(confidence, &blk) click to toggle source

DSL routine ‘confidence_interval’

# File lib/procedure_dsl.rb, line 350
def confidence_interval(confidence, &blk)
    routine = ConfidenceInterval.new(@_log_parser)
    rv = routine.execute(confidence, &blk)
    routine.finish
    rv
end
count_by(&blk) click to toggle source

DSL routine ‘count_by’

# File lib/procedure_dsl.rb, line 326
def count_by(&blk)
    routine = CountBy.new(@_log_parser)
    rv = routine.execute(&blk)
    routine.finish
    rv
end
count_where(&blk) click to toggle source

DSL routine ‘count_where’

# File lib/procedure_dsl.rb, line 286
def count_where(&blk)
    routine = CountWhere.new(@_log_parser)
    rv = routine.execute(&blk)
    routine.finish
    rv
end
distribution(bucket_width, &blk) click to toggle source

DSL routine ‘distribution’

# File lib/procedure_dsl.rb, line 334
def distribution(bucket_width, &blk)
    routine = Distribution.new(@_log_parser)
    rv = routine.execute(bucket_width, &blk)
    routine.finish
    rv
end
each(&blk) click to toggle source

DSL routine ‘each’

# File lib/procedure_dsl.rb, line 310
def each(&blk)
    routine = Each.new(@_log_parser)
    routine.execute(&blk)
    routine.finish
    nil
end
eval_procedure(proc_string) click to toggle source

Evaluates the given string as a procedure in our DSL

# File lib/procedure_dsl.rb, line 281
def eval_procedure(proc_string)
    eval proc_string
end
filter(target_path=nil, &blk) click to toggle source

DSL routine ‘filter’

# File lib/procedure_dsl.rb, line 302
def filter(target_path=nil, &blk)
    routine = Filter.new(@_log_parser)
    routine.execute(target_path, &blk)
    routine.finish
    nil
end
filter!(&blk) click to toggle source

DSL routine ‘filter!’

# File lib/procedure_dsl.rb, line 294
def filter!(&blk)
    routine = Filter.new(@_log_parser)
    routine.execute(nil, true, &blk)
    routine.finish
    nil
end
log_distribution(width_base, &blk) click to toggle source

DSL routine ‘log_distribution’

# File lib/procedure_dsl.rb, line 342
def log_distribution(width_base, &blk)
    routine = LogDistribution.new(@_log_parser)
    rv = routine.execute(width_base, &blk)
    routine.finish
    rv
end
most_common(n, &blk) click to toggle source

DSL routine ‘most_common’

# File lib/procedure_dsl.rb, line 366
def most_common(n, &blk)
    routine = MostCommon.new(@_log_parser)
    rv = routine.execute(n, &blk)
    routine.finish
    rv
end
percentile(n, &blk) click to toggle source

DSL routine ‘percentile’

# File lib/procedure_dsl.rb, line 358
def percentile(n, &blk)
    routine = Percentile.new(@_log_parser)
    rv = routine.execute(n, &blk)
    routine.finish
    rv
end
sum(&blk) click to toggle source

DSL routine ‘sum’

# File lib/procedure_dsl.rb, line 318
def sum(&blk)
    routine = Sum.new(@_log_parser)
    rv = routine.execute(&blk)
    routine.finish
    rv
end