Skip to content

Instantly share code, notes, and snippets.

@charz
charz / swift-expired-status
Last active October 5, 2020 08:43 — forked from clayg/swift-expired-status
check on the expirer queue
#!/usr/bin/env python
from collections import defaultdict
import sys
import time
import socket
from argparse import ArgumentParser
from swift.common.internal_client import InternalClient
from swift.common.utils import Timestamp
from swift.common.wsgi import ConfigString
@charz
charz / curlxid.sh
Last active February 9, 2021 07:42
curl with xid and time
#!/bin/bash
curlxidheaders() {
echo "number,timestamp,status_code,message,size,speed_bytes_per_sec,time_total,time_namelookup,time_connect,time_appconnect,time_pretransfer,time_redirect,time_starttransfer"
}
curlxid() {
curl -w 'code: %{http_code} %{http_connect}|size: %{size_download}|speed: %{speed_download}|total: %{time_total}, %{time_namelookup}, %{time_connect}, %{time_appconnect}, %{time_pretransfer}, %{time_redirect},%{time_starttransfer}' \
-s -o /dev/null -v "$@" 2>&1 | \
grep -E 'X-Trans-Id|total|Date:' | \