<commit_before># Headcount

Headcount provides a simple way for you to track usage of your rails apps.  If you can write a query for it, headcount can track it for you.

Headcount is released under the MIT-LICENSE.

# Installation

```
gem install headcount
```

or add it to your Gemfile

```
# Gemfile
gem 'headcount'
```

# Configuration

Configure Headcount through a rails initializer.  Here's an example:

```
# config/initializers/headcount.rb
Headcount.configure do |config|
  config.path       = 'db/headcount.json' # default
  config.timestamp  = ''                  # default (YYYY-MM-DD HH:MM:SS)
  
  # by default Headcount will use the underlying table name for the key
  count User                          # :users key implied
  count User.where(:active => true)   # will also use implied :users key
  
  # you can specify the key yourself if you'd like to override the default
  count User.active, :as => :active_members
  
  # if you're fine with using default keys you can pass a list of queries instead
  count User, Account<commit_msg>Updated readme to include default timestamp format<commit_after># Headcount

Headcount provides a simple way for you to track usage of your rails apps.  If you can write a query for it, headcount can track it for you.

Headcount is released under the MIT-LICENSE.

# Installation

```
gem install headcount
```

or add it to your Gemfile

```
# Gemfile
gem 'headcount'
```

# Configuration

Configure Headcount through a rails initializer.  Here's an example:

```
# config/initializers/headcount.rb
Headcount.configure do |config|
  config.path       = 'db/headcount.json' # default
  config.timestamp  = '%Y-%m-%d %H:%M:%S' # default (YYYY-MM-DD HH:MM:SS)
  
  # by default Headcount will use the underlying table name for the key
  count User                          # :users key implied
  count User.where(:active => true)   # will also use implied :users key
  
  # you can specify the key yourself if you'd like to override the default
  count User.active, :as => :active_members
  
  # if you're fine with using default keys you can pass a list of queries instead
  count User, Account
{'fraction_non_alphanumeric': 0.0781758957654723, 'fraction_numerical': 0.0, 'mean_word_length': 3.2406311637080867, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '2415757', 'n_tokens_mistral': 628, 'n_tokens_neox': 604, 'n_words': 269}