<commit_before>gerouter: Gerrit Event Router
===========================

* Author: rinrinne
* Repository: https://github.com/rinrinne/gerrit-event-router

Synopsis
---------------------------

gerouter is a server application for routing [Gerrit][gerrit] events to message broker.
Now only AMQP broker is supported (recommend [RabbitMQ][rabbitmq] as message queue server)

[gerrit]: https://code.google.com/p/gerrit/ "Gerrit Code Review"
[rabbitmq]: http://www.rabbitmq.com/ "RabbitMQ"

Motivation
---------------------------

Gerrit provides events via ssh stream. Client can receive them using ssh connection. But both of them has no dedicated queue. It means that client may miss many events if ssh is disconnected.

Gerrit events are not required to be processed in real-time. So we can improve this by adding a dedicated and robust queue.

This application can achieve this purpose by a combination with message queue service.


Usage
--------------------------

Install gem

```
$ gem install gerouter
```

Command help

```
$ bundle exec gerouter --help
Usage: gerouter [options]
    -d, --debug                      Debug mode
    -c, --config CONFIGFILE          Path to config file
    -n, --name NAME                  Name of gerrit
```

You should specify -c and -n options.

```
$ bundle exec gerouter -c gerouter.conf -n foobar
```

If -n is not specified, gerouter displays name list.

```
$ bundle exec gerouter -c gerouter.conf
---
:gerrit:
- foobar
:broker:
- foo
```

This application runs on user process in foreground. If you want to run as daemon, recommend to use [God][god]. Samples are stored in [here][samples].

[god]: http://godrb.com/ "God"
[samples]: https://github.com/rinrinne/gerrit-event-router/tree/master/samples "samples"


Config
---------------------------

Sample of config is also stored in [here][samples].

* YAML format with object information
* Gerrit and broker items
* You can include multiple item
* Broker in Gerrit has the broker name
* Broker can consolidate events in multiple Gerrit


Extended Gerrit event
---------------------------

Gerrit event which is sent to broker is extended in order to consolidate them in multiple Gerrit.

```yaml
version: 1
host: gerrit hostname
event: (original event)
```

License
===========================

MIT License

Copyright
===========================

Copyright (c) 2013 rinrinne a.k.a. rin_ne
<commit_msg>Modify README<commit_after>gerouter: Gerrit Event Router
===========================

* Author: rinrinne
* Repository: https://github.com/rinrinne/gerrit-event-router

Synopsis
---------------------------

gerouter is a server application for routing [Gerrit][gerrit] events to message broker.
Now only AMQP broker is supported (recommend [RabbitMQ][rabbitmq] as message queue server)

[gerrit]: https://code.google.com/p/gerrit/ "Gerrit Code Review"
[rabbitmq]: http://www.rabbitmq.com/ "RabbitMQ"

Motivation
---------------------------

Gerrit provides events via ssh stream. Client can receive them using ssh connection. But both of them has no dedicated queue. It means that client may miss many events if ssh is disconnected.

Gerrit events are not required to be processed in real-time. So we can improve this by adding a dedicated and robust queue.

This application can achieve this purpose by a combination with message queue service.


Usage
--------------------------

Install gem

```
$ gem install gerouter
```

Command help

```
$ bundle exec gerouter --help
Usage: gerouter [options]
    -d, --debug                      Debug mode
    -c, --config CONFIGFILE          Path to config file
    -n, --name NAME                  Name of gerrit
```

You should specify -c and -n options.

```
$ bundle exec gerouter -c gerouter.conf -n foobar
```

If -n is not specified, gerouter displays name list.

```
$ bundle exec gerouter -c gerouter.conf
---
:gerrit:
- foobar
:broker:
- foo
```

This application runs on user process in foreground. If you want to run as daemon, recommend to use [God][god]. Samples are stored in [here][samples].

[god]: http://godrb.com/ "God"
[samples]: https://github.com/rinrinne/gerrit-event-router/tree/master/samples "samples"


Config
---------------------------

Sample of config is also stored in [here][samples].

* YAML format with object information
* Gerrit and broker items
* You can include multiple item
* Broker in Gerrit has the broker name
* Broker can consolidate events in multiple Gerrit


Extended Gerrit event
---------------------------

Gerrit event which is sent to broker is extended in order to consolidate them in multiple Gerrit.

```json
{
"version":"1",
"host":"gerrit hostname",
"event":{(original event)}
}
```

License
===========================

MIT License

Copyright
===========================

Copyright (c) 2013 rinrinne a.k.a. rin_ne

{'fraction_non_alphanumeric': 0.17098983191533512, 'fraction_numerical': 0.002075119319360863, 'mean_word_length': 2.9346938775510205, 'pattern_counts': {'":': 3, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, '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': '583357', 'n_tokens_mistral': 1426, 'n_tokens_neox': 1288, 'n_words': 558}