class Mach5::Benchmark

Public Class Methods

new(memory, tags) click to toggle source
# File lib/mach5-tools/benchmark.rb, line 3
def initialize(memory, tags)
  @memory = memory
  @tags = tags
end

Public Instance Methods

[](commit_id) click to toggle source
# File lib/mach5-tools/benchmark.rb, line 8
def [](commit_id)
  benchmarks = @memory[commit_id]
  if benchmarks
    benchmarks
  else
    @memory[@tags[commit_id]]
  end
end
add(commit_id, value) click to toggle source
# File lib/mach5-tools/benchmark.rb, line 17
def add(commit_id, value)
  @memory[commit_id] ||= []
  @memory[commit_id] << value
end
commits() click to toggle source
# File lib/mach5-tools/benchmark.rb, line 26
def commits
  @memory.keys
end
has_tag?(commit_id) click to toggle source
# File lib/mach5-tools/benchmark.rb, line 34
def has_tag?(commit_id)
  @tags.invert[commit_id]
end
tag(commit_id, tag_name) click to toggle source
# File lib/mach5-tools/benchmark.rb, line 22
def tag(commit_id, tag_name)
  @tags[tag_name] = commit_id
end
tagged() click to toggle source
# File lib/mach5-tools/benchmark.rb, line 30
def tagged
  @tags
end