Commit Graph

24 Commits

Author SHA1 Message Date
David Taylor
436b3b392b
DEV: Apply syntax_tree formatting to script/* 2023-01-09 11:13:22 +00:00
Alan Guo Xiang Tan
0da79561c3
DEV: Improve/Fix script/bench.rb (#19646)
1. Fix bug where we were not waiting for all unicorn workers to start up
before running benchmarks.

2. Fix a bug where headers were not used when benchmarking. Admin
benchmarks were basically running as anon user.

3. Disable rate limits when in profile env. We're pretty much going to
hit the rate limit every time as a normal user.

4. Benchmark against topic with a fixed posts count of 100. Previously profiling script was just randomly creating posts
and we would benchmark against a topic with a fixed posts count of 30.
Sometimes, the script fails because no topics with a posts count of 30
exists.

5. Benchmarks are not run against a normal user on top of anon and
admin.

6. Add script option to select tests that should be run.
2022-12-30 07:25:11 +08:00
Sam Saffron
710eafdd35 FIX: ensure we consistently pick the same topic for bench
We pick the first topic with 30 responses as our bench topic.

Previously we simply picked the last topic, but hand no guarantee on ordering.

This also attempts to correct previous runs of the bench.
2020-01-08 16:33:45 +11:00
David Taylor
fd6fbaa4ae DEV: Update bench.rb for core changes (#8670)
- Use new api key rake task
- Switch to header-based API auth
- Stop hard-coding topic id
2020-01-08 16:23:29 +11:00
Krzysztof Kotlarek
1d73754e84 FIX: Modify frozen String and profile_db_generator uses category id (#8080) 2019-09-09 17:38:37 +10:00
Sam Saffron
30990006a9 DEV: enable frozen string literal on all files
This reduces chances of errors where consumers of strings mutate inputs
and reduces memory usage of the app.

Test suite passes now, but there may be some stuff left, so we will run
a few sites on a branch prior to merging
2019-05-13 09:31:32 +08:00
Sam
819d4facda FIX: ruby bench script no longer working
The library used to generate random text changed, this caused the title
of the topic used for testing to change, which meant the slug changed, so
a hit to the topic was a redirect

This fix gives the topic used for performance testing a static name to avoid
this issue in future
2019-03-15 11:31:08 +11:00
Robin Ward
fa5a158683 REFACTOR: Move queue_jobs out of SiteSetting
It is not a setting, and only relevant in specs. The new API is:

```
Jobs.run_later!        # jobs will be thrown on the queue
Jobs.run_immediately!  # jobs will run right away, avoid the queue
```
2019-03-14 10:47:38 -04:00
Sam
a3c7ee09b6 FIX: ruby bench not working properly
- Remove thin which is no longer supported
- Bypass admin api rate limiting in profile environment
- Admin password was too short
- Run by default in concurrency 1 mode
- A skip bundle assets flag to speed up local testing
2018-02-19 11:37:16 +11:00
Guo Xiang Tan
26c6447161 Fix bugs in profiling scripts leading to incorrect results. 2017-09-13 15:33:59 +08:00
Guo Xiang Tan
935afe63f7 Fix profile db generator not seeding. 2017-09-05 11:23:03 +08:00
Guo Xiang Tan
5012d46cbd Add rubocop to our build. (#5004) 2017-07-28 10:20:09 +09:00
Yousuf Jukaku
a940f727cb fix bench script silent minor bugs 2017-04-14 12:58:35 -04:00
Sam
34180eba93 FIX: official benchmark crashing while populating db 2014-11-11 10:28:17 +11:00
Sam
59d04c0695 Internal renaming of elder,leader,regular,basic to numbers
Changed internals so trust levels are referred to with

TrustLevel[1], TrustLevel[2] etc.

This gives us much better flexibility naming trust levels, these names
are meant to be controlled by various communities.
2014-09-05 15:20:52 +10:00
Sam
1c3fc39525 bench improvements 2014-01-09 15:56:03 +11:00
Sam
90a7cb9dc3 FEATURE: add rss to bench
BUGFIX: profile db generator require ordering
2014-01-03 11:51:42 +11:00
Sam
6a0072d36e don't keep installing gabbler from bench
fix ab detection
2014-01-02 10:21:01 +11:00
Régis Hanol
42d9b0ca46 Oopps. Regis doesn't know how to count 2013-09-30 15:12:46 +02:00
Régis Hanol
abe4a19824 fix profile db generator to run even with the system account 2013-09-30 15:10:30 +02:00
Sam
d753cdb2f7 add db population 2013-08-15 16:59:38 +10:00
Sam
1fb160d30f credit where it is due 2013-08-05 14:29:04 +10:00
Sam
2d0ec364db unbundled_require for gabbler 2013-08-05 14:27:19 +10:00
Sam
10b02b1288 Create profile db generator for use when benchmarking a local install http://meta.discourse.org/t/benchmarking-discourse-locally/9070 2013-08-05 07:22:13 +10:00