141 Commits

Author SHA1 Message Date
antirez
08ad51762b redis-cli --stat: show LOAD when loading. 2015-02-11 11:01:46 +01:00
Charles Hooper
3a0e69f391 override histfile from env - fixes #831 and copies #833 2015-02-10 14:52:32 +01:00
antirez
c3a5ad2018 redis-cli --lru-test implemented (cache workload simulator). 2015-02-10 14:51:25 +01:00
antirez
4793ea982a redis-cli: interactive reconnection for latency modes.
--stat mode already used to reconnect automatically if the server is no
longer available. This is useful since this is an interactive mode used
for debugging, however the same applies to --latency and --latency-dist
modes, so now both use the reconnecting command execution as well.

The reconnection code was modified to use basic VT100 escape sequences
in order to play better with different kinds of output on the screen
when the reconnection happens, and to hide the reconnection attempt
output when finally the reconnection happens.
2015-02-10 14:51:25 +01:00
antirez
9a4d71e92e redis-cli --latecy-dist reverted to gray scale.
So far not able to find a color palette within the 256 colors which is
not confusing. However I believe it is a possible task, so will try
better later.
2015-02-10 14:51:25 +01:00
antirez
ad9976cd90 redis-cli --latency-dist now uses a color palette.
Still not happy with the result but low grays are hard to see in certain
monitors with a non perfect gamma.
2015-02-10 14:51:25 +01:00
antirez
b857578ba2 redis-cli latency dist: add new top HL. 2015-02-10 14:51:25 +01:00
antirez
630634a37a Add missing latency-dest legend symbol. 2015-02-10 14:51:25 +01:00
antirez
cdf30ba8c7 Initial implementation of redis-cli --latency-dist. 2015-02-10 14:51:25 +01:00
mattcollier
7db39b7fd3 Update redis-cli.c
Code was adding '\n'  (line 521) to the end of NIL values exlusively making csv output inconsistent.  Removed '\n'
2015-02-02 22:50:45 +01:00
Nan Xiao
cc14d7f51d Fix function prototype in redis-cli.c.
Fix function prototype in redis-cli.c.
2014-12-11 15:09:20 +01:00
h0x91b
b3349204b8 Reconnect redis-cli when cluster return "moved"
if redis works in cluster-mode and redis-cli was run with argv, reconnect if needs.
    example:
    ./redis-cli set foo bar

    if return is MOVED redis-cli just do nothing.
2014-12-11 15:07:49 +01:00
Jan-Erik Rediger
c8305accc3 Only ignore sigpipe in interactive mode
This allows shell pipes to correctly end redis-cli.

Ref #2066
2014-12-09 09:01:08 +01:00
antirez
1490809f1f Document redis-cli --stat in --help output. 2014-11-25 18:25:55 +01:00
Matt Stancliff
e8f7899ae2 redis-cli: ignore SIGPIPE network errors
Closes #2066
2014-10-30 12:02:28 +01:00
antirez
2480315f2a redis-cli: add missing newline in error message. 2014-10-29 14:27:15 +01:00
Dov Murik
9da7141dc6 redis-cli: fix prompt after shutdown command
Fix redis-cli prompt to state "not connected" after a SHUTDOWN command
is sent.
2014-08-26 10:41:02 +02:00
antirez
d34fade2da Remove warnings and improve integer sign correctness. 2014-08-26 10:41:02 +02:00
charsyam
74cde68c25 Remove unused LINE_BUFLEN definition
Closes #1129
2014-08-26 10:41:02 +02:00
cubicdaiya
d1bf997d1c Use 'void' for zero-argument functions
According to the C standard,
it is desirable to give the type 'void'
to functions have no argument.

Closes #1631
2014-08-26 10:41:02 +02:00
Kashif Rasul
54e054fff3 Fix issues raised by clang analyzer
Modified by @antirez since the original fix to genInfoString() looked
weak. Probably the clang analyzer complained about `section` being
possibly NULL, and strcasecmp() called with a NULL pointer. In the
practice this can never happen, still for the sake of correctness
the right fix is not to modify only the first call, but to set `section`
to the value of "default" if it happens to be NULL.

Closes #1660
2014-08-26 10:41:02 +02:00
Jan-Erik Rediger
bc9a5bbed4 redis-cli: fix latency result output
(Cleaned up a little by @mattsta)

Closes #1774
2014-08-26 10:41:01 +02:00
Matt Stancliff
161a5acf75 redis-cli: Add --no-raw option
Some people need formatted output even when they have no
interactive tty.

Fixes #760
2014-08-26 10:41:01 +02:00
Matt Stancliff
7693b84b35 redis-cli: stop showing incorrectly selected DB
Previously redis-cli would happily show "-1" or "99999"
as valid DB choices.

Now, if the SELECT call returned an error, we don't update
the DB number in the CLI.

Inspired by @anupshendkar in #1313

Fixes #566, #1313
2014-08-26 10:41:01 +02:00
Matt Stancliff
839608569e redis-cli: Re-attach selected DB after auth
Previously, if you did SELECT then AUTH, redis-cli
would show your SELECT'd db even though it didn't
happen.

Note: running into this situation is a (hopefully) very limited
used case of people using multiple DBs and AUTH all at the same
time.

Fixes antirez#1639
2014-08-26 10:41:01 +02:00
antirez
9ed02e137c LATENCY DOCTOR: initial draft and events summary output. 2014-07-18 12:20:56 +02:00
antirez
3bd6917b0d LATENCY GRAPH implemented. 2014-07-18 12:20:55 +02:00
antirez
b411678679 No more trailing spaces in Redis source code. 2014-06-26 18:48:47 +02:00
Alex Suraci
2b1047ffd3 add missing signal.h include 2014-06-21 15:18:32 +02:00
Matt Stancliff
65bab61159 Add SIGINT handler to cli --intrinsic-latency
If we run a long latency session and want to Ctrl-C out of it,
it's nice to still get the summary output at the end.
2014-06-21 15:18:32 +02:00
Andy Grunwald
531e577e2d Fixed typo in word avarege in result message of --intrinsic-latency analyzer 2014-06-06 11:20:00 +02:00
antirez
9e82461af0 Linenoise updated, multiline mode enabled in redis-cli. 2014-03-13 15:11:41 +01:00
michael-grunder
23addbb5a3 Improved bigkeys with progress, pipelining and summary
This commit reworks the redis-cli --bigkeys command to provide more
information about our progress as well as output summary information
when we're done.

 - We now show an approximate percentage completion as we go
 - Hiredis pipelining is used for TYPE and SIZE retreival
 - A summary of keyspace distribution and overall breakout at the end
2014-03-05 10:22:07 +01:00
michael-grunder
a2b3f2eae2 Update --bigkeys to use SCAN
This commit changes the findBigKeys() function in redis-cli.c to use the new
SCAN command for iterating the keyspace, rather than RANDOMKEY.  Because we
can know when we're done using SCAN, it will exit after exhausting the keyspace.
2014-02-25 15:09:46 +01:00
antirez
48fa34bf9e redis-cli: also remove useless uint8_t. 2014-02-25 15:09:46 +01:00
antirez
ff20d05650 redis-cli: don't use uint64_t where actually not needed.
The computation is just something to take the CPU busy, no need to use a
specific type. Since stdint.h was not included this prevented
compilation on certain systems.
2014-02-25 15:09:46 +01:00
antirez
6a95ddb248 redis-cli: check argument existence for --pattern. 2014-02-25 15:09:46 +01:00
antirez
2431b63ff4 redis-cli: --intrinsic-latency run mode added. 2014-02-25 15:09:46 +01:00
antirez
68e9597e8a redis-cli: added comments to split program in parts. 2014-02-25 15:09:46 +01:00
Matt Stancliff
21a7f9e7ef Auto-enter slaveMode when SYNC from redis-cli
If someone asks for SYNC or PSYNC from redis-cli,
automatically enter slaveMode (as if they ran
redis-cli --slave) and continue printing the replication
stream until either they Ctrl-C or the master gets disconnected.
2014-02-25 10:24:16 +01:00
antirez
1cf532dc37 redis-cli --help output improved with --scan and periods. 2014-01-22 12:07:42 +01:00
antirez
994c5b26dd redis-cli: support for --scan option. 2014-01-22 12:04:08 +01:00
Michel Martens
347ab78e90 Document the redis-cli --csv option. 2013-09-26 10:12:46 +02:00
antirez
2debce325b redis-cli: fix big keys search when the key no longer exist.
The code freed a reply object that was never created, resulting in a
segfault every time randomkey returned a key that was deleted before we
queried it for size.
2013-09-04 10:35:53 +02:00
Jan-Erik Rediger
1b696dc07c Wrap IPv6 in brackets in the prompt. 2013-07-11 17:47:55 +02:00
antirez
1135e9faa2 redis-cli: introduced --pipe-timeout.
When in --pipe mode, after all the data transfer to the server is
complete, now redis-cli waits at max the specified amount of
seconds (30 by default, use 0 to wait forever) without receiving any
reply at all from the server. After this time limit the operation is
aborted with an error.

That's related to issue #681.
2013-07-03 12:22:03 +02:00
antirez
fbb97c6b13 redis-cli --pipe: send final ECHO in a safer way.
If the protocol read from stdin happened to contain grabage (invalid
random chars), in the previous implementation it was possible to end
with something like:

dksfjdksjflskfjl*2\r\n$4\r\nECHO....

That is invalid as the *2 should start into a new line. Now we prefix
the ECHO with a CRLF that has no effects on the server but prevents this
issues most of the times.

Of course if the offending wrong sequence is something like:

$3248772349\r\n

No one is going to save us as Redis will wait for data in the context of
a big argument, so this fix does not cover all the cases.

This partially fixes issue #681.
2013-07-03 11:59:44 +02:00
antirez
f8ae70cf7c redis-cli: raise error on bad command line switch.
Previously redis-cli never tried to raise an error when an unrecognized
switch was encountered, as everything after the initial options is to be
transmitted to the server.

However this is too liberal, as there are no commands starting with "-".
So the new behavior is to produce an error if there is an unrecognized
switch starting with "-". This should not break past redis-cli usages
but should prevent broken options to be silently discarded.

As far the first token not starting with "-" is encountered, all the
rest is considered to be part of the command, so you cna still use
strings starting with "-" as values, like in:

    redis-cli --port 6380 set foo --my-value
2013-04-11 13:17:25 +02:00
antirez
0280c2f252 redis-cli: --latency-history mode implemented. 2013-04-11 13:11:41 +02:00
antirez
09aa55a334 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-22 17:54:32 +01:00