screepers/screeps-grafana

Name: screeps-grafana

Owner: screepers

Description: Pretty graphs for screeps

Forked from: bkconrad/screeps-grafana

Created: 2016-06-23 09:57:06.0

Updated: 2018-01-10 21:03:48.0

Pushed: 2017-07-09 16:34:52.0

Homepage: null

Size: 107

Language: CoffeeScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

screeps-grafana

Pretty graphs for Screeps stats. sampleDashboard

There are two ways to get started:

Path 1: Easy but not robust

You can run this project locally, with all the drawbacks that entails.

Install docker

Install docker-compose

Copy and edit the example config file:

ocker-compose.env.example docker-compose.env
TOR docker-compose.env

Run the setup:

 setup.sh

Go to http://localhost:1337 in your browser, then see Usage below.

Path 2: Robust but not easy

Acquire a server, I use a t2.micro from Amazon Web Services. You can use anything running ubuntu with passwordless sudo.

Open ports 80 and 81 in your security groups.

SUPER IMPORTANT: MAKE SURE TO MOUNT A DATA VOLUME TO /dev/sdf IN THE AWS CONSOLE. IF YOU FAIL TO DO SO, YOUR DATA AND DASHBOARDS WILL BE LOST IF THE SERVER RESTARTS, THEN YOU WILL BE HELLA SALTY, AND I'LL JUST CROSS MY ARMS AND SAY “I TOLD YOU SO IN BOLDED ITALICS”

Install ansible.

Create a password for your screeps account if you haven't already.

You're now ready to run this whale of a command. Replace the stuff in caps with values that makes sense

ble-playbook \
 screeps_username=YOURUSERNAME \
 screeps_password=YOURPASSWORD \
 screeps_email=YOUREMAIL \
user ubuntu \
private-key YOURPRIVATEKEY \
 ,YOURSERVERIP \
aybook.yml

Don't remove the comma before YOURSERVERIP. You will get a mysterious error. If you pass your IP like ,12.34.56.78 you are doing it correctly.

If the run errors out, check your parameters and retry. It is common to see transient errors from Apt or GPG, which are both fixed by re-running.

You are now ready to use grafana!

Usage

Go to http://localhost:1337 or your own real-life server's IP. Login with the following default credentials: NOTE: On Windows running Docker Toolbox use http://192.168.99.100:1337 instead

name: admin
word: admin

You are now ready to create some dashboards.

To use the Sample Dashboard, copy the contents of stats.js A sample dashboard is already installed that displays the stats from stats.js

To send stats to the dashboard, simply write them to Memory.stats. For example:

ry.stats["room." + room.name + ".energyAvailable"] = room.energyAvailable;
ry.stats["room." + room.name + ".energyCapacityAvailable"] = room.energyCapacityAvailable;
ry.stats["room." + room.name + ".controllerProgress"] = room.controller.progress;

All values on the Memory.stats object are forwarded to Grafana verbatim.

Adding Grafana plugins

Just run docker-compose exec grafana grafana-cli plugins install grafana-clock-panel to install the plugins, then docker-compose restart grafana to apply. Refresh your browser and voila!

License

This software is licensed under the MIT License. See the LICENSE file for more information.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.