Skip to content

Instantly share code, notes, and snippets.

View szaydel's full-sized avatar

Sam Zaydel szaydel

  • RackTop Systems
  • Moss Beach
View GitHub Profile
@szaydel
szaydel / ssspts-with-fio.sh
Created April 25, 2013 12:24
This is a shell script used to perform some limited representation of SSS TPS test with fio. Source: http://storagetuning.wordpress.com/2011/11/07/sssi-performance-test-specification/
#!/bin/bash
#This Script Runs through part of the SSSI PTS using fio as the test tool for section 7 IOPS
#By Jamon Bowen
#THIS IS PROVIDED AS IS WITH NO WARRANTIES
#THIS SCRIPT OVERWRITES DATA AND CAN CONTRIBUTE TO SSD WEAR OUT
#check to see if right number of parameters.
if [ $# -ne 1 ]
then
echo "Usage: $0 /dev/<device to test>"
exit
import zmq
import threading
import time
from random import choice
class ClientTask(threading.Thread):
"""ClientTask"""
def __init__(self):
threading.Thread.__init__ (self)
@szaydel
szaydel / arc_lat.sh
Last active December 17, 2015 10:08
#!/bin/bash
user_custom_limit=$1
var_def_limit='480'
var_limit=${user_custom_limit:-${var_def_limit}}
## var_slow=100 ## // Not needed in this script.
output_log=/root/arc-lat-$(date +"%Y%m%d").log
exec 1> $output_log
dtrace -qn 'inline int OPT_limit = '$var_limit'; BEGIN {cnt=0; } ::arc_adjust:entry { self->ts = timestamp } ::arc_adjust:return {@["Time (us):"] = quantize((timestamp - self->ts)/1000); self->ts = 0; } tick-60sec { cnt++; } tick-60sec / cnt > OPT_limit / {exit(0); } END {printa("%16s %@d\n", @)}'
#!/bin/bash
user_custom_limit=$1
var_def_limit='480'
var_limit=${user_custom_limit:-${var_def_limit}}
var_slow=100
output_log=/root/arc-lat-above-${var_slow}-$(date +"%Y%m%d").log
exec 1> $output_log
dtrace -qn '
#!/bin/bash
echo >/tmp/.diskinfo-1
echo >/tmp/.diskinfo
all_disks_list=
iostat_disk_details=
disk_info_cache_file=/tmp/.diskinfo
disk_info_cache=$(iostat -En > ${disk_info_cache_file})
disk_limit=10
#!/usr/bin/env bash
# Bash Stack
set -o errtrace
set -o errexit
set -o nounset
declare -a stack
@szaydel
szaydel / dtr_zfs_top_15.sh
Last active December 17, 2015 12:59
Every 5 seconds print top 15 functions in the fbt:zfs::* probes. This will return a large number of probes. Every 60 seconds we increase our conter by one, and after 480 iterations (8 hours) we exit. Setting $1 to a number will control the number of iterations allowed.
#!/bin/bash
name=${0/.sh}
user_custom_limit=$1
var_def_limit='480'
var_limit=${user_custom_limit:-${var_def_limit}}
output_log=/root/$name-$(date +"%Y%m%d").log
exec 1> $output_log
dtrace -qn '
@szaydel
szaydel / sys-info.sh
Created May 21, 2013 21:12
Basic high-level system state information.
#!/bin/bash
dt=$(date +"%Y%m%d")
hn=$(hostname)
commands=(
"zfs list"
"zfs get all"
"zpool list"
"zpool status"
@szaydel
szaydel / genio-info.sh
Last active December 17, 2015 14:29
Very generic information about IO, using io:::start probe. Looking for min, max, avg, and other details.
#!/bin/bash
name=${0/.sh}
user_custom_limit=$1
var_def_limit='100'
var_limit=${user_custom_limit:-${var_def_limit}}
output_log=/root/$name-${var_limit}-$(date +"%Y%m%d").log
exec 1> $output_log
dtrace -qn '
#!/bin/bash
( while read L
do echo $L > /tmp/pubkey
printf "%-16s => " $(cut -f 3 -d ' ' /tmp/pubkey)
ssh-keygen -l -f /tmp/pubkey
done
rm /tmp/pubkey
) < .ssh/authorized_keys