<commit_before>[![CircleCI](https://circleci.com/gh/BuoyantIO/strest-grpc.svg?style=shield)](https://circleci.com/gh/BuoyantIO/strest-grpc)

# strest-grpc

Strest client and server implementations for gRPC.

## Running Locally

To run the client and server locally, first start the server.

```
$ go run server/main.go
starting gRPC server on :11111
```

Next run the client. By default, the client will send as many request as it can
on a single connection for 10 seconds, and exit with a performance report.

```
$ go run client/main.go --address localhost:11111
2017-05-12T16:17:40-07:00  98.2KB    354/0 10s L:   0 [ 89  97 ]  102 J:   0   0
{
  "good": 354,
  "bad": 0,
  "bytes": 100556,
  "latency": {
    "50": 10,
    "95": 89,
    "99": 97,
    "999": 102
  },
  "jitter": {
    "50": 0,
    "95": 0,
    "99": 0,
    "999": 0
  }
}
```

### Flags

Use the `-help` flag with either the client or server to see a list of flags.

## Building

To build the client and server binaries, run:

```
./bin/release.sh
```
<commit_msg>Adds a table of command line flags for the client. (#14)<commit_after>[![CircleCI](https://circleci.com/gh/BuoyantIO/strest-grpc.svg?style=shield)](https://circleci.com/gh/BuoyantIO/strest-grpc)

# strest-grpc

Strest client and server implementations for gRPC.

## Running Locally

To run the client and server locally, first start the server.

```
$ go run server/main.go
starting gRPC server on :11111
```

Next run the client. By default, the client will send as many request as it can
on a single connection for 10 seconds, and exit with a performance report.

```
$ go run client/main.go --address localhost:11111
2017-05-12T16:17:40-07:00  98.2KB    354/0 10s L:   0 [ 89  97 ]  102 J:   0   0
{
  "good": 354,
  "bad": 0,
  "bytes": 100556,
  "latency": {
    "50": 10,
    "95": 89,
    "99": 97,
    "999": 102
  },
  "jitter": {
    "50": 0,
    "95": 0,
    "99": 0,
    "999": 0
  }
}
```

### Flags

Use the `-help` flag with either the client or server to see a list of flags.

| Flag                  | Default   | Description |
|-----------------------|-----------|-------------|
| `-address`            | `localhost:11111` | hostname:port of strest-grpc service or intermediary. |
| `-qps`                | `1`       | QPS to send to backends per request thread. |
| `-concurrency`        | `1`       | Number of goroutines to run, each at the specified QPS level. Measure total QPS as `qps * concurrency`. |
| `-interval`           | `10s`     | How often to report stats to stdout. |
| `-totalRequests`      | `<none>`  | Exit after sending this many requests. |
| `-metric-addr`        | `<none>`  | Address to use when serving the Prometheus `/metrics` endpoint. No metrics are served if unset. Format is `host:port` or `:port`. |
| `-noFinalReport`      | `<unset>` | If set, don't print the json latency report at the end. |
| `-noIntervalReport`   | `<unset>` | If set, only print the final report, nothing intermediate. |
| `-latencyPercentiles` | `50=10,100=100` | response latency percentile distribution in milliseconds. |
| `-lengthPercentiles`  | `50=100,100=1000` | response body length percentile. |
| `-streaming`          | `<unset>` | response is a gRPC stream from the strest server. |
| `-streamingRatio`     | `1:1`     | the ratio of streaming requests/responses if streaming is enabled. |
| `-help`               | `<unset>` | If set, print all available flags and exit. |

## Building

To build the client and server binaries, run:

```
./bin/release.sh
```

{'fraction_non_alphanumeric': 0.15219236209335218, 'fraction_numerical': 0.06082036775106082, 'mean_word_length': 2.7657082002129925, 'pattern_counts': {'":': 26, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1578197', 'n_tokens_mistral': 1367, 'n_tokens_neox': 1184, 'n_words': 413}