Skip to content

Instantly share code, notes, and snippets.

View mitake's full-sized avatar
💭
I may be slow to respond.

Hitoshi Mitake mitake

💭
I may be slow to respond.
  • 15:51 (UTC +09:00)
View GitHub Profile
@mitake
mitake / result.md
Created May 15, 2022 13:12
13594 benchmark
22:11:33 etcd2 | {"level":"info","ts":"2022-05-15T22:11:33.458+0900","caller":"auth/store.go:449","msg":"added a user","user-name":"du0"}
22:11:33 etcd1 | {"level":"info","ts":"2022-05-15T22:11:33.458+0900","caller":"auth/range_perm_cache.go:153","msg":"elapsed time for refreshRangePermCache: ","elapsed":"6.217209ms"}
22:11:33 etcd1 | {"level":"info","ts":"2022-05-15T22:11:33.458+0900","caller":"auth/store.go:449","msg":"added a user","user-name":"du0"}
22:11:33 etcd3 | {"level":"info","ts":"2022-05-15T22:11:33.458+0900","caller":"auth/range_perm_cache.go:153","msg":"elapsed time for refreshRangePermCache: ","elapsed":"6.273166ms"}
22:11:33 etcd3 | {"level":"info","ts":"2022-05-15T22:11:33.458+0900","caller":"auth/store.go:449","msg":"added a user","user-name":"du0"}
22:11:36 etcd1 | {"level":"info","ts":"2022-05-15T22:11:36.036+0900","caller":"auth/range_perm_cache.go:153","msg":"elapsed time for refreshRangePermCache: ","elapsed":"6.209167ms"}
22:11:36 etcd1 | {"level":"info","ts":"2022-05-15T22:11:36.0
#! /bin/bash
export ETCDCTL_API=3
ETCDCTL=bin/etcdctl
echo p | $ETCDCTL user add root --interactive=false
echo p | $ETCDCTL user add u1 --interactive=false
$ETCDCTL role add root
$ETCDCTL role add r1
@mitake
mitake / ncdc.sh
Created December 12, 2018 01:37 — forked from schnell18/ncdc.sh
Download a weather dataset from the National Climatic Data Center (NCDC, http://www .ncdc.noaa.gov/). Prepare it for examples of "Hadoop: The Definitive Guide" book by Tom White. http://www.amazon.com/Hadoop-Definitive-Guide-Tom-White/dp/1449311520 Usage: ./ncdc.sh 1901 1930 # download wheather datasets for period from 1901 to 1930.
#!/usr/bin/env bash
# global parameters
g_tmp_folder="ncdc_tmp";
g_output_folder="ncdc_data";
g_remote_host="ftp3.ncdc.noaa.gov";
g_remote_path="pub/data/noaa";

Reference Getting Started with runC

mkdir runc
cd runc
docker pull busybox
docker export $(docker create busybox) > busybox.tar
mkdir rootfs
tar -C rootfs -xf busybox.tar
runc spec > container.json
sudo runc
(pprof) top 186
840ms of 840ms total ( 100%)
flat flat% sum% cum cum%
100ms 11.90% 11.90% 100ms 11.90% runtime.futex
90ms 10.71% 22.62% 100ms 11.90% syscall.Syscall
40ms 4.76% 27.38% 40ms 4.76% runtime.usleep
30ms 3.57% 30.95% 120ms 14.29% runtime.adjustframe
20ms 2.38% 33.33% 20ms 2.38% runtime.epollwait
20ms 2.38% 35.71% 20ms 2.38% runtime.findfunc
20ms 2.38% 38.10% 100ms 11.90% runtime.findrunnable
(pprof) top 210
1020ms of 1020ms total ( 100%)
flat flat% sum% cum cum%
180ms 17.65% 17.65% 210ms 20.59% syscall.Syscall
130ms 12.75% 30.39% 130ms 12.75% github.com/coreos/etcd/cmd/vendor/golang.org/x/crypto/blowfish.encryptBlock
60ms 5.88% 36.27% 60ms 5.88% runtime.futex
50ms 4.90% 41.18% 60ms 5.88% runtime.selectgoImpl
30ms 2.94% 44.12% 30ms 2.94% runtime.duffcopy
30ms 2.94% 47.06% 40ms 3.92% runtime.pcvalue
20ms 1.96% 49.02% 40ms 3.92% github.com/coreos/etcd/cmd/vendor/golang.org/x/net/http2/hpack.(*Encoder).searchTable
(pprof) top 295
1.54s of 1.54s total ( 100%)
flat flat% sum% cum cum%
0.18s 11.69% 11.69% 0.19s 12.34% syscall.Syscall
0.13s 8.44% 20.13% 0.13s 8.44% github.com/coreos/etcd/cmd/vendor/golang.org/x/crypto/blowfish.encryptBlock
0.05s 3.25% 23.38% 0.05s 3.25% math/big.addMulVVW
0.05s 3.25% 26.62% 0.05s 3.25% math/big.divWW
0.05s 3.25% 29.87% 0.05s 3.25% math/big.mulAddVWW
0.05s 3.25% 33.12% 0.05s 3.25% runtime.futex
0.05s 3.25% 36.36% 0.05s 3.25% runtime.heapBitsSetType
#! /bin/bash
export ETCDCTL_API=3
ETCDCTL=bin/etcdctl
echo p | $ETCDCTL user add root --interactive=false
echo p | $ETCDCTL user add u1 --interactive=false
$ETCDCTL role add root
$ETCDCTL role add r1
@mitake
mitake / patch-3.5.0-bvt1
Created March 7, 2016 05:54 — forked from leverich/patch-3.5.0-bvt1
Borrowed Virtual Time patch against Linux 3.5.0
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 4a1f493..ef258ef 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1179,6 +1179,10 @@ struct sched_entity {
u64 exec_start;
u64 sum_exec_runtime;
u64 vruntime;
+#ifdef CONFIG_CFS_BVT
+ u64 effective_vruntime;
@mitake
mitake / idea
Last active September 4, 2015 02:24 — forked from chrisdarroch/idea
Open a project in IntelliJ IDEA from your command line!
#!/bin/sh
# check for where the latest version of IDEA is installed
IDEA=/opt/intellij-idea-ce/bin/idea.sh
wd=`pwd`
# were we given a directory?
if [ -d "$1" ]; then
# echo "checking for things in the working dir given"
wd=`ls -1d "$1" | head -n1`