Skip to content

Instantly share code, notes, and snippets.

import "@johnlindquist/kit";
// Menu: Code Snippets
// Description: Easily organize your code snippets
// Author: Altrim Beqiri
// Twitter: @altrimbeqiri
import "@johnlindquist/kit";
const wrapCode = (html: string) => `<pre class="px-4">
require 'gsl'
require 'time'
module Diskalerter
class ThresholdEstimator
attr_reader :timestamps, :signal, :threshold, :now
# timestamps - a list of timestamps in epoch milliseconds
# signal - a list of values for the provided timestamps
# threshold - the "exhaustion" threshold (e.g., 100 for a percentage signal)
require 'gsl'
require 'time'
module Diskalerter
class ThresholdEstimator
attr_reader :timestamps, :signal, :threshold, :now
# timestamps - a list of timestamps in epoch milliseconds
# signal - a list of values for the provided timestamps
# threshold - the "exhaustion" threshold (e.g., 100 for a percentage signal)
@rreilly-edr
rreilly-edr / gist:0ceade8cb43a11f45a9cd2889c134e13
Created February 9, 2018 20:18 — forked from jarpy/gist:d8bc2f353f365490f485
Send statsd metrics from the shell using only echo and Netcat.
# Counter
echo -n 'some.metric.namespace:1|c' | nc -u -q0 localhost 8125
# Gauge
echo -n 'some.metric.namespace:100|g' | nc -u -q0 localhost 8125
# Timer
echo -n 'some.metric.namespace:342|ms' | nc -u -q0 localhost 8125