spec/benchmark/search_bench.rb in Active-0.0.32 vs spec/benchmark/search_bench.rb in Active-0.0.34

- old
+ new

@@ -1,6 +1,5 @@ -require 'rubygems' require File.expand_path(File.join(File.dirname(__FILE__), %w[.. .. lib Active])) include Active::Services # Benchmark.bm(700) do |x| # x.report("string:") { Search.new({:keywords => "running,swimming,yoga"}) } @@ -23,6 +22,25 @@ # puts " " # puts " " # puts " " # puts arr -puts Search.search(:asset_ids => ["DD8F427F-6188-465B-8C26-71BBA22D2DB7"]).results.inspect +# puts Search.search(:asset_ids => ["DD8F427F-6188-465B-8C26-71BBA22D2DB7"]).results.inspect + +REG_CENTER_ASSET_TYPE_ID = "EA4E860A-9DCD-4DAA-A7CA-4A77AD194F65" +REG_CENTER_ASSET_TYPE_ID2 = "3BF82BBE-CF88-4E8C-A56F-78F5CE87E4C6" +ACTIVE_WORKS_ASSET_TYPE_ID = "DFAA997A-D591-44CA-9FB7-BF4A4C8984F1" + +local_asset_type_id = "EC6E96A5-6900-4A0E-8B83-9AA935F45A73" +puts "Local " + Search.search({:asset_type_id => local_asset_type_id}).results.length.to_s +puts "Local " + Search.search({:asset_type_id => local_asset_type_id, :start_date => Date.new(2010, 1, 1), :end_date => Date.new(2011, 11, 15) }).results.length.to_s +# puts "ActiveWorks " + Search.search({:asset_type_id => ACTIVE_WORKS_ASSET_TYPE_ID, :start_date => Date.new(2010, 1, 1), :end_date => Date.new(2011, 11, 15) }).results.length.to_s + +# url = "www.active.com/running/long-branch-nj/new-jersey-marathon-and-long-branch-half-marathon-2011" +# r = Search.search({:url => url}).results # , :start_date => Date.new(2011, 1, 1), :end_date => Date.new(2012, 1, 15) +# puts url +# puts "Results: #{r.length}" +# puts r.map(&:url) + + +# r = Search.search({:dma=>"San Francisco - Oakland - San Jose", :num_results => 5}).results +# puts r.map(&:url) \ No newline at end of file