machinery-dashboard

command module
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 11, 2019 License: MIT Imports: 13 Imported by: 0

README

machinery-dashboard

dashboard for machinery stats

Screenshot

Setup:

Note: for storing the stats we use mongodb
If more people use this i might add sql support later on

1. Add the event recorder to the machinery worker(s)
import (
	"github.com/RichardKnop/machinery/v1"
	"github.com/RichardKnop/machinery/v1/config"
  "github.com/mjarkk/machinery-dashboard/plugin"
)

// Setup machinery
server, _ := machinery.NewServer(&config.Config{
  Broker:        "redis://localhost",
  DefaultQueue:  "machinery_tasks",
  ResultBackend: "redis://localhost",
})
worker := server.NewCustomQueueWorker(tag, concurrencyToSet, q.Name)

// Setup the log listener for machinery
plugin.Init(worker, plugin.Options{
  Mongodb: plugin.MongoDBConnectOptions{
    ConnectionURI: "mongo://localhost", // you need to change this
    Database:      "machineryStats",
  },
})
2. Setup the dashboard

Create a config file named: config.json

{
  "mongodb": {
    "connectionURL": "mongodb://localhost:27017",
    "database": "stats"
  }
}

Run the docker container

docker run \
  -p 9090:9090 \
  -v `pwd`/config.json:/config.json \
  -d mjarkk/machinery-dashboard

Build the docker container yourself

git clone https://github.com/mjarkk/machinery-dashboard
cd machinery-dashboard
docker build -t mjarkk/machinery-dashboard .

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL