Skip to content

Instantly share code, notes, and snippets.

View smerritt's full-sized avatar

Sam Merritt smerritt

View GitHub Profile
#!/bin/bash
set -e
CONTAINER="ds-test"
echo "Test setup"
# Set up some data segments (these are just plain objects)
TOKEN="`swift stat -v | grep "Auth Token" | cut -d : -f 2`"
STORAGE_URL="`swift stat -v | grep "StorageURL" | cut -d : -f 2,3,4,5,6`"
@smerritt
smerritt / gist:7605771
Last active June 17, 2017 21:23
OpenStack Swift code review checklist
* Are there tests? Do the new tests fail if the code is reverted?
* Does it work? There's no such thing as obviously correct, as I've had to learn again and again.
* Check the coverage report; is any new code uncovered? (This might be okay, but take a look.)
* How's the logging?
* Read all the tests; any leftover debugging cruft? Print statements seem particularly common.
== 1.2.4 Flaming Astroboy
== 1.2.2 I Find Your Lack of Sauce Disturbing
== 1.2.1 Asynctilicious Ultra Supreme
== 1.2.0 Asynctilicious Supreme
== 1.1.1 Super Disco Power Plus
== 1.1.0 Super Disco Power
== 1.0.0 That's What She Said
== 0.8.2 Double Margarita
== 0.8.1 Rebel Porpoise
== 0.8.0 Dodgy Dentist

Keybase proof

I hereby claim:

  • I am smerritt on github.
  • I am torgomatic (https://keybase.io/torgomatic) on keybase.
  • I have a public key whose fingerprint is 0884 5E48 A250 564F 5906 892D C21B C799 8554 5617

To claim this, I am signing this object:

#!/usr/bin/env python
import benchmark
from swift.container.backend import ContainerBroker
class BenchmarkListingOperations(benchmark.Benchmark):
def setUp(self):
self.broker = ContainerBroker("big-container-db/big.db",
account='big-a', container='big-c')
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Benchmark the relative performance of stdlib's json, simplejson, and
# a wrapped simplejson that gives the same API as stdlib's json.
import benchmark
import hashlib
import json as stdjson
import simplejson
#!/usr/bin/env python
import benchmark
import heapq
class BenchHeapq(benchmark.Benchmark):
def eachSetUp(self):
self.size = 500
#!/usr/bin/env python
import os
from swift.common.utils import get_logger
NLOGGERS = 500
for _ in xrange(NLOGGERS):
get_logger({})
@smerritt
smerritt / results
Created September 19, 2013 20:06
bench more queue stuff, now with differences between sleeps and full queues
#!/usr/bin/env python
import benchmark
import Queue
import os
import subprocess
import tempfile
import time
import threading
#!/usr/bin/env python
import benchmark
import Queue
import threading
import os
class BenchQueueStuff(benchmark.Benchmark):
def setUp(self):