Last active
March 23, 2016 23:38
-
-
Save tormaroe/51658d764d45296b283e to your computer and use it in GitHub Desktop.
CL Redis DOB metrics test data
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (ql:quickload :cl-redis) | |
| (redis:connect :port 7777) | |
| (red:select 9) | |
| (defvar *start* 201603231200) | |
| (defvar *end* 201603231259) | |
| (defvar *bu-names* '( | |
| "Bangladesh" | |
| "Bulgaria" | |
| "Hungary" | |
| "Malaysia" | |
| "Myanmar" | |
| "Norway" | |
| "Pakistan" | |
| "Serbia" | |
| "Strex" | |
| "Sweden" | |
| "Thailand" | |
| "Thailand-dtn" | |
| "WyWallet" | |
| "4T")) | |
| (defun make-stats (bu result max-pr-min) | |
| (loop for time from *start* to *end* | |
| do (red:hincrby | |
| (format nil "ea_~a" time) | |
| (format nil "~a.AUTH.~a" bu result) | |
| (random max-pr-min)))) | |
| (defun clean () | |
| (loop for time from *start* to *end* | |
| do (red:del (format nil "ea_~a" time)))) | |
| (loop for bu in *bu-names* | |
| do (progn | |
| (make-stats bu "SUCCESS" (1+ (random 100))) | |
| (make-stats bu "RETRIABLE_ERROR" (1+ (random 10))) | |
| (make-stats bu "GENERAL_FAILURE" (1+ (random 2))) | |
| (make-stats bu "INVALID_USER" (1+ (random 20))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment