Top Level Namespace

Defined Under Namespace

Modules: Benchmark, RequestHelper, RubybenchRunner Classes: BenchmarkApp, Category, CategoryUser, EchoChannel, NullLogger, Post, Router, Topic, TopicUser, User

Constant Summary collapse

STRING_COLUMNS_COUNT =
25

Instance Method Summary collapse

Instance Method Details

#archetype(i) ⇒ Object

Helpers



94
95
96
97
98
99
100
# File 'lib/rubybench_runner/support/setup/bm_discourse_setup.rb', line 94

def archetype(i)
  if i % 4 == 0
    "not_private_message"
  else
    "private_message"
  end
end

#bumped_at(i, user_id) ⇒ Object



102
103
104
# File 'lib/rubybench_runner/support/setup/bm_discourse_setup.rb', line 102

def bumped_at(i, user_id)
  Time.at(50000 + i + user_id)
end

#cleared_pinned_at(topic) ⇒ Object



126
127
128
129
130
# File 'lib/rubybench_runner/support/setup/bm_discourse_setup.rb', line 126

def cleared_pinned_at(topic)
  if topic.pinned_at
    topic.pinned_at + 5
  end
end

#db_adapterObject



3
4
5
# File 'lib/rubybench_runner/support/helpers.rb', line 3

def db_adapter
  ENV['DATABASE_URL'].split(":")[0]
end

#db_setup(script:) ⇒ Object



7
8
9
10
11
# File 'lib/rubybench_runner/support/helpers.rb', line 7

def db_setup(script:)
  Dir.chdir("../../support/setup") do
    `DATABASE_URL=#{ENV.fetch("DATABASE_URL")} BUNDLE_GEMFILE=Gemfile ruby #{script}`
  end
end

#deleted_at(i, user_id) ⇒ Object



106
107
108
109
110
# File 'lib/rubybench_runner/support/setup/bm_discourse_setup.rb', line 106

def deleted_at(i, user_id)
  if i % 3 == 0
    Time.at(100000 + i + user_id)
  end
end

#notification_level(i) ⇒ Object



122
123
124
# File 'lib/rubybench_runner/support/setup/bm_discourse_setup.rb', line 122

def notification_level(i)
  i % 2 == 0 ? 1 : 0
end

#pinned_at(i, user_id) ⇒ Object



116
117
118
119
120
# File 'lib/rubybench_runner/support/setup/bm_discourse_setup.rb', line 116

def pinned_at(i, user_id)
  if i % 2 == 0
    Time.at(1000 + i + user_id)
  end
end

#pinned_globally(i) ⇒ Object



112
113
114
# File 'lib/rubybench_runner/support/setup/bm_discourse_setup.rb', line 112

def pinned_globally(i)
  i % 2 == 0
end