Skip to content

Instantly share code, notes, and snippets.

View zhenwusw's full-sized avatar
🎯
Focusing

JZ zhenwusw

🎯
Focusing
View GitHub Profile
@zhenwusw
zhenwusw / redis-profile
Created March 26, 2014 02:23
Redis-profile
#!/usr/bin/env ruby
# Evaluates a sample of keys/values from each redis database, computing statistics for each key pattern:
# keys: number of keys matching the given pattern
# size: approximation of the associated memory occupied (based on size/length of value)
# percent: the proportion of this 'size' relative to the sample's total
#
# Copyright Weplay, Inc. 2010. Available for use under the MIT license.