Skip to content

Commit

Permalink
basic timing pept2data
Browse files Browse the repository at this point in the history
  • Loading branch information
tibvdm committed Jun 18, 2024
1 parent f46b3ff commit 5eecb4c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions app/controllers/mpa/pept2data_controller.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
class Mpa::Pept2dataController < Mpa::MpaController
include SuffixArrayHelper

def get_time
Process.clock_gettime(Process::CLOCK_MONOTONIC, :millisecond)
end

def pept2data
start = get_time

peptides = params[:peptides] || []
missed = params[:missed].nil? ? false : params[:missed]
equate_il = params[:equate_il].nil? ? true : params[:equate_il]
Expand All @@ -26,5 +32,8 @@ def pept2data
Lineage.find(taxa).each do |lineage|
@lineages[lineage.taxon_id] = lineage.to_a_idx
end

@timings = Hash.new
@timings["total"] = get_time - start
end
end
1 change: 1 addition & 0 deletions app/views/mpa/pept2data/pept2data.json.jbuilder
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ json.peptides @response do |peptide|
json.data peptide["fa"]["data"]
end
end
json.timings @timings

0 comments on commit 5eecb4c

Please sign in to comment.