Skip to content

Instantly share code, notes, and snippets.

@themarcelor
Created January 27, 2021 00:16
Show Gist options
  • Save themarcelor/584f2a247c5d40cb1030207262b7e1b4 to your computer and use it in GitHub Desktop.
Save themarcelor/584f2a247c5d40cb1030207262b7e1b4 to your computer and use it in GitHub Desktop.
import random, uuid
# metrics here
some_operation = Counter(
"my_metric_for_operation",
"This is the description of the metric",
["username", "guid", "requested_protocol"],
)
protocols = ["s3", "gs", "http"]
users = [f"user_{i}" for i in range(100)]
guids = [f"prefixBlah/{uuid.uuid4()}" for _ in range(1000)]
for _ in range(10000):
some_operation.labels(
random.choice(users),
random.choice(guids)
random.choice(protocols),
).inc()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment