Class: Burden::Statistics

Inherits:
Object
  • Object
show all
Defined in:
lib/burden/statistics.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params) ⇒ Statistics

Returns a new instance of Statistics.



5
6
7
8
9
10
# File 'lib/burden/statistics.rb', line 5

def initialize(params)
  @name = params[:name]
  @success = params[:success]
  @execution_time = params[:execution_time]
  @timestamp = params[:timestamp]
end

Instance Attribute Details

#execution_timeObject (readonly)

Returns the value of attribute execution_time.



3
4
5
# File 'lib/burden/statistics.rb', line 3

def execution_time
  @execution_time
end

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/burden/statistics.rb', line 3

def name
  @name
end

#successObject (readonly)

Returns the value of attribute success.



3
4
5
# File 'lib/burden/statistics.rb', line 3

def success
  @success
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



3
4
5
# File 'lib/burden/statistics.rb', line 3

def timestamp
  @timestamp
end

Instance Method Details

#saveObject



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/burden/statistics.rb', line 12

def save
  # FIXME
  # if Burden.storage.ready?
  #   Burden.storage.runs.create(name: name, success: success, execution_time: execution_time, timestamp: timestamp)
  # end

  File.open(Burden.config.log_file, 'a') do |f|
    f.write(log_message)
    f.close
  end
end