Skip to content

Instantly share code, notes, and snippets.

View Connor1996's full-sized avatar
😳
Coding

Connor Connor1996

😳
Coding
  • PingCAP
  • Beijing, China
View GitHub Profile
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();
@Connor1996
Connor1996 / check.go
Last active January 19, 2022 13:10
Check regions of table
package main
import (
"bufio"
"encoding/json"
"flag"
"fmt"
"os"
"os/exec"
"strconv"
#!/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 \
@Connor1996
Connor1996 / brewv.sh
Created December 10, 2019 12:40 — forked from demosten/brewv.sh
Install specific version of a Homebrew formula
#!/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.
#! /bin/bash
# tidb 地址保存在 addrs
# 参数 clients_per_tidb 表示几个 sysbench 压一个 tidb
set -o monitor
pids=""
checkpids() {
for pid in $pids; do
package main
import (
"flag"
"fmt"
"log"
"sync"
"time"
"github.com/coocood/badger"
#![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]
// 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,
@Connor1996
Connor1996 / plot
Last active April 17, 2018 09:39
draw image
package main
import (
"fmt"
"os"
"strconv"
"gonum.org/v1/plot"
"gonum.org/v1/plot/plotter"
"gonum.org/v1/plot/plotutil"
@Connor1996
Connor1996 / iterm2-solarized.md
Created September 23, 2017 02:43 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Meslo powerline font + [Powerlevel9k] - (macOS)

Default

Default

Powerlevel9k

Powerlevel9k