Skip to content

Commit

Permalink
Add skills to large_model
Browse files Browse the repository at this point in the history
  • Loading branch information
Braktar committed Aug 26, 2020
1 parent 1f0b141 commit 42b5cf5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions benchmark/large_model.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def self.vrp_request_vehicle(this)
this.optional(:cost_time_multiplier, type: Float)

this.optional :router_dimension, type: String, values: %w[time distance]
this.optional(:skills, type: Array[Array[String]])
this.optional(:skills, type: Array[Array[String]], coerce_with: ->(val) { val.is_a?(String) ? [val.split(/,/).map(&:strip)] : val })

this.optional(:unavailable_work_day_indices, type: Array[Integer])

Expand Down Expand Up @@ -224,7 +224,10 @@ def self.vrp_request_schedule(this)
end
end
post '/' do
'hello'
{
skills_v1: params[:vrp][:vehicles].first[:skills],
skills_v2: params[:vrp][:vehicles].last[:skills]
}
end
end
puts Grape::VERSION
Expand All @@ -238,7 +241,8 @@ def self.vrp_request_schedule(this)

start = Time.now
result = RubyProf.profile do
API.call env
response = API.call env
puts response.last
end
puts Time.now - start
printer = RubyProf::FlatPrinter.new(result)
Expand Down
2 changes: 1 addition & 1 deletion benchmark/resource/vrp_example.json

Large diffs are not rendered by default.

0 comments on commit 42b5cf5

Please sign in to comment.