Skip to content

Nebo15/dogstat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DogStat

Deps Status Hex.pm Downloads Latest Version License Build Status Coverage Status Ebert

This package is based on Statix with one major difference - it receives settings when on GenServer init, allowing to use packages like Confex to resolve configuration from environment at start-time.

Installation

The package can be installed as:

  1. Add dogstat to your list of dependencies in mix.exs:
def deps do
  [{:dogstat, "~> 0.1.0"}]
end
  1. Ensure dogstat is started before your application:
def application do
  [applications: [:dogstat]]
end
  1. Add it to your supervision tree:
def start(_type, _args) do
  import Supervisor.Spec, warn: false

  config = [
    host: "localhost",
    port: 8125
  ]

  children = [
    ...
    worker(Annon.Monitoring.MetricsCollector, [config]),
    ...
  ]

  opts = [strategy: :one_for_one, name: Annon.Supervisor]
  Supervisor.start_link(children, opts)
end

Docs

The docs can be found at https://hexdocs.pm/dogstat

License

See LICENSE.md.