Module: Smith::Doctor::Checks::Configuration

Defined in:
lib/smith/doctor/checks/configuration.rb

Class Method Summary collapse

Class Method Details

.check_artifact_store(report) ⇒ Object



24
25
26
27
28
29
30
31
32
# File 'lib/smith/doctor/checks/configuration.rb', line 24

def self.check_artifact_store(report)
  configured = !::Smith.config.artifact_store.nil?
  report.add(
    name: "config.artifact_store",
    status: configured ? :pass : :warn,
    message: configured ? "Artifact store configured" : "No artifact store configured",
    detail: configured ? nil : "Large outputs will use in-memory default"
  )
end

.check_logger(report) ⇒ Object



14
15
16
17
18
19
20
21
22
# File 'lib/smith/doctor/checks/configuration.rb', line 14

def self.check_logger(report)
  configured = !::Smith.config.logger.nil?
  report.add(
    name: "config.logger",
    status: configured ? :pass : :warn,
    message: configured ? "Logger configured" : "No logger configured",
    detail: configured ? nil : "Set config.logger for Smith runtime logging"
  )
end

.check_pricing(report) ⇒ Object



44
45
46
47
48
49
50
51
52
# File 'lib/smith/doctor/checks/configuration.rb', line 44

def self.check_pricing(report)
  configured = ::Smith.config.pricing.is_a?(Hash) && !::Smith.config.pricing.empty?
  report.add(
    name: "config.pricing",
    status: configured ? :pass : :warn,
    message: configured ? "Pricing configured" : "No pricing configured",
    detail: configured ? nil : "RunResult.total_cost will be 0.0"
  )
end

.check_trace_adapter(report) ⇒ Object



34
35
36
37
38
39
40
41
42
# File 'lib/smith/doctor/checks/configuration.rb', line 34

def self.check_trace_adapter(report)
  configured = !::Smith.config.trace_adapter.nil?
  report.add(
    name: "config.trace_adapter",
    status: configured ? :pass : :warn,
    message: configured ? "Trace adapter configured" : "No trace adapter configured",
    detail: configured ? nil : "Traces will be discarded"
  )
end

.run(report) ⇒ Object



7
8
9
10
11
12
# File 'lib/smith/doctor/checks/configuration.rb', line 7

def self.run(report)
  check_logger(report)
  check_artifact_store(report)
  check_trace_adapter(report)
  check_pricing(report)
end