Skip to content
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.

Commit

Permalink
Various minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
aasseman committed Jun 9, 2021
1 parent e7495e9 commit eeff709
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
# GraphQL stress-test
# indexer-stresstest

To get started complete the following steps below.

### Dependencies
### 1. Dependencies

```sh
$ npm install
```

### Configuration
### 2. Configuration

All the configuration is stored in `config.ts`.

### Save the endpoint's schema
### 3. Save the endpoint's schema

```sh
$ npx ts-node get_schema.ts
```

The default configuration will save the contents in `schema.graphql`.

### Save the endpoint's "providermap" of field IDs
### 4. Save the endpoint's "providermap" of field IDs

```sh
$ npx ts-node get_providermap.ts
Expand All @@ -29,11 +29,11 @@ $ npx ts-node get_providermap.ts
The default configuration will save the contents in `providermap.json`.
Will print a list of the fields to stdout.

### Run the stress-test
### 5. Run the stress-test

```sh
$ npx ts-node stresstest.ts
```

Will continuously generate random queries and print the results to stdout.
The only way to stop it is to kill it.
Will continuously generate random queries and print the results to `stdout`.
Kill the process to stop it.
2 changes: 2 additions & 0 deletions stresstest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ async function stresstest() {
headers: config.HEADERS,
});

gql_client.setHeader('Warning', 'indexer-stresstest')

while (true) {
const [query, vars] = get_rand_query(schema, providermap);
const query_str = print(query);
Expand Down

0 comments on commit eeff709

Please sign in to comment.