Skip to content

Instantly share code, notes, and snippets.

View marcusleemitchell's full-sized avatar
:octocat:
Socially Distanced Coding

Marcus Mitchell marcusleemitchell

:octocat:
Socially Distanced Coding
View GitHub Profile
#!/usr/bin/env ruby
require 'net/telnet'
cache_dump_limit = 100
localhost = Net::Telnet::new("Host" => "127.0.0.1", "Port" => 11211, "Timeout" => 3)
slab_ids = []
localhost.cmd("String" => "stats items", "Match" => /^END/) do |c|
matches = c.scan(/STAT items:(\d+):/)
slab_ids = matches.flatten.uniq
end