<commit_before># metrix

Metrics collector written in golang

## Installation

You need to have go 1.1 installed (see http://golang.org/doc/install)

    git clone <EMAIL>:dynport/metrix.git
    make
    make install


## Examples

    # Post load and memory metrics to opentsdb
    metrix --memory --loadavg --opentsdb=<opentsdbhost>:<opentsdbport>

    # Post memory and loadavg metrix to opentsdb (every 60s), log output to syslog
    # 
    # /etc/cron.d/metrix
    * * * * * root /usr/local/bin/metrix --memory --loadavg --opentsdb=<opentsdbhost>:<opentsdbport> 2>&1 | logger -t metrix

## Help

    USAGE: metrix
      --help           	Print this usage page                                               
      --keys           	Only list all known keys                                            
      --opentsdb       	Report metrics to OpenTSDB host.                                    
                        EXAMPLE: opentsdb.host:4242                                         

      --graphite       	Report metrics to Graphite host.                                    
                        EXAMPLE: graphite.host:2003                                         

      --hostname       	Hostname to be used for tagging. If blank the local hostname is used
      --net            	Collect network metrics                                             
      --df             	Collect disk free space metrics                                     
      --disk           	Collect disk usage metrics                                          
      --cpu            	Collect cpu metrics                                                 <commit_msg>update installation instructions (for e.g. go)<commit_after># metrix

Metrics collector written in golang

## Requirements

You need to have go 1.1 and some build tools installed. This can be done in ubuntu like this (make sure `universe` is enabled):
	
	apt-get install -y bzr git-core build-essential
	cd /opt
	curl -OL https://go.googlecode.com/files/go1.1.1.linux-amd64.tar.gz
	tar xvfz go1.1.1.linux-amd64.tar.gz
	export GOROOT=/opt/go
	export GOPATH=/go

## Installation
    
Building of the binary needs to only be done once. You can just copy it to any linux system and run it without any extra dependencies.

    git clone <EMAIL>:dynport/metrix.git /tmp/metrix
    cd /tmp/metrix
    make install_dependencies
    make
    make install    


## Examples

    # Post load and memory metrics to opentsdb
    metrix --memory --loadavg --opentsdb=<opentsdbhost>:<opentsdbport>

    # Post memory and loadavg metrix to opentsdb (every 60s), log output to syslog
    # 
    # /etc/cron.d/metrix
    * * * * * root /usr/local/bin/metrix --memory --loadavg --opentsdb=<opentsdbhost>:<opentsdbport> 2>&1 | logger -t metrix

## Help

    USAGE: metrix
      --help           	Print this usage page                                               
      --keys           	Only list all known keys                                            
      --opentsdb       	Report metrics to OpenTSDB host.                                    
                        EXAMPLE: opentsdb.host:4242                                         

      --graphite       	Report metrics to Graphite host.                                    
                        EXAMPLE: graphite.host:2003                                         

      --hostname       	Hostname to be used for tagging. If blank the local hostname is used
      --net            	Collect network metrics                                             
      --df             	Collect disk free space metrics                                     
      --disk           	Collect disk usage metrics                                          
      --cpu            	Collect cpu metrics                                                 
{'fraction_non_alphanumeric': 0.06264682850430697, 'fraction_numerical': 0.009919081179848603, 'mean_word_length': 1.0974274767378216, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 15, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 28, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2571896', 'n_tokens_mistral': 956, 'n_tokens_neox': 874, 'n_words': 312}