Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Shrink lines in protocol.txt to fit within 80 columns.

Also wrote a new test that will ensure that that never happens again.
  • Loading branch information...
commit c4282cce2f07d05e661d632f8cd842814e13a48a 1 parent 81e4104
@dustin dustin authored
Showing with 80 additions and 55 deletions.
  1. +55 −55 doc/protocol.txt
  2. +25 −0 t/line-lengths.t
View
110 doc/protocol.txt
@@ -54,10 +54,10 @@ Commands
There are three types of commands.
Storage commands (there are six: "set", "add", "replace", "append"
-"prepend" and "cas") ask the server to store some data identified by a key. The
-client sends a command line, and then a data block; after that the
-client expects one line of response, which will indicate success or
-faulure.
+"prepend" and "cas") ask the server to store some data identified by a
+key. The client sends a command line, and then a data block; after
+that the client expects one line of response, which will indicate
+success or faulure.
Retrieval commands (there are two: "get" and "gets") ask the server to
retrieve data corresponding to a set of keys (one or more keys in one
@@ -355,57 +355,57 @@ In the type column below, "32u" means a 32-bit unsigned integer, "64u"
means a 64-bit unsigner integer. '32u:32u' means two 32-but unsigned
integers separated by a colon.
-|-----------------------+---------+------------------------------------------------|
-| Name | Type | Meaning |
-|-----------------------+---------+------------------------------------------------|
-| pid | 32u | Process id of this server process |
-| uptime | 32u | Number of seconds this server has been running |
-| time | 32u | current UNIX time according to the server |
-| version | string | Version string of this server |
-| pointer_size | 32 | Default size of pointers on the host OS |
-| | | (generally 32 or 64) |
-| rusage_user | 32u:32u | Accumulated user time for this process |
-| | | (seconds:microseconds) |
-| rusage_system | 32u:32u | Accumulated system time for this process |
-| | | (seconds:microseconds) |
-| curr_items | 32u | Current number of items stored by the server |
-| total_items | 32u | Total number of items stored by this server |
-| | | ever since it started |
-| bytes | 64u | Current number of bytes used by this server |
-| | | to store items |
-| curr_connections | 32u | Number of open connections |
-| total_connections | 32u | Total number of connections opened since |
-| | | the server started running |
-| connection_structures | 32u | Number of connection structures allocated |
-| | | by the server |
-| cmd_get | 64u | Cumulative number of retrieval requests |
-| cmd_set | 64u | Cumulative number of storage requests |
-| get_hits | 64u | Number of keys that have been requested and |
-| | | found present |
-| get_misses | 64u | Number of items that have been requested |
-| | | and not found |
-| delete_misses | 64u | Number of deletions requests for missing keys. |
-| delete_hits | 64u | Number of deletion requests resulting in |
-| | | an item being removed. |
-| incr_misses | 64u | Number of incr requests against missing keys. |
-| incr_hits | 64u | Number of successful incr requests. |
-| decr_misses | 64u | Number of decr requests against missing keys. |
-| decr_hits | 64u | Number of successful decr requests. |
-| cas_misses | 64u | Number of CAS requests against missing keys. |
-| cas_hits | 64u | Number of successful CAS requests. |
-| cas_badval | 64u | Number of CAS requests for which a key was |
-| | | found, but the CAS value did not match. |
-| evictions | 64u | Number of valid items removed from cache |
-| | | to free memory for new items |
-| bytes_read | 64u | Total number of bytes read by this server |
-| | | from network |
-| bytes_written | 64u | Total number of bytes sent by this server to |
-| | | network |
-| limit_maxbytes | 32u | Number of bytes this server is allowed to |
-| | | use for storage. |
-| threads | 32u | Number of worker threads requested. |
-| | | (see doc/threads.txt) |
-|-----------------------+---------+------------------------------------------------|
+|-----------------------+---------+-------------------------------------------|
+| Name | Type | Meaning |
+|-----------------------+---------+-------------------------------------------|
+| pid | 32u | Process id of this server process |
+| uptime | 32u | Number of secs since the server started |
+| time | 32u | current UNIX time according to the server |
+| version | string | Version string of this server |
+| pointer_size | 32 | Default size of pointers on the host OS |
+| | | (generally 32 or 64) |
+| rusage_user | 32u:32u | Accumulated user time for this process |
+| | | (seconds:microseconds) |
+| rusage_system | 32u:32u | Accumulated system time for this process |
+| | | (seconds:microseconds) |
+| curr_items | 32u | Current number of items stored |
+| total_items | 32u | Total number of items stored since |
+| | | the server started |
+| bytes | 64u | Current number of bytes used |
+| | | to store items |
+| curr_connections | 32u | Number of open connections |
+| total_connections | 32u | Total number of connections opened since |
+| | | the server started running |
+| connection_structures | 32u | Number of connection structures allocated |
+| | | by the server |
+| cmd_get | 64u | Cumulative number of retrieval reqs |
+| cmd_set | 64u | Cumulative number of storage reqs |
+| get_hits | 64u | Number of keys that have been requested |
+| | | and found present |
+| get_misses | 64u | Number of items that have been requested |
+| | | and not found |
+| delete_misses | 64u | Number of deletions reqs for missing keys |
+| delete_hits | 64u | Number of deletion reqs resulting in |
+| | | an item being removed. |
+| incr_misses | 64u | Number of incr reqs against missing keys. |
+| incr_hits | 64u | Number of successful incr reqs. |
+| decr_misses | 64u | Number of decr reqs against missing keys. |
+| decr_hits | 64u | Number of successful decr reqs. |
+| cas_misses | 64u | Number of CAS reqs against missing keys. |
+| cas_hits | 64u | Number of successful CAS reqs. |
+| cas_badval | 64u | Number of CAS reqs for which a key was |
+| | | found, but the CAS value did not match. |
+| evictions | 64u | Number of valid items removed from cache |
+| | | to free memory for new items |
+| bytes_read | 64u | Total number of bytes read by this server |
+| | | from network |
+| bytes_written | 64u | Total number of bytes sent by this server |
+| | | to network |
+| limit_maxbytes | 32u | Number of bytes this server is allowed to |
+| | | use for storage. |
+| threads | 32u | Number of worker threads requested. |
+| | | (see doc/threads.txt) |
+|-----------------------+---------+-------------------------------------------|
Item statistics
---------------
View
25 t/line-lengths.t
@@ -0,0 +1,25 @@
+#!/usr/bin/perl
+use strict;
+use FindBin qw($Bin);
+our @files;
+
+BEGIN {
+ chdir "$Bin/.." or die;
+ @files = ( "doc/protocol.txt" );
+}
+
+use Test::More tests => scalar(@files);
+
+foreach my $f (@files) {
+ open(my $fh, $f) or die("Can't open $f");
+ my @long_lines = ();
+ my $line_number = 0;
+ while(<$fh>) {
+ $line_number++;
+ if(length($_) > 80) {
+ push(@long_lines, $line_number);
+ }
+ }
+ close($fh);
+ ok(@long_lines == 0, "$f has a long lines: @long_lines");
+}
Please sign in to comment.
Something went wrong with that request. Please try again.