<commit_before># Watchdog

Watchdog is a modern rethinking of a process manager for running applications and services at scale with minimal condiguration and deployment effort.

### Architecture

Watchdog is delivered as a single binary which acts as both the control interface and background agent. It is designed to run as a foreground process under Upstart or Launchd (See the examples directory for startup config examples).

To start the background agent, run:

```sh
watchdog agent
```

This will also start the RPC interface on `127.0.0.1:6673`.

### Configuration

Watchdog is designed to be easy to configure either by hand or by machine. As such it supports two interchangable configuration formats; `JSON` and [TOML](https://github.com/mojombo/toml). Configuration files can be located anywhere and registred at runtime, at which point they will be watched for changes by Watchdog and changes automatically applied on save.

To register a new process configuration:

```sh
watchdog register /path/to/myprocess.json
```

If your process is configured `start_on_load` it will be started immediately, otherwise it will be registered and not started until you start the process.

### Process Control

Watchdog CLI includes the usual methods for starting, stopping and restarting processes. The real power here comes from the process configuration which allows you to configure how processes are signalled to exit and how long to wait between restarting to avoid overloading the system.

Start a process:

```sh
watchdog start myprocess
```

Stop a process:

```sh
watchdog stop myprocess
```

Restart a process:

```sh
watchdog restart myprocess
```

### Tailing process logs

It is expected that any useful process output will be written to `stdout` or `stderr` as per the usual [12 Factor App](http://12factor.net/logs) setup.

You can configure custom log drains to have process output directed to external services like `Librato`, `l2met`, `LogEntries`, `Loggly`, `file`.

You can also use the CLI to tail process logs in realtime:

```sh
watchdog logs -tail myprocess
```

## API Documentation

[API Documentation](http://godoc.org/github.com/appio/watchdog)

# License

Watchdog is licensed under the [Mozilla Public License, version 2.0](LICENSE)
<commit_msg>Added more to the readme<commit_after># Watchdog

Watchdog is a modern rethinking of a process manager for running applications and services at scale with minimal condiguration and deployment effort.

### Architecture

Watchdog is delivered as a single binary which acts as both the control interface and background agent. It is designed to run as a foreground process under Upstart or Launchd (See the examples directory for startup config examples).

To start the background agent, run:

```sh
watchdog agent
```

This will also start the RPC interface on `127.0.0.1:6673`.

### Configuration

Watchdog is designed to be easy to configure either by hand or by machine. As such it supports two interchangable configuration formats; `JSON` and [TOML](https://github.com/mojombo/toml). Configuration files can be located anywhere and registred at runtime, at which point they will be watched for changes by Watchdog and changes automatically applied on save.

To register a new process configuration:

```sh
watchdog register /path/to/myprocess.json
```

If your process is configured `start_on_load` it will be started immediately, otherwise it will be registered and not started until you manually start the process.

### Process Control

Watchdog CLI includes the usual methods for starting, stopping and restarting processes. The real power here comes from the process configuration which allows you to configure how processes are signalled to exit and how long to wait between restarting to avoid overloading the system.

Start a process:

```sh
watchdog start myprocess
```

Stop a process:

```sh
watchdog stop myprocess
```

Restart a process:

```sh
watchdog restart myprocess
```

### Tailing process logs

It is expected that any useful process output will be written to `stdout` or `stderr` as per the usual [12 Factor App](http://12factor.net/logs) setup.

You can configure custom log drains to have process output directed to external services like `Librato`, `l2met`, `LogEntries`, `Loggly`, `file`.

You can also use the CLI to tail process logs in realtime:

```sh
watchdog logs -tail myprocess
```

### Output drains

Watchdog supports multiple output drains on a per process basis, allowing to you effortlessly ship output to any of the following services:

- Librato
- l2Met
- LogEntries
- Loggly

## Design Goals

*Some of the above mentioned features are still being developed*

Watchdog is primarily designed to solve the problem of configuration drift across platforms for managing similar process types which often occures when working with different operating systems. At App.io we run OSX and Ubuntu. Our entire stack is configured using a configuration management tool and rarely ever do we connect directly to a machine to configure or probe anything.

As such Watchdog is designed to output both machine readable (JSON) and human readable data, making automated configuration easy.

## API Documentation

[API Documentation](http://godoc.org/github.com/appio/watchdog)

## License

Watchdog is licensed under the [Mozilla Public License, version 2.0](LICENSE)

{'fraction_non_alphanumeric': 0.06004102181614768, 'fraction_numerical': 0.006526198023494313, 'mean_word_length': 4.792656587473002, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3764369', 'n_tokens_mistral': 1375, 'n_tokens_neox': 1317, 'n_words': 749}