Skip to content

Instantly share code, notes, and snippets.

View maguec's full-sized avatar

Chris Mague maguec

View GitHub Profile
@maguec
maguec / gist:5549dbb236ef89130803b68a707b4698
Created March 18, 2024 15:55
redis_keyspace_by_app_prefix.py
#!/usr/bin/env python
## This script*will* slow down the Redis server. Run with caution!!
app_keys = {}
app_size = {}
app_ttls = {}
from redis import StrictRedis
redis = StrictRedis.from_url("redis://localhost:6379")
@maguec
maguec / fakeupjson.go
Created August 26, 2023 16:12
GoFakeIt to JSON file example
package main
import (
"encoding/json"
"os"
"github.com/brianvoe/gofakeit/v6"
)
type Record struct {
@maguec
maguec / sub.go
Created March 4, 2022 21:32
Redis pub/sub benchmark subscriber
package main
import (
"context"
"fmt"
"os"
"time"
"github.com/go-redis/redis/v8"
"github.com/pborman/getopt/v2"
@maguec
maguec / pub.go
Created March 4, 2022 21:31
Redis pub/sub benchmark publisher
package main
import (
"context"
"crypto/sha256"
"fmt"
"log"
"os"
"strconv"
"time"
@maguec
maguec / memtier_list_by_stat.py
Created January 28, 2022 18:05
print a table
#!/usr/bin/python
import sys
import json
import glob
def print_help(x):
print("Usage: <path> <stat>")
print("\t Stats: {}".format(",".join(x)))
@maguec
maguec / multiple_planes_to_gnuplot.py
Created January 28, 2022 17:59
Creating a 3d gnuplot file
#!/usr/bin/python
import sys
import json
import glob
x_axis = 'threads'
y_axis = 'clients'
z_axis = 'Ops/sec'
{
"title": "ACRE",
"description": "",
"widgets": [
{
"id": 1426048574507798,
"definition": {
"type": "image",
"url": "https://images.g2crowd.com/uploads/product/image/social_landscape/social_landscape_41977d19e7b55aacdaec9fa50510761b/redis-enterprise.png",
"sizing": "contain",
package main
import (
"fmt"
"github.com/gomodule/redigo/redis"
)
func main() {
pool := &redis.Pool{
package main
import (
"context"
"fmt"
"time"
"github.com/go-redis/redis/v8"
)
#!/usr/bin/env python
import json
import glob
print ("#{:<4} {:<4} {:<15}".format("X: clients", "Y: threads", "Z: Ops/sec"))
for j in glob.glob('*.json'):
f = open(j)
try: