elasticsearch/elasticsearch-support-diagnostics — pull request #19 by pickypg (2014-10-31 07:23:02+00:00)
Title: Work in Progress - Java Support Diagnostics

As the title suggests, this is currently a work in progress to show the starting point.

Things to complete before it's not a WIP:

- Add more output than currently resides in the script, such as `_segments` [DONE except version-specific calls]
- Add support for skipping based on ES version (and therefore the _cat API calls) [NEXT]
- Add support for loading CLI parameters (perhaps with [Commons CLI](http://commons.apache.org/proper/commons-cli/)) [SOON]
- Add support for copying logs (as best as possible, like the script) [SOON]
- Add support for spinning off local processes [SOON]
- Tests! [SOONISH]
- The vast majority of these classes are a few lines long and I am striving to use Dependency Injection everywhere to simplify testing.
- Use a real logger [SOONISH]
- Rebase. Let's forget this commit message ever happened. [LAST]

### Getting Started

1. Download and install Gradle 2.1 (earlier versions will most likely work, but I did not test them)
2. Within the directory, run the `installApp` task to compile the code and generate runnable scripts for it.

```bash
$ gradle installApp
```

This will build and create an easily runnable version of the jar with Unix (extensionless) and Windows (`.bat`) compatible scripts.

```bash
$ gradle installApp
$ build/install/elasticsearch-support-diagnostics/bin/elasticsearch-support-diagnostics
```

Alternatively, you could just run it via Gradle directly (which will not expose the generated scripts in a user friendly way).

```bash
$ gradle run
```

## Testing

Once tests are added, testing is as easy as running

```bash
$ gradle clean test
```