This file contains hidden or 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
public class Example implements Runnable { | |
public final static int NUM_THREADS = 8; | |
public final static long ITERATIONS = 500L * 1000L * 1000L; | |
private final int arrayIndex; | |
private static VolatileLong[] longs = new VolatileLong[NUM_THREADS]; | |
static { | |
for (int i = 0; i < longs.length; i++) { | |
longs[i] = new VolatileLong(); |
This file contains hidden or 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 ( | |
"bufio" | |
"encoding/json" | |
"flag" | |
"fmt" | |
"os" | |
"os/exec" | |
"strconv" |
This file contains hidden or 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 | |
set -ueo pipefail | |
TEST_DIR=$1 | |
echo "benchmark disk mounted on" $TEST_DIR | |
echo "--> write throughput" | |
sudo fio --name=disk_benchmark --directory=$TEST_DIR --numjobs=8 \ | |
--size=10G --time_based --runtime=60s --ramp_time=2s --ioengine=libaio \ |
This file contains hidden or 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 | |
# | |
# Install specific version of a Homebrew formula | |
# | |
# Usage: brewv.sh formula_name desired_version | |
# | |
# Notes: | |
# - this will unshallow your brew repo copy. It might take some time the first time | |
# you call this script | |
# - it will uninstall (instead of unlink) all your other versions of the formula. |
This file contains hidden or 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 | |
# tidb 地址保存在 addrs | |
# 参数 clients_per_tidb 表示几个 sysbench 压一个 tidb | |
set -o monitor | |
pids="" | |
checkpids() { | |
for pid in $pids; do |
This file contains hidden or 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 ( | |
"flag" | |
"fmt" | |
"log" | |
"sync" | |
"time" | |
"github.com/coocood/badger" |
This file contains hidden or 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
#![feature(slice_patterns)] | |
#[macro_use] | |
extern crate clap; | |
extern crate chrono; | |
extern crate fs2; | |
#[cfg(feature = "mem-profiling")] | |
extern crate jemallocator; | |
extern crate libc; | |
#[macro_use] |
This file contains hidden or 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
// Copyright 2017 PingCAP, In | |
// | |
// Licensed under the Apache License, Version 2.0 (the "License"); | |
// you may not use this file except in compliance with the License. | |
// You may obtain a copy of the License at | |
// | |
// http://www.apache.org/licenses/LICENSE-2.0 | |
// | |
// Unless required by applicable law or agreed to in writing, software | |
// distributed under the License is distributed on an "AS IS" BASIS, |
This file contains hidden or 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" | |
"os" | |
"strconv" | |
"gonum.org/v1/plot" | |
"gonum.org/v1/plot/plotter" | |
"gonum.org/v1/plot/plotutil" |