Skip to content

Commit

Permalink
add benchmark component and route, refs steemit#2269
Browse files Browse the repository at this point in the history
This commit adds a page at /benchmark that wrk or similar can be pointed
at. When condenser is run with the appropriate offline SSR flag no
external calls will be made and therefore an accurate picture of SSR CPU
usage bottlenecks can be made before and after any changes.
  • Loading branch information
gl2748 committed Jan 30, 2018
1 parent 57946d0 commit ec326c6
Show file tree
Hide file tree
Showing 10 changed files with 43,339 additions and 27 deletions.
45 changes: 20 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,28 +167,6 @@ cd src/db
yarn exec sequelize db:migrate
```

#### Install Tarantool - Production Only

Tarantool similarly to mysql is not required for development but if you're running a full-fledged site with condenser you will want to run one.

OS X:

```bash
brew install tarantool
```

Debian based Linux:

```bash
sudo apt-get install tarantool
```

Test the interactive console:

```bash
user@example:~$ tarantool
```

#### Style Guides For Submitting Pull Requests

##### File naming and location
Expand All @@ -199,10 +177,8 @@ user@example:~$ tarantool
- Component's stylesheet file name should match component name

##### Js & Jsx
We are using _[Airbnb JavaScript Style Guide](https://github.com/airbnb/javascript)_ with some modifications (see .eslintrc).
Please run _eslint_ in the working directory before committing your changes and make sure you didn't introduce any new styling issues.

We use prettier to autofromat the code. Run `yarn run fmt` to format everything in `src/`, or `yarn exec -- prettier --config .prettierrc --write src/whatever/file.js` for a specific file.
We use [prettier](https://github.com/prettier/prettier) to autofromat the code, with [this configuration](.prettierrc). Run `yarn run fmt` to format everything in `src/`, or `yarn exec -- prettier --config .prettierrc --write src/whatever/file.js` for a specific file.

##### CSS & SCSS
If a component requires a css rule, please use its uppercase name for the class, e.g. "Header" class for the header's root div.
Expand All @@ -219,6 +195,25 @@ We adhere to BEM methodology with exception for Foundation classes, here is an e
</ul>
```

## Testing

### Run test suite

`yarn test`

will run `jest`

### Test endpoints offline

If you want to test a server-side rendered page without using the network, do this:

```
yarn build
OFFLINE_SSR_TEST=true SDC_DATABASE_URL="mysql://[email protected]/steemit_dev" NODE_ENV=production node --prof lib/server/index.js
```

This will read data from the blobs in `api_mockdata` directory. If you want to use another set of mock data, create a similar directory to that one and add an argument `OFFLINE_SSR_TEST_DATA_DIR` pointing to your new directory.

## Issues

To report a non-critical issue, please file an issue on this GitHub project.
Expand Down
Loading

0 comments on commit ec326c6

Please sign in to comment.