<commit_before># hface

look your Hazelcast cluster in the face!

## What do you mean?

![hface braindump](https://github.com/tolitius/hface/blob/master/doc/hface-braindump.jpg?raw=true)

## The Gist

`hface` monitors a Hazelcast cluster in real time. It currently supports maps, multimaps and queues. 
Support for other distributed data structures is coming.

In order to monitor a remote Hazelcast cluster add an `8K` jar dependency to it:

[![Clojars Project](http://clojars.org/org.hface/hface-client/latest-version.svg)](http://clojars.org/org.hface/hface-client)

or

```xml
<dependency>
  <groupId>org.hface</groupId>
  <artifactId>hface-client</artifactId>
  <version>0.1.5</version>
</dependency>
```

it will be collecting the stats from all the nodes and will be sending these stats to `hface` for aggregation and visual pleasure.

## Visual

This is what hface dash currently looks like as it monitors the cluster:

![hface dash](https://github.com/tolitius/hface/blob/master/doc/hface-dash.png?raw=true)

### ASCII

All the stats are also available in JSON via `/stats`:

<img alt="Hazelcast cluster stats" width="35%" src="https://raw.githubusercontent.com/tolitius/hface/master/doc/stats.json.png?raw=true"/>

## Run it

### hface config

hface dashboard relies on a small configuraion file that can be pointed to by `-Dconf=path-to-config`. Here is a sample config:

```clojure
{:collector {:refresh-interval 4}                       ;; refresh cluster stats every 4 seconds
 :hz-client {:hosts ["127.0.0.1" "127.0.0.2"]           ;; hazelcast cluster hosts/ips
             :retry-ms 5000                             ;; retry to reconnect in 5 seconds
             :retry-max 720000                          ;; 720000 * 5000 = one hour
             :group-name "dev"                          ;; creds to the cluster (dev/dev-pass are hz defaults)
             :group-password "<PASSWORD>"}}
```

### from sources

* clone the repo (e.g. `git clone https://github.com/tolitius/hface.git`)
* `cd hface/dash`
* `lein ring uberjar`
* `java -jar -Dconf=/path-to/hface.conf target/hface-dash.jar`

then, for joy, go to [http://localhost:3000/](http://localhost:3000/)

## License

Copyright © 2017 tolitius

Distributed under the Eclipse Public License, the same as Clojure.
<commit_msg>[docs]: add hface server example<commit_after># hface

look your Hazelcast cluster in the face!

## What do you mean?

![hface braindump](https://github.com/tolitius/hface/blob/master/doc/hface-braindump.jpg?raw=true)

## The Gist

`hface` monitors a Hazelcast cluster in real time. It currently supports maps, multimaps and queues. 
Support for other distributed data structures is coming.

In order to monitor a remote Hazelcast cluster add an `8K` jar dependency to it:

[![Clojars Project](http://clojars.org/org.hface/hface-client/latest-version.svg)](http://clojars.org/org.hface/hface-client)

or

```xml
<dependency>
  <groupId>org.hface</groupId>
  <artifactId>hface-client</artifactId>
  <version>0.1.5</version>
</dependency>
```

it will be collecting the stats from all the nodes and will be sending these stats to `hface` for aggregation and visual pleasure. Here is [an example](https://github.com/tolitius/hface-server) of a simple Hazelcast server node with an hface client dependency.

## Visual

This is what hface dash currently looks like as it monitors the cluster:

![hface dash](https://github.com/tolitius/hface/blob/master/doc/hface-dash.png?raw=true)

### ASCII

All the stats are also available in JSON via `/stats`:

<img alt="Hazelcast cluster stats" width="35%" src="https://raw.githubusercontent.com/tolitius/hface/master/doc/stats.json.png?raw=true"/>

## Run it

### hface config

hface dashboard relies on a small configuraion file that can be pointed to by `-Dconf=path-to-config`. Here is a sample config:

```clojure
{:collector {:refresh-interval 4}                       ;; refresh cluster stats every 4 seconds
 :hz-client {:hosts ["127.0.0.1" "127.0.0.2"]           ;; hazelcast cluster hosts/ips
             :retry-ms 5000                             ;; retry to reconnect in 5 seconds
             :retry-max 720000                          ;; 720000 * 5000 = one hour
             :group-name "dev"                          ;; creds to the cluster (dev/dev-pass are hz defaults)
             :group-password "<PASSWORD>"}}
```

### from sources

* clone the repo (e.g. `git clone https://github.com/tolitius/hface.git`)
* `cd hface/dash`
* `lein ring uberjar`
* `java -jar -Dconf=/path-to/hface.conf target/hface-dash.jar`

then, for joy, go to [http://localhost:3000/](http://localhost:3000/)

## License

Copyright © 2018 tolitius

Distributed under the Eclipse Public License, the same as Clojure.

{'fraction_non_alphanumeric': 0.12413066385669125, 'fraction_numerical': 0.022339304531085354, 'mean_word_length': 3.2037201062887513, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, 'https://': 9, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 4, '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': '691624', 'n_tokens_mistral': 1618, 'n_tokens_neox': 1474, 'n_words': 471}