Class: SourceMonitor::Configuration::ScrapingSettings

Inherits:
Object
  • Object
show all
Defined in:
lib/source_monitor/configuration/scraping_settings.rb

Constant Summary collapse

DEFAULT_MAX_IN_FLIGHT =
nil
DEFAULT_MAX_BULK_BATCH_SIZE =
100
DEFAULT_MIN_SCRAPE_INTERVAL =
1.0
DEFAULT_SCRAPE_RECOMMENDATION_THRESHOLD =
200

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeScrapingSettings

Returns a new instance of ScrapingSettings.



14
15
16
# File 'lib/source_monitor/configuration/scraping_settings.rb', line 14

def initialize
  reset!
end

Instance Attribute Details

#max_bulk_batch_sizeObject

Returns the value of attribute max_bulk_batch_size.



6
7
8
# File 'lib/source_monitor/configuration/scraping_settings.rb', line 6

def max_bulk_batch_size
  @max_bulk_batch_size
end

#max_in_flight_per_sourceObject

Returns the value of attribute max_in_flight_per_source.



6
7
8
# File 'lib/source_monitor/configuration/scraping_settings.rb', line 6

def max_in_flight_per_source
  @max_in_flight_per_source
end

#min_scrape_intervalObject

Returns the value of attribute min_scrape_interval.



6
7
8
# File 'lib/source_monitor/configuration/scraping_settings.rb', line 6

def min_scrape_interval
  @min_scrape_interval
end

#scrape_recommendation_thresholdObject

Returns the value of attribute scrape_recommendation_threshold.



6
7
8
# File 'lib/source_monitor/configuration/scraping_settings.rb', line 6

def scrape_recommendation_threshold
  @scrape_recommendation_threshold
end

Instance Method Details

#reset!Object



18
19
20
21
22
23
# File 'lib/source_monitor/configuration/scraping_settings.rb', line 18

def reset!
  @max_in_flight_per_source = DEFAULT_MAX_IN_FLIGHT
  @max_bulk_batch_size = DEFAULT_MAX_BULK_BATCH_SIZE
  @min_scrape_interval = DEFAULT_MIN_SCRAPE_INTERVAL
  @scrape_recommendation_threshold = DEFAULT_SCRAPE_RECOMMENDATION_THRESHOLD
end