Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
shalako committed Jul 20, 2015
1 parent 188feec commit bcdba67
Showing 1 changed file with 34 additions and 12 deletions.
46 changes: 34 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,37 @@ NOAA is a client library to consume metric and log messages from Doppler.

This library does not work with Go 1.3 through 1.3.3, due to a bug in the standard libraries.

##Usage

See the included sample applications. In order to use the samples, you will have to export the following environment variable:
##Get the Code

This Go project is designed to be imported into `$GOPATH`, rather than being cloned into any working directory. There are two ways to do this.

- The easiest way with with `go get`. This will import the project, along with all dependencies, into your `$ GOPATH`.
```
$ echo $GOPATH
/Users/myuser/go
$ go get github.com/cloudfoundry/noaa
$ ls ~/go/src/github.com/cloudfoundry/
noaa/ sonde-go/
```

- You can also manually clone the repo into your `$GOPATH`, but you then have to manually import dependencies.
```
$ echo $GOPATH
/Users/myuser/go
$ cd /Users/myuser/go/src/github.com/cloudfoundry
$ git clone git@github.com:cloudfoundry/noaa.git
$ cd noaa
$ go get ./...
```

## Sample Applications

### Prerequisites

In order to use the sample applications below, you will have to export the following environment variables:

* `CF_ACCESS_TOKEN` - You can get this value by executing (`$ cf oauth-token`). Example:

Expand All @@ -26,6 +54,7 @@ export CF_ACCESS_TOKEN="bearer eyJhbGciOiJSUzI1NiJ9.eyJqdGkiOiI3YmM2MzllOC0wZGM0
export DOPPLER_ADDR="wss://doppler.10.244.0.34.xip.io:443"
```


###Application logs

The `sample/main.go` application streams logs for a particular app. The following environment variable needs to be set:
Expand All @@ -47,18 +76,11 @@ bin/sample

The `firehose_sample/main.go` application streams metrics data and logs for all apps.

There are two ways to run the firehose sample app: using `go get` or cloning the repo with git into your `$GOPATH`. If you used `go get`, any dependencies will already be included; if you cloned by hand, you can fetch dependencies with the following commands:

```bash
cd $GOPATH/src/github.com/cloudfoundry/noaa
go get ./... # Fetches dependencies
```

Once dependencies are retrieved, you can run the firehose sample app like this:
You can run the firehose sample app like this:

```
go build -o bin/firehose_sample firehose_sample/main.go
DOPPLER_ADDR="..." CF_ACCESS_TOKEN="..." bin/firehose_sample
bin/firehose_sample
```

Multiple subscribers may connect to the firehose endpoint, each with a unique subscription_id (configurable in `main.go`). Each subscriber (in practice, a pool of clients with a common subscription_id) receives the entire stream. For each subscription_id, all data will be distributed evenly among that subscriber's client pool.
Expand Down

0 comments on commit bcdba67

Please sign in to comment.