Movatterモバイル変換


[0]ホーム

URL:


Skip to content
Search Gists
Sign in Sign up

Instantly share code, notes, and snippets.

@keating
CreatedJanuary 12, 2013 09:31
    • Star(0)You must be signed in to star a gist
    • Fork(0)You must be signed in to fork a gist
    Save keating/4516928 to your computer and use it in GitHub Desktop.

    Revisions

    1. keating created this gistJan 12, 2013.
      3 changes: 3 additions & 0 deletionscpu.rb
      View file
      Original file line numberDiff line numberDiff line change
      @@ -0,0 +1,3 @@
      2.times.map{
      Thread.new{whiletruedoend}
      }.each(&:join)
      15 changes: 15 additions & 0 deletionsquery.rb
      View file
      Original file line numberDiff line numberDiff line change
      @@ -0,0 +1,15 @@
      # encoding: utf-8
      require'mechanize'

      agent=Mechanize.new
      page=agent.get('http://localhost:3000/login')

      form=page.forms[0]
      form["user_session[login]"]="user_cy"
      form["user_session[password]"]="user_cy_pw"
      form.submit

      100.times.eachdo |i|
      putsi
      page=agent.get('http://localhost:3000/cy_maps?query=true')
      end
      9 changes: 9 additions & 0 deletionsspeed.rb
      View file
      Original file line numberDiff line numberDiff line change
      @@ -0,0 +1,9 @@
      require'benchmark'
      require"open-uri"

      loop{
      putsBenchmark.measure{
      html=open("http://localhost:3000",:read_timeout=>1).read
      }
      sleep1
      }

    [8]ページ先頭

    ©2009-2025 Movatter.jp