Class: FastExists::Intelligence::DataModel

Inherits:
Object
  • Object
show all
Defined in:
lib/fast_exists/intelligence/data_model.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeDataModel

Returns a new instance of DataModel.



17
18
19
20
21
22
23
24
25
26
# File 'lib/fast_exists/intelligence/data_model.rb', line 17

def initialize
  @timestamp = Time.now.utc.iso8601
  @uptime = (FastExists.uptime rescue 0)
  @environment = collect_environment_info
  @stats = FastExists.stats
  @health = {}
  @analysis = {}
  @audit = {}
  @doctor = {}
end

Instance Attribute Details

#analysisObject

Returns the value of attribute analysis.



8
9
10
# File 'lib/fast_exists/intelligence/data_model.rb', line 8

def analysis
  @analysis
end

#auditObject

Returns the value of attribute audit.



8
9
10
# File 'lib/fast_exists/intelligence/data_model.rb', line 8

def audit
  @audit
end

#doctorObject

Returns the value of attribute doctor.



8
9
10
# File 'lib/fast_exists/intelligence/data_model.rb', line 8

def doctor
  @doctor
end

#environmentObject

Returns the value of attribute environment.



8
9
10
# File 'lib/fast_exists/intelligence/data_model.rb', line 8

def environment
  @environment
end

#healthObject

Returns the value of attribute health.



8
9
10
# File 'lib/fast_exists/intelligence/data_model.rb', line 8

def health
  @health
end

#statsObject

Returns the value of attribute stats.



8
9
10
# File 'lib/fast_exists/intelligence/data_model.rb', line 8

def stats
  @stats
end

#timestampObject

Returns the value of attribute timestamp.



8
9
10
# File 'lib/fast_exists/intelligence/data_model.rb', line 8

def timestamp
  @timestamp
end

#uptimeObject

Returns the value of attribute uptime.



8
9
10
# File 'lib/fast_exists/intelligence/data_model.rb', line 8

def uptime
  @uptime
end

Instance Method Details

#to_hObject



28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/fast_exists/intelligence/data_model.rb', line 28

def to_h
  {
    timestamp: @timestamp,
    uptime: @uptime,
    environment: @environment,
    stats: @stats,
    health: @health,
    analysis: @analysis,
    audit: @audit,
    doctor: @doctor
  }
end