Skip to content

Instantly share code, notes, and snippets.

[foo]
foo1 fail=False
foo2 fail=True
foo3 fail=False
@ajalab
ajalab / do.sh
Last active April 14, 2020 14:24
#!/bin/bash
TARGET_HOST= # The host in which we see the problem
SCRAPE_HOST= # The host which scrapes $TARGET_HOST prometheus
START=$(date -v-4H +%s)
END=$(date +%s)
curl -s "http://$TARGET_HOST/debug/pprof/heap?debug=1" | grep -F "(*Engine).exec+" | tee exec.txt
heap profile: 6882: 3557934704 [58594: 9406224776] @ heap/1048576
6721: 3523739648 [6746: 3536846848] @ 0x1ce2198 0x1ce210c 0x1cdd627 0x1cce2a5 0x1c6e2f9 0x1d86e50 0x1d8027f 0x1d7e26b 0x45f181
# 0x1ce2197 github.com/prometheus/prometheus/tsdb.(*txRing).add+0x247 /app/tsdb/isolation.go:145
# 0x1ce210b github.com/prometheus/prometheus/tsdb.(*memSeries).append+0x1bb /app/tsdb/head.go:1855
# 0x1cdd626 github.com/prometheus/prometheus/tsdb.(*headAppender).Commit+0x2a6 /app/tsdb/head.go:1039
# 0x1cce2a4 github.com/prometheus/prometheus/tsdb.dbAppender.Commit+0x34 /app/tsdb/db.go:687
# 0x1c6e2f8 github.com/prometheus/prometheus/storage.(*fanoutAppender).Commit+0x48 /app/storage/fanout.go:156
# 0x1d86e4f github.com/prometheus/prometheus/scrape.(*scrapeLoop).append.func1+0x3f /app/scrape/scrape.go:1087
# 0x1d8027e github.com/prometheus/prometheus/scrape.(*scrapeLoop).append+0xb7e /app/scrape/scrape.go:1255
# 0x1d7e26a github.com/prometheus/prometheus/scrape.(*scrapeLoop).run+0x5ea /app/scrape/scrape.go:970
SPECIFICATION HC
@ajalab
ajalab / ex1.smt2
Last active November 8, 2018 08:13
Z3 issue #1922
;; ex1.smt2
(get-info :version)
; A tuple of two booleans
; data Tuple = tuple { first :: Bool, second :: Bool }
(declare-datatypes
((Tuple 0))
((Tuple (tuple
(first Bool)
(second Bool)
@ajalab
ajalab / stubio.go
Created September 10, 2018 13:33
stub io
package stubio
import (
"errors"
"io"
"os"
)
type StubIO struct {
In io.Reader
@ajalab
ajalab / Makefile
Created April 17, 2017 10:48
Markdownで数式が書けるPDFを作る
MD = $(wildcard *.md)
TEX = $(MD:%.md=%.tex)
PDF = $(MD:%.md=%.pdf)
.SECONDARY: $(TEX)
all: $(PDF)
%.tex: %.md
pandoc -o $@ -f markdown_github+raw_tex+pandoc_title_block -V documentclass=ujarticle -V geometry:margin=1in -s --listings $<
@ajalab
ajalab / index.js
Created July 12, 2016 14:57
intel edison synthesizer
"use strict";
var express = require("express");
var app = express();
var http = require("http").Server(app);
var io = require("socket.io")(http);
var os = require("os");
var flock = require("flocking");
/* Server */
@ajalab
ajalab / (CPU実験用)レイトレ PPCアセンブリ命令内訳.txt
Last active October 1, 2015 03:56
(CPU実験用)レイトレ PPCアセンブリ命令内訳
min-caml付属のレイトレ(min-rt.ml)をppc向けにコンパイルして吐き出された命令の内訳です。
libmincaml.Sはmin-caml付属のライブラリで、平方根とか三角関数の実装があります。
"ColorTester (for 256colors terminal)
"cf: http://vim.wikia.com/wiki/View_all_colors_available_to_gvim
function! VimColorTest(outfile, fgend)
let result = []
for fg in range(a:fgend)
let kw = printf('%s', printf('c_%d', fg))
let h = printf('hi %s ctermfg=%d', kw, fg)
let s = printf('syn keyword %s %s', kw, kw)
call add(result, printf('%-32s | %s', h, s))