Class: Perfer::Job

Inherits:
Object
  • Object
show all
Defined in:
lib/perfer/job.rb

Direct Known Subclasses

InputSizeJob, IterationJob

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(session, title, &block) ⇒ Job

Returns a new instance of Job.



4
5
6
7
8
# File 'lib/perfer/job.rb', line 4

def initialize(session, title, &block)
  @session = session
  @title = title
  @block = block
end

Instance Attribute Details

#metadataObject (readonly)

Returns the value of attribute metadata.



3
4
5
# File 'lib/perfer/job.rb', line 3

def 
  @metadata
end

#sessionObject (readonly)

Returns the value of attribute session.



3
4
5
# File 'lib/perfer/job.rb', line 3

def session
  @session
end

#titleObject (readonly)

Returns the value of attribute title.



3
4
5
# File 'lib/perfer/job.rb', line 3

def title
  @title
end

Instance Method Details

#load_metadataObject



10
11
12
13
14
# File 'lib/perfer/job.rb', line 10

def 
  @metadata = @session..merge(:job => @title)
  @metadata.merge!(@session.) if @session.
  @metadata.freeze
end

#minimal_timeObject



20
21
22
# File 'lib/perfer/job.rb', line 20

def minimal_time
  Perfer.configuration.minimal_time
end

#number_of_measurementsObject



24
25
26
# File 'lib/perfer/job.rb', line 24

def number_of_measurements
  Perfer.configuration.measurements
end

#resultsObject



16
17
18
# File 'lib/perfer/job.rb', line 16

def results
  @session.results.select { |result| result[:job] == @title }
end

#runObject



32
33
34
# File 'lib/perfer/job.rb', line 32

def run
  @session.current_job = self
end

#verboseObject



28
29
30
# File 'lib/perfer/job.rb', line 28

def verbose
  Perfer.configuration.verbose
end