Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def call
- logger = context.logger || Rails.logger
- buckets = get_available_items_in_catalog_by_store
- logger.debug('catalog_stats_reporter') { "There were #{buckets.count} stores with items in the catalog" }
- gauges = buckets.map do |bucket|
- [ 'items_in_elasticsearch', bucket['doc_count'], { store_id: bucket['key'] }]
- end
- # Send store total gauges
- gauges.each_slice(100) do |slice|
- sleep(1) # This is to avoid throttling on SignalFX's side
- sfx_client.set_gauges(slice, synchronous: true)
- end
- # Send orphaned items in ES gauge
- orphaned_items = [ 'orphaned_items_in_elasticsearch', get_orphaned_items_total]
- sfx_client.set_gauges(orphaned_items, synchronous: true)
- end
Add Comment
Please, Sign In to add comment