This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |