-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #171 from codecrafters-io/add-logging
Add HexDump logging for RDB files
- Loading branch information
Showing
12 changed files
with
615 additions
and
287 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,21 @@ | ||
Debug = true | ||
|
||
[33m[stage-13] [0m[94mRunning tests for Stage #13: sm4[0m | ||
[33m[stage-13] [0m[94m$ ./spawn_redis_server.sh --dir /private/var/folders/5l/z5y3dkwn68sgb6htzc5w7vnm0000gn/T/rdbfiles2910760570 --dbfilename pear.rdb[0m | ||
[33m[stage-13] [0m[94mCreated RDB file with 3 key-value pairs: {"orange": "strawberry", "mango": "apple", "pineapple": "blueberry"}[0m | ||
[33m[stage-13] [0m[36mHexdump of RDB file contents: [0m | ||
[33m[stage-13] [0m[36mIdx | Hex | ASCII[0m | ||
[33m[stage-13] [0m[36m-----+-------------------------------------------------+-----------------[0m | ||
[33m[stage-13] [0m[36m0000 | 52 45 44 49 53 30 30 31 31 fa 09 72 65 64 69 73 | REDIS0011..redis[0m | ||
[33m[stage-13] [0m[36m0010 | 2d 76 65 72 05 37 2e 32 2e 30 fa 0a 72 65 64 69 | -ver.7.2.0..redi[0m | ||
[33m[stage-13] [0m[36m0020 | 73 2d 62 69 74 73 c0 40 fe 00 fb 03 03 fc 00 0c | s-bits.@........[0m | ||
[33m[stage-13] [0m[36m0030 | 28 8a c7 01 00 00 00 06 6f 72 61 6e 67 65 0a 73 | (.......orange.s[0m | ||
[33m[stage-13] [0m[36m0040 | 74 72 61 77 62 65 72 72 79 fc 00 9c ef 12 7e 01 | trawberry.....~.[0m | ||
[33m[stage-13] [0m[36m0050 | 00 00 00 05 6d 61 6e 67 6f 05 61 70 70 6c 65 fc | ....mango.apple.[0m | ||
[33m[stage-13] [0m[36m0060 | 00 0c 28 8a c7 01 00 00 00 09 70 69 6e 65 61 70 | ..(.......pineap[0m | ||
[33m[stage-13] [0m[36m0070 | 70 6c 65 09 62 6c 75 65 62 65 72 72 79 ff 34 d0 | ple.blueberry.4.[0m | ||
[33m[stage-13] [0m[36m0080 | 8c 58 51 4a 5d 62 0a | .XQJ]b.[0m | ||
[33m[stage-13] [0m[36m[0m | ||
[33m[stage-13] [0m[94m$ ./spawn_redis_server.sh --dir /private/var/folders/5l/z5y3dkwn68sgb6htzc5w7vnm0000gn/T/rdbfiles444689312 --dbfilename pear.rdb[0m | ||
[33m[stage-13] [0m[94mclient: $ redis-cli GET orange[0m | ||
[33m[stage-13] [0m[36mclient: Sent bytes: "*2\r\n$3\r\nGET\r\n$6\r\norange\r\n"[0m | ||
[33m[stage-13] [0m[36mclient: Received bytes: "$10\r\nstrawberry\r\n"[0m | ||
|
@@ -22,8 +36,21 @@ Debug = true | |
[33m[stage-13] [0m[36mProgram terminated successfully[0m | ||
|
||
[33m[stage-12] [0m[94mRunning tests for Stage #12: dq3[0m | ||
[33m[stage-12] [0m[94mCreated RDB file with key-value pairs: "grape"="pineapple", "apple"="raspberry", "banana"="apple", "mango"="orange", "orange"="pear"[0m | ||
[33m[stage-12] [0m[94m$ ./spawn_redis_server.sh --dir /private/var/folders/5l/z5y3dkwn68sgb6htzc5w7vnm0000gn/T/rdbfiles2724103995 --dbfilename raspberry.rdb[0m | ||
[33m[stage-12] [0m[94mCreated RDB file with 5 key-value pairs: {"grape": "pineapple", "apple": "raspberry", "banana": "apple", "mango": "orange", "orange": "pear"}[0m | ||
[33m[stage-12] [0m[36mHexdump of RDB file contents: [0m | ||
[33m[stage-12] [0m[36mIdx | Hex | ASCII[0m | ||
[33m[stage-12] [0m[36m-----+-------------------------------------------------+-----------------[0m | ||
[33m[stage-12] [0m[36m0000 | 52 45 44 49 53 30 30 31 31 fa 09 72 65 64 69 73 | REDIS0011..redis[0m | ||
[33m[stage-12] [0m[36m0010 | 2d 76 65 72 05 37 2e 32 2e 30 fa 0a 72 65 64 69 | -ver.7.2.0..redi[0m | ||
[33m[stage-12] [0m[36m0020 | 73 2d 62 69 74 73 c0 40 fe 00 fb 05 00 00 05 67 | [email protected][0m | ||
[33m[stage-12] [0m[36m0030 | 72 61 70 65 09 70 69 6e 65 61 70 70 6c 65 00 05 | rape.pineapple..[0m | ||
[33m[stage-12] [0m[36m0040 | 61 70 70 6c 65 09 72 61 73 70 62 65 72 72 79 00 | apple.raspberry.[0m | ||
[33m[stage-12] [0m[36m0050 | 06 62 61 6e 61 6e 61 05 61 70 70 6c 65 00 05 6d | .banana.apple..m[0m | ||
[33m[stage-12] [0m[36m0060 | 61 6e 67 6f 06 6f 72 61 6e 67 65 00 06 6f 72 61 | ango.orange..ora[0m | ||
[33m[stage-12] [0m[36m0070 | 6e 67 65 04 70 65 61 72 ff 33 20 d4 0d 23 b2 9b | nge.pear.3 ..#..[0m | ||
[33m[stage-12] [0m[36m0080 | af 0a | ..[0m | ||
[33m[stage-12] [0m[36m[0m | ||
[33m[stage-12] [0m[94m$ ./spawn_redis_server.sh --dir /private/var/folders/5l/z5y3dkwn68sgb6htzc5w7vnm0000gn/T/rdbfiles3255364286 --dbfilename raspberry.rdb[0m | ||
[33m[stage-12] [0m[94mclient: $ redis-cli GET grape[0m | ||
[33m[stage-12] [0m[36mclient: Sent bytes: "*2\r\n$3\r\nGET\r\n$5\r\ngrape\r\n"[0m | ||
[33m[stage-12] [0m[36mclient: Received bytes: "$9\r\npineapple\r\n"[0m | ||
|
@@ -54,20 +81,40 @@ Debug = true | |
[33m[stage-12] [0m[36mProgram terminated successfully[0m | ||
|
||
[33m[stage-11] [0m[94mRunning tests for Stage #11: jw4[0m | ||
[33m[stage-11] [0m[94mCreated RDB file with 3 keys: ["banana" "apple" "blueberry"][0m | ||
[33m[stage-11] [0m[94m$ ./spawn_redis_server.sh --dir /private/var/folders/5l/z5y3dkwn68sgb6htzc5w7vnm0000gn/T/rdbfiles2441645913 --dbfilename blueberry.rdb[0m | ||
[33m[stage-11] [0m[94mCreated RDB file with 3 keys: ["banana", "apple", "blueberry"][0m | ||
[33m[stage-11] [0m[36mHexdump of RDB file contents: [0m | ||
[33m[stage-11] [0m[36mIdx | Hex | ASCII[0m | ||
[33m[stage-11] [0m[36m-----+-------------------------------------------------+-----------------[0m | ||
[33m[stage-11] [0m[36m0000 | 52 45 44 49 53 30 30 31 31 fa 09 72 65 64 69 73 | REDIS0011..redis[0m | ||
[33m[stage-11] [0m[36m0010 | 2d 76 65 72 05 37 2e 32 2e 30 fa 0a 72 65 64 69 | -ver.7.2.0..redi[0m | ||
[33m[stage-11] [0m[36m0020 | 73 2d 62 69 74 73 c0 40 fe 00 fb 03 00 00 06 62 | [email protected][0m | ||
[33m[stage-11] [0m[36m0030 | 61 6e 61 6e 61 09 70 69 6e 65 61 70 70 6c 65 00 | anana.pineapple.[0m | ||
[33m[stage-11] [0m[36m0040 | 05 61 70 70 6c 65 09 72 61 73 70 62 65 72 72 79 | .apple.raspberry[0m | ||
[33m[stage-11] [0m[36m0050 | 00 09 62 6c 75 65 62 65 72 72 79 04 70 65 61 72 | ..blueberry.pear[0m | ||
[33m[stage-11] [0m[36m0060 | ff 5c f3 42 ee 46 08 a6 3f 0a | .\.B.F..?.[0m | ||
[33m[stage-11] [0m[36m[0m | ||
[33m[stage-11] [0m[94m$ ./spawn_redis_server.sh --dir /private/var/folders/5l/z5y3dkwn68sgb6htzc5w7vnm0000gn/T/rdbfiles2441884045 --dbfilename blueberry.rdb[0m | ||
[33m[stage-11] [0m[94mclient: $ redis-cli KEYS *[0m | ||
[33m[stage-11] [0m[36mclient: Sent bytes: "*2\r\n$4\r\nKEYS\r\n$1\r\n*\r\n"[0m | ||
[33m[stage-11] [0m[36mclient: Received bytes: "*3\r\n$6\r\nbanana\r\n$9\r\nblueberry\r\n$5\r\napple\r\n"[0m | ||
[33m[stage-11] [0m[36mclient: Received RESP array: ["banana", "blueberry", "apple"][0m | ||
[33m[stage-11] [0m[92mReceived ["banana", "blueberry", "apple"][0m | ||
[33m[stage-11] [0m[36mclient: Received bytes: "*3\r\n$6\r\nbanana\r\n$5\r\napple\r\n$9\r\nblueberry\r\n"[0m | ||
[33m[stage-11] [0m[36mclient: Received RESP array: ["banana", "apple", "blueberry"][0m | ||
[33m[stage-11] [0m[92mReceived ["banana", "apple", "blueberry"][0m | ||
[33m[stage-11] [0m[92mTest passed.[0m | ||
[33m[stage-11] [0m[36mTerminating program[0m | ||
[33m[stage-11] [0m[36mProgram terminated successfully[0m | ||
|
||
[33m[stage-10] [0m[94mRunning tests for Stage #10: gc6[0m | ||
[33m[stage-10] [0m[94mCreated RDB file with single key-value pair: grape="pineapple"[0m | ||
[33m[stage-10] [0m[94m$ ./spawn_redis_server.sh --dir /private/var/folders/5l/z5y3dkwn68sgb6htzc5w7vnm0000gn/T/rdbfiles3729886679 --dbfilename orange.rdb[0m | ||
[33m[stage-10] [0m[94mCreated RDB file with a single key-value pair: {"grape": "pineapple"}[0m | ||
[33m[stage-10] [0m[36mHexdump of RDB file contents: [0m | ||
[33m[stage-10] [0m[36mIdx | Hex | ASCII[0m | ||
[33m[stage-10] [0m[36m-----+-------------------------------------------------+-----------------[0m | ||
[33m[stage-10] [0m[36m0000 | 52 45 44 49 53 30 30 31 31 fa 09 72 65 64 69 73 | REDIS0011..redis[0m | ||
[33m[stage-10] [0m[36m0010 | 2d 76 65 72 05 37 2e 32 2e 30 fa 0a 72 65 64 69 | -ver.7.2.0..redi[0m | ||
[33m[stage-10] [0m[36m0020 | 73 2d 62 69 74 73 c0 40 fe 00 fb 01 00 00 05 67 | [email protected][0m | ||
[33m[stage-10] [0m[36m0030 | 72 61 70 65 09 70 69 6e 65 61 70 70 6c 65 ff 12 | rape.pineapple..[0m | ||
[33m[stage-10] [0m[36m0040 | 7d 54 51 cd 7a 5c 8d 0a | }TQ.z\..[0m | ||
[33m[stage-10] [0m[36m[0m | ||
[33m[stage-10] [0m[94m$ ./spawn_redis_server.sh --dir /private/var/folders/5l/z5y3dkwn68sgb6htzc5w7vnm0000gn/T/rdbfiles3226033919 --dbfilename orange.rdb[0m | ||
[33m[stage-10] [0m[94mclient: $ redis-cli GET grape[0m | ||
[33m[stage-10] [0m[36mclient: Sent bytes: "*2\r\n$3\r\nGET\r\n$5\r\ngrape\r\n"[0m | ||
[33m[stage-10] [0m[36mclient: Received bytes: "$9\r\npineapple\r\n"[0m | ||
|
@@ -78,8 +125,17 @@ Debug = true | |
[33m[stage-10] [0m[36mProgram terminated successfully[0m | ||
|
||
[33m[stage-9] [0m[94mRunning tests for Stage #9: jz6[0m | ||
[33m[stage-9] [0m[94mCreated RDB file with single key: "mango"[0m | ||
[33m[stage-9] [0m[94m$ ./spawn_redis_server.sh --dir /private/var/folders/5l/z5y3dkwn68sgb6htzc5w7vnm0000gn/T/rdbfiles3049301350 --dbfilename pear.rdb[0m | ||
[33m[stage-9] [0m[94mCreated RDB file with a single key: ["mango"][0m | ||
[33m[stage-9] [0m[36mHexdump of RDB file contents: [0m | ||
[33m[stage-9] [0m[36mIdx | Hex | ASCII[0m | ||
[33m[stage-9] [0m[36m-----+-------------------------------------------------+-----------------[0m | ||
[33m[stage-9] [0m[36m0000 | 52 45 44 49 53 30 30 31 31 fa 09 72 65 64 69 73 | REDIS0011..redis[0m | ||
[33m[stage-9] [0m[36m0010 | 2d 76 65 72 05 37 2e 32 2e 30 fa 0a 72 65 64 69 | -ver.7.2.0..redi[0m | ||
[33m[stage-9] [0m[36m0020 | 73 2d 62 69 74 73 c0 40 fe 00 fb 01 00 00 05 6d | [email protected][0m | ||
[33m[stage-9] [0m[36m0030 | 61 6e 67 6f 09 70 69 6e 65 61 70 70 6c 65 ff 0c | ango.pineapple..[0m | ||
[33m[stage-9] [0m[36m0040 | 1b cb 91 b2 ed f6 19 0a | ........[0m | ||
[33m[stage-9] [0m[36m[0m | ||
[33m[stage-9] [0m[94m$ ./spawn_redis_server.sh --dir /private/var/folders/5l/z5y3dkwn68sgb6htzc5w7vnm0000gn/T/rdbfiles1527538990 --dbfilename pear.rdb[0m | ||
[33m[stage-9] [0m[94mclient: $ redis-cli KEYS *[0m | ||
[33m[stage-9] [0m[36mclient: Sent bytes: "*2\r\n$4\r\nKEYS\r\n$1\r\n*\r\n"[0m | ||
[33m[stage-9] [0m[36mclient: Received bytes: "*1\r\n$5\r\nmango\r\n"[0m | ||
|
@@ -90,12 +146,12 @@ Debug = true | |
[33m[stage-9] [0m[36mProgram terminated successfully[0m | ||
|
||
[33m[stage-8] [0m[94mRunning tests for Stage #8: zg5[0m | ||
[33m[stage-8] [0m[94m$ ./spawn_redis_server.sh --dir /private/var/folders/5l/z5y3dkwn68sgb6htzc5w7vnm0000gn/T/rdbfiles778895138 --dbfilename blueberry.rdb[0m | ||
[33m[stage-8] [0m[94m$ ./spawn_redis_server.sh --dir /private/var/folders/5l/z5y3dkwn68sgb6htzc5w7vnm0000gn/T/rdbfiles2714192117 --dbfilename blueberry.rdb[0m | ||
[33m[stage-8] [0m[94mclient: $ redis-cli CONFIG GET dir[0m | ||
[33m[stage-8] [0m[36mclient: Sent bytes: "*3\r\n$6\r\nCONFIG\r\n$3\r\nGET\r\n$3\r\ndir\r\n"[0m | ||
[33m[stage-8] [0m[36mclient: Received bytes: "*2\r\n$3\r\ndir\r\n$74\r\n/private/var/folders/5l/z5y3dkwn68sgb6htzc5w7vnm0000gn/T/rdbfiles778895138\r\n"[0m | ||
[33m[stage-8] [0m[36mclient: Received RESP array: ["dir", "/private/var/folders/5l/z5y3dkwn68sgb6htzc5w7vnm0000gn/T/rdbfiles778895138"][0m | ||
[33m[stage-8] [0m[92mReceived ["dir", "/private/var/folders/5l/z5y3dkwn68sgb6htzc5w7vnm0000gn/T/rdbfiles778895138"][0m | ||
[33m[stage-8] [0m[36mclient: Received bytes: "*2\r\n$3\r\ndir\r\n$75\r\n/private/var/folders/5l/z5y3dkwn68sgb6htzc5w7vnm0000gn/T/rdbfiles2714192117\r\n"[0m | ||
[33m[stage-8] [0m[36mclient: Received RESP array: ["dir", "/private/var/folders/5l/z5y3dkwn68sgb6htzc5w7vnm0000gn/T/rdbfiles2714192117"][0m | ||
[33m[stage-8] [0m[92mReceived ["dir", "/private/var/folders/5l/z5y3dkwn68sgb6htzc5w7vnm0000gn/T/rdbfiles2714192117"][0m | ||
[33m[stage-8] [0m[92mTest passed.[0m | ||
[33m[stage-8] [0m[36mTerminating program[0m | ||
[33m[stage-8] [0m[36mProgram terminated successfully[0m | ||
|
@@ -107,15 +163,15 @@ Debug = true | |
[33m[stage-7] [0m[36mReceived bytes: "+OK\r\n"[0m | ||
[33m[stage-7] [0m[36mReceived RESP simple string: "OK"[0m | ||
[33m[stage-7] [0m[92mReceived "OK"[0m | ||
[33m[stage-7] [0m[92mReceived OK at 16:13:08.183[0m | ||
[33m[stage-7] [0m[94mFetching key "strawberry" at 16:13:08.183 (should not be expired)[0m | ||
[33m[stage-7] [0m[92mReceived OK at 16:31:40.207[0m | ||
[33m[stage-7] [0m[94mFetching key "strawberry" at 16:31:40.207 (should not be expired)[0m | ||
[33m[stage-7] [0m[94m> GET strawberry[0m | ||
[33m[stage-7] [0m[36mSent bytes: "*2\r\n$3\r\nGET\r\n$10\r\nstrawberry\r\n"[0m | ||
[33m[stage-7] [0m[36mReceived bytes: "$4\r\npear\r\n"[0m | ||
[33m[stage-7] [0m[36mReceived RESP bulk string: "pear"[0m | ||
[33m[stage-7] [0m[92mReceived "pear"[0m | ||
[33m[stage-7] [0m[36mSleeping for 101ms[0m | ||
[33m[stage-7] [0m[94mFetching key "strawberry" at 16:13:08.286 (should be expired)[0m | ||
[33m[stage-7] [0m[94mFetching key "strawberry" at 16:31:40.311 (should be expired)[0m | ||
[33m[stage-7] [0m[94m> GET strawberry[0m | ||
[33m[stage-7] [0m[36mSent bytes: "*2\r\n$3\r\nGET\r\n$10\r\nstrawberry\r\n"[0m | ||
[33m[stage-7] [0m[36mReceived bytes: "$-1\r\n"[0m | ||
|
Oops, something went wrong.