From 79936a2b0ec0bda563817912b6365d13d02a248f Mon Sep 17 00:00:00 2001 From: Kristian Garza Date: Fri, 29 Nov 2019 17:38:35 +0100 Subject: [PATCH] remove bentchmark --- app/controllers/events_controller.rb | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/app/controllers/events_controller.rb b/app/controllers/events_controller.rb index c7c2a36ab..f940f283d 100644 --- a/app/controllers/events_controller.rb +++ b/app/controllers/events_controller.rb @@ -125,7 +125,7 @@ def index dois_usage = total.positive? && params[:doi].present? ? EventsQuery.new.usage(params[:doi]) : [] # dois_citations = total.positive? && aggregations.blank? || aggregations.include?("query_aggregations") ? facet_citations_by_year_v1(response.response.aggregations.dois_citations) : nil citations = total.positive? && params[:doi].present? ? EventsQuery.new.citations(params[:doi]) : [] - citations_histogram = params[:doi].present? ? EventsQuery.new.citations_histogram(params[:doi]) : [] + citations_histogram = total.positive? && params[:doi].present? ? EventsQuery.new.citations_histogram(params[:doi]) : [] references = total.positive? && params[:doi].present? && aggregations.include?("citations_aggregations") ? facet_citations_by_dois(response.response.aggregations.references.dois.buckets) : nil relations = total.positive? && params[:doi].present? && aggregations.include?("citations_aggregations") ? facet_citations_by_dois(response.response.aggregations.relations.dois.buckets) : nil @@ -137,18 +137,6 @@ def index unique_obj_count = total.positive? && aggregations.include?("advanced_aggregations") ? response.response.aggregations.unique_obj_count.value : nil unique_subj_count = total.positive? && aggregations.include?("advanced_aggregations") ? response.response.aggregations.unique_subj_count.value : nil - - - bmt = Benchmark.ms { - total.positive? && params[:doi].present? ? EventsQuery.new.citations(params[:doi]) : [] - } - if bmt > 10000 - logger.warn "[Benchmark Warning] citations " + bmt.to_s + " ms" - else - logger.info "[Benchmark] citations " + bmt.to_s + " ms" - end - - results = response.results options = {}