Skip to content

Commit

Permalink
separate off code to limit maximum concurrent opened table count
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryo Onodera authored and Ryo Onodera committed Nov 26, 2010
1 parent 989c84d commit 683b385
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions examples/groonga.rb
Expand Up @@ -85,13 +85,21 @@ def random_column
end
end

class CreateTable < StressTest::Action
MAXIMUM_TABLE_COUNT = 1000
module MaximumTableCount
MAXIMUM_TABLE_COUNT = 1000 # XXX State should have this.

def arguments
def check_maximum_table_count
if @state.opened_table_count > MAXIMUM_TABLE_COUNT
raise StressTest::Error::BadRoute
end
end
end

class CreateTable < StressTest::Action
include MaximumTableCount

def arguments
check_maximum_table_count

["Table#{time_stamp}"]
end
Expand Down

0 comments on commit 683b385

Please sign in to comment.