Skip to content

Instantly share code, notes, and snippets.

@tevino
tevino / epoll.go
Last active January 20, 2024 22:50
An example of using epoll in Go
package main
import (
"fmt"
"net"
"os"
"syscall"
)
const (
@brendangregg
brendangregg / gist:f8ed5345cfc903599a60
Created August 5, 2014 01:08
dynamic tracing of ZFS on Linux, on Linux

So I just found ZFS on my test Linux ubuntu system, and gave my perf-tools (https://github.com/brendangregg/perf-tools) a spin.

Per-second zfs* calls:

# ./funccount -Ti 1 'zfs*'
Tracing "zfs*"... Ctrl-C to end.

Tue Aug  5 00:51:41 UTC 2014
FUNC                              COUNT
@tcooper
tcooper / sdc_raw_libaio_direct.fio
Created March 7, 2014 18:27
FIO test script for raw device, ioengine=libaio, oflag=direct
[global]
ioengine=libaio
invalidate=1
ramp_time=30
iodepth=1
runtime=180
time_based
direct=1
[write-sdc-4k-seq]
@roxlu
roxlu / Connection.h
Created June 4, 2012 12:52
Basic libEvent TCP server/client wrapper
#ifndef LIBEVENT_CONNECTIONH
#define LIBEVENT_CONNECTIONH
extern "C" {
#include <event2/event.h>
#include <event2/buffer.h>
#include <event2/bufferevent.h>
}
#include <string>