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
#!/bin/bash | |
# useful articles: | |
# https://vstinner.github.io/journey-to-stable-benchmark-system.html | |
# http://perf.readthedocs.io/en/latest/system.html | |
# https://baiweiblog.wordpress.com/2017/11/02/how-to-set-processor-affinity-in-linux-using-taskset/ | |
# https://wiki.archlinux.org/index.php/CPU_frequency_scaling#CPU_frequency_driver | |
if [[ $EUID > 0 ]]; then | |
echo "Please run as root" | |
exit 1 |
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
#!/bin/bash | |
echo "$(date) load 2kHz" | |
timeout 120 fakemetrics feed --gnet-addr http://localhost:9000/metrics --gnet-key not_very_secret_key --mpo 2000 --orgs 1 | |
echo "$(date) load 20kHz" | |
timeout 120 fakemetrics feed --gnet-addr http://localhost:9000/metrics --gnet-key not_very_secret_key --mpo 20000 --orgs 1 |
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
go test -run=. -bench=. | |
goos: linux | |
goarch: amd64 | |
BenchmarkUintsParse-8 10000000 162 ns/op | |
BenchmarkUintsPrint-8 5000000 337 ns/op | |
BenchmarkArrParse-8 10000000 151 ns/op | |
BenchmarkArrPrint-8 3000000 403 ns/op | |
PASS | |
ok _/home/dieter/tmp/string-to-byte-array 7.126s |
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
1) for any request that returned non-"http 200 ok", see full request body (incl post data) and response headers and body | |
2) see last actions up to a crash (e.g. which requests were being handled and in what stage) | |
3) additional datapoints (e.g. amount of series and datapoints loaded to satisfy a request), for single queries (by id) | |
4) maybe: additional datapoints (e.g. amount of series and datapoints loaded to satisfy a request), aggregated per instance/across all instances | |
5) track all slow requests. show their full request, and show latencies. https://github.com/raintank/metrictank/issues/678 | |
6) time spent in different systems/subroutines, for single queries (by id) | |
7) time spent in different systems/subroutines, aggregated per instance/across all instances | |
8) on-demand debug logs for specific requests https://github.com/raintank/metrictank/issues/360 | |
we have various desires to make our logging better (use a maintained lib, structured logging, etc) see https://github.com/raintank/metrictank/issues/624 |
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
curl -v -H 'X-Org-Id: 1' "http://localhost:6070/render/?target=some.id.of.a.metric.*" | sed 's#,#\r\n#g' | grep target | |
% Total % Received % Xferd Average Speed Time Time Time Current | |
Dload Upload Total Spent Left Speed | |
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Trying ::1... | |
* Connected to localhost (::1) port 6070 (#0) | |
> GET /render/?target=some.id.of.a.metric.* HTTP/1.1 | |
> Host: localhost:6070 | |
> User-Agent: curl/7.50.1 | |
> Accept: */* | |
> X-Org-Id: 1 |
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
~ ❯❯❯ for i in {0..7}; do echo $i; curl -H 'X-Org-Id: 1' "http://localhost:607$i/metrics/index.json"; echo; done | |
0 | |
[] | |
1 | |
[] | |
2 | |
["metrictank.usage.numPoints","metrictank.usage.numSeries","some.id.of.a.metric.2","some.id.of.a.metric.4","some.id.of.a.metric.7"] | |
3 | |
["metrictank.usage.numPoints","metrictank.usage.numSeries","some.id.of.a.metric.1","some.id.of.a.metric.5","some.id.of.a.metric.8"] | |
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
==> Making package: vagrant-git 1.8.5.87.g9c299a2-1 (Tue Sep 13 18:18:48 EEST 2016) | |
==> Checking runtime dependencies... | |
==> Checking buildtime dependencies... | |
==> Retrieving sources... | |
-> Updating vagrant git repo... | |
Fetching origin | |
==> Validating source files with md5sums... | |
vagrant ... Skipped | |
==> Extracting sources... | |
-> Creating working copy of vagrant git repo... |
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
~/g/s/g/r/worldping-api ❯❯❯ make ⏎ | |
make all | |
make[1]: Entering directory '/home/dieter/go/src/github.com/raintank/worldping-api' | |
bash -c "./scripts/depends.sh" | |
+++ dirname ./scripts/depends.sh | |
++ cd ./scripts | |
++ pwd | |
+ DIR=/home/dieter/go/src/github.com/raintank/worldping-api/scripts | |
+ cd /home/dieter/go/src/github.com/raintank/worldping-api/scripts | |
+ : /home/dieter/go |
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
package main | |
import ( | |
"fmt" | |
"time" | |
) | |
func main() { | |
size := 100 * 1000 * 1000 | |
data := make([][10]byte, size) |
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
{ | |
"id": null, | |
"title": "usage accounting", | |
"originalTitle": "usage accounting", | |
"tags": [], | |
"style": "dark", | |
"timezone": "browser", | |
"editable": true, | |
"hideControls": false, | |
"sharedCrosshair": false, |