Class: Metrics::SampleMetricsService

Inherits:
Object
  • Object
show all
Defined in:
app/services/metrics/sample_metrics_service.rb

Constant Summary collapse

DIRECTORY =
"sample_metrics"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(identifier, range_start:, range_end:) ⇒ SampleMetricsService

Returns a new instance of SampleMetricsService.


9
10
11
12
# File 'app/services/metrics/sample_metrics_service.rb', line 9

def initialize(identifier, range_start:, range_end:)
  @identifier = identifier
  @range_minutes = convert_range_minutes(range_start, range_end)
end

Instance Attribute Details

#identifierObject (readonly)

Returns the value of attribute identifier


7
8
9
# File 'app/services/metrics/sample_metrics_service.rb', line 7

def identifier
  @identifier
end

#range_minutesObject (readonly)

Returns the value of attribute range_minutes


7
8
9
# File 'app/services/metrics/sample_metrics_service.rb', line 7

def range_minutes
  @range_minutes
end

Instance Method Details

#queryObject


14
15
16
17
18
# File 'app/services/metrics/sample_metrics_service.rb', line 14

def query
  return unless identifier && File.exist?(file_location)

  query_interval
end