]> git.saurik.com Git - redis.git/blobdiff - src/redis.c
correctly set AOF base size field in server structure
[redis.git] / src / redis.c
index 263172259f5e9befb61acfaf4ec33fa0ba1338bd..bf51db9d536df64fa675f22aea4565a63d19a217 100644 (file)
@@ -697,9 +697,9 @@ int serverCron(struct aeEventLoop *eventLoop, long long id, void *clientData) {
          {
             int base = server.auto_aofrewrite_base_size ?
                             server.auto_aofrewrite_base_size : 1;
-            int growth = (server.appendonly_current_size*100/base);
+            long long growth = (server.appendonly_current_size*100/base);
             if (growth >= server.auto_aofrewrite_perc) {
-                redisLog(REDIS_NOTICE,"Starting automatic rewriting of AOF on %d growth",growth);
+                redisLog(REDIS_NOTICE,"Starting automatic rewriting of AOF on %lld growth",growth);
                 rewriteAppendOnlyFileBackground();
             }
          }
@@ -1393,6 +1393,16 @@ sds genRedisInfoString(char *section) {
             server.lastsave,
             server.bgrewritechildpid != -1);
 
+        if (server.appendonly) {
+            info = sdscatprintf(info,
+                "aof_current_size:%lld\r\n"
+                "aof_base_size:%lld\r\n"
+                "aof_pending_rewrite:%d\r\n",
+                (long long) server.appendonly_current_size,
+                (long long) server.auto_aofrewrite_base_size,
+                server.aofrewrite_scheduled);
+        }
+
         if (server.loading) {
             double perc;
             time_t eta, elapsed;