class Kishu::Sushi

Public Instance Methods

clean_all() click to toggle source
# File lib/kishu/sushi.rb, line 20
def clean_all
 x =Client.new()
 x.clear_index
 
end
elasticsearch_results() click to toggle source
# File lib/kishu/sushi.rb, line 71
def elasticsearch_results
 es = Client.new()
 es = es.get({aggs_size: 10, after_key: ""})
 puts es.dig("hits","total")
 puts "Aggregations:" + es.fetch("aggregations",[]).first.to_s
end
generate() click to toggle source
# File lib/kishu/sushi.rb, line 47
def generate
 report = Report.new(options)
 report.generate
 file = report.merged_file
 File.open(file,"w") do |f|
   f.write(JSON.pretty_generate report.get_template)
 end
 LOGGER.info  "#{LOGS_TAG} Month of #{report.period.dig("begin-date")} with stats for #{report.total} datasets"
end
push() click to toggle source
# File lib/kishu/sushi.rb, line 62
def push
 fail "You need to set your JWT" if HUB_TOKEN.blank?
 report = Report.new(options)
 report.generate
 report.send_report report.get_template
 LOGGER.info  "#{LOGS_TAG} Month of #{report.period.dig("begin-date")} sent to Hub in report #{report.uid} with stats for #{report.total} datasets"
end
stream() click to toggle source
# File lib/kishu/sushi.rb, line 35
def stream
 fail "You need to set your JWT" if HUB_TOKEN.blank?
 report = Report.new(options)
 report.generate_dataset_array
 LOGGER.info  "#{LOGS_TAG} Month of #{report.period.dig("begin-date")} sent to Hub in report #{report.uid} with stats for #{report.total} datasets"
end