display the amount of time taken to invoke a scaffolding request

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1044 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
Leon Breedt
2005-03-31 10:47:01 +00:00
parent 0f198eb58e
commit 0de97c81db
2 changed files with 13 additions and 5 deletions

View File

@@ -1,5 +1,6 @@
require 'ostruct'
require 'uri'
require 'benchmark'
module ActionWebService
module Scaffolding # :nodoc:
@@ -62,12 +63,15 @@ module ActionWebService
when :xmlrpc
protocol = Protocol::XmlRpc::XmlRpcProtocol.new
end
@method_request_xml = @scaffold_method.encode_rpc_call(protocol.marshaler, protocol.encoder, @params['method_params'].dup)
cgi = @request.cgi
@request = protocol.create_action_pack_request(@scaffold_service.name, @scaffold_method.public_name, @method_request_xml)
dispatch_web_service_request
@method_response_xml = @response.body
@method_return_value = protocol.marshaler.unmarshal(protocol.encoder.decode_rpc_response(@method_response_xml)[1]).value
bm = Benchmark.measure do
@method_request_xml = @scaffold_method.encode_rpc_call(protocol.marshaler, protocol.encoder, @params['method_params'].dup)
@request = protocol.create_action_pack_request(@scaffold_service.name, @scaffold_method.public_name, @method_request_xml)
dispatch_web_service_request
@method_response_xml = @response.body
@method_return_value = protocol.marshaler.unmarshal(protocol.encoder.decode_rpc_response(@method_response_xml)[1]).value
end
@method_elapsed = bm.real
add_instance_variables_to_assigns
@response = ::ActionController::CgiResponse.new(cgi)
@performed_render = false

View File

@@ -1,5 +1,9 @@
<h4>Method Invocation Result for <em><%= @scaffold_service %>#<%= @scaffold_method.public_name %></em></h4>
<p>
Invocation took <tt><%= '%f' % @method_elapsed %></tt> seconds
</p>
<p>
<strong>Return Value:</strong><br />
<pre>