Skip to content

Commit

Permalink
remove bentchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
kjgarza committed Nov 29, 2019
1 parent 597f535 commit 79936a2
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions app/controllers/events_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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 = {}
Expand Down

0 comments on commit 79936a2

Please sign in to comment.