Skip to content

Instantly share code, notes, and snippets.

@dmyerscough
dmyerscough / hello.py
Last active August 19, 2018 06:24
Hello World Flask
# -*- coding: utf-8 -*-
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello():
return 'Hello World'
@dmyerscough
dmyerscough / statsd.conf
Last active September 3, 2018 13:23
Statsd-exporter config
mappings:
- match: helloworld.gunicorn.request.status.*
help: "http response code"
name: "http_response_code"
labels:
status: "$1"
job: "helloworld_gunicorn_response_code"
@dmyerscough
dmyerscough / gist:59896aa752ba48794d2aef4c7a0fdd6e
Created September 8, 2018 06:03
Grafana Gunicorn Dashboard
{
"__inputs": [
{
"name": "DS_LOCAL_PROM",
"label": "Local Prom",
"description": "",
"type": "datasource",
"pluginId": "prometheus",
"pluginName": "Prometheus"
}
@dmyerscough
dmyerscough / vmstat
Last active September 8, 2018 06:07
$ vmstat
procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
r b swpd free buff cache si so bi bo in cs us sy id wa st
1 0 2828 407616 335348 5511476 0 0 26 268 41 27 28 30 42 0 0
r: The number of processes in a running state.
b: The number of processes in uninterruptible sleep state.
swpd: the amount of virtual memory used.
free: the amount of idle memory.
buff: the amount of memory used as buffers.
cache: the amount of memory used as cache.
si: Amount of memory swapped in from disk (/s).
so: Amount of memory swapped to disk (/s).
bi: Blocks received from a block device (blocks/s).
bo: Blocks sent to a block device (blocks/s).
in: The number of interrupts per second, including the clock.
cs: The number of context switches per second.
us: Time spent running non-kernel code
sy: Time spent running kernel code
id: Time spent idle
wa: Time spent waiting for I/O
st: Time stolen from a virtual machine