Commit Graph

90 Commits

Author SHA1 Message Date
92a7b0102c redis-cli: --latency-history mode implemented. 2013-04-11 13:19:33 +02:00
5576a28977 redis-cli --stat, stolen from redis-tools.
Redis-tools is a connection of tools no longer mantained that was
intented as a way to economically make sense of Redis in the pre-vmware
sponsorship era. However there was a nice redis-stat utility, this
commit imports one of the functionalities of this tool here in redis-cli
as it seems to be pretty useful.

Usage: redis-cli --stat

The output is similar to vmstat in the format, but with Redis specific
stuff of course.

From the point of view of the monitored instance, only INFO is used in
order to grab data.
2013-03-25 11:52:32 +01:00
f93d9929d8 redis-cli --bigkeys: don't crash with empty DBs. 2013-03-12 09:57:49 +01:00
95fc9cc0a6 redis-cli: use sdsfreesplitres() instead of hand-coding it. 2013-03-06 12:44:23 +01:00
e9318d92db redis-cli: use keepalive socket option.
This should improve things in two ways:

1) Prevent timeouts caused by the execution of long commands.
2) Improve detection of real connection errors.

This is mostly effective only on Linux because of the bogus default
keepalive settings. In Linux we have OS-specific calls to set the
keepalive interval to reasonable values.
2013-03-04 11:16:24 +01:00
bfad381f57 redis-cli --bigkeys output is now simpler to understand. 2013-01-21 19:16:14 +01:00
560e049947 Fixed many typos. 2013-01-19 11:08:43 +01:00
c2b43eac4f redis-cli prompt bug fix 2013-01-19 10:34:25 +01:00
5e2aa2cafb Always exit if connection fails.
This avoids unnecessary core dumps. Fixes antirez/redis#894
2013-01-19 10:29:51 +01:00
0f4dbd9a11 redis-cli --rdb fails if server sends a ping
Redis pings slaves in "pre-synchronization stage" with newlines. (See
https://github.com/antirez/redis/blob/2.6.9/src/replication.c#L814)
However, redis-cli does not expect this - it sees the newline as the end
of the bulk length line, and ends up returning 0 as bulk the length.
This manifests as the following when running redis-cli:

    $ ./src/redis-cli --rdb some_file
    SYNC sent to master, writing 0 bytes to 'some_file'
    Transfer finished with success.

With this commit, we just ignore leading newlines while reading the bulk
length line.

To reproduce the problem, load enough data into Redis so that the
preparation of the RDB snapshot takes long enough for a ping to occur
while redis-cli is waiting for the data.
2013-01-18 11:49:58 +01:00
52f6a1dc16 redis-cli: save an RDB dump from remote server to local file. 2013-01-16 19:48:26 +01:00
4468ba2317 Fix overflow in mstime() in redis-cli and benchmark.
The problem does not exist in the Redis server implementation of mstime()
but is only limited to redis-cli and redis-benchmark.

Thix fixes issue #839.
2012-12-20 15:21:37 +01:00
d288ee655f BSD license added to every C source and header file. 2012-11-08 18:33:13 +01:00
889e443ce5 Check that we have connection before enabling pipe mode 2012-07-22 17:19:05 +02:00
e612508d38 Standardize punctuation in redis-cli help.
Right there is a mix of help entries ending with periods or
without periods. This standardizes the end of command as without
periods, which seems to be the general custom in most unix tools,
at least.
2012-06-13 10:27:23 +02:00
e67d014d9a Added time.h include in redis-cli.
redis-cli.c uses the time() function to seed the PRNG, but time.h was
not included. This was not noticed since sys/time.h is included and was
enough in most systems (but not correct). With Ubuntu 12.04 GCC
generates a warning that made us aware of the issue.
2012-05-14 17:43:31 +02:00
25496f4700 redis-cli pipe mode: handle EINTR properly as well so that SIGSTOP/SIGCONT are handled correctly. 2012-05-12 09:33:15 +02:00
346825c7ed redis-cli pipe mode: handle EAGAIN while writing to socket. 2012-05-12 09:33:11 +02:00
dd4e8203b2 redis-cli --pipe for mass import. 2012-05-12 09:33:06 +02:00
9de5d4600a A few compiler warnings suppressed. 2012-04-24 19:35:03 +02:00
0122cc4f42 redis-cli --bigkeys output modified to be simpler to read.. 2012-04-18 21:23:42 +02:00
e10768518c redis-cli --bigkeys 2012-04-18 21:23:39 +02:00
24b0942275 Suppress warnings compiling redis-cli with certain gcc versions. 2012-03-19 19:29:06 +01:00
60893c6cc6 redis-cli: CSV output added, used for the --slave mode. 2012-02-29 17:43:06 +01:00
b8283ab218 Initial implementation of redis-cli --slave support. 2012-02-29 17:10:21 +01:00
a5bd08487f Fix for issue #306, thanks to tchajed (on github) for the pull request. The original patch was reworked a bit. 2012-02-22 16:07:06 +01:00
4eb3b3e970 Redis-cli should accept help command even if there is no connection to the server. 2012-02-22 15:16:11 +01:00
e2f313899b redis-cli --eval implemented 2011-12-13 16:22:28 +01:00
db6a2e7f78 Fixed a memory leak in redis-cli.c 2011-10-28 17:43:04 +02:00
623131d408 Totally hackish and dirty, but working, support for Redis Cluster in redis-cli 2011-10-05 19:55:33 +02:00
7c748c061e Merge pull request #97 from jvain/redis-cli
redis-cli segfaults with single numeric argument greater than zero
2011-09-21 13:32:24 -07:00
aee7f99760 fixed a small bug that caused redis-cli to segfault when given single numeric parameter greater that zero. 2011-09-21 23:22:14 +03:00
96674b6d95 Fixed a bug in the average latency metering of redis-cli --latency 2011-09-15 19:33:24 +02:00
43071993e1 Implemented --latency in redis-cli 2011-09-15 19:28:00 +02:00
18f63d8d51 redis-cli: -i (interval) implemented, to wait the specified number of seconds (decimal digits are allowed) between commands. 2011-05-28 15:41:08 +02:00
442c748d84 redis-cli: Use the repetiton prefix after a reconnection. 2011-05-28 15:25:48 +02:00
4d19e3443c redis-cli in REPL mode is now able to send the same command multiple times, prefixing the command with a number as in "10 ping" 2011-05-28 15:13:55 +02:00
a45f9a1a1d redis-cli no longer aborts in repl-mode on error, and retries to reconncet with the server at every command issued if the state is not connected. Also the prompt shows the server we are connected to. 2011-05-28 15:04:12 +02:00
3cd12b5687 CLIENT LIST implemented 2011-04-21 15:38:02 +02:00
ecc9109434 Cluster branch merged to unstable. 2011-03-29 17:51:15 +02:00
3f4eef215b Show database number in cli prompt when non-zero 2011-03-06 21:14:40 +01:00
96e34b3ce1 Store SELECTed database for reconnect (issue #468) 2011-03-06 20:46:49 +01:00
33753a732a Minor memory leak in redis-cli (issue #464) 2011-03-06 20:13:01 +01:00
ca36b4ab31 Only save history when stdin is a tty (issue #465) 2011-03-06 20:02:33 +01:00
8ce39260a4 Fix compiler warnings on Solaris 2010-12-23 11:26:11 +00:00
28c07c7bf8 Specify multi-bulk delimiter via options 2010-12-15 16:02:07 +01:00
65add0a311 Improved raw output mode
Raw output mode is selected by default when STDOUT is not a tty. For
ttys, raw output can be forced using the option "--raw".
2010-12-15 15:59:06 +01:00
f18e059e82 Make redis-cli help a little better 2010-12-15 15:00:47 +01:00
c392edf531 Show redis-cli version with repository information if present 2010-12-15 14:34:05 +01:00
bbac56c2f8 added support for ctrl-l and clear command into redis-cli. To clear the screen is a good idea from time to time :). Also linenoise updated to the current version to support this new feature. 2010-12-01 11:18:59 +01:00