Permalink
Browse files

Updated InfoMap to reflect changes in INFO -- TESTED (Redis 2.2.6)

Added AdHocTestInfo to tests.
Not entirely sure yet how to deal with db# info enteries in InfoMap.

Compliance is now 2.2.6.
  • Loading branch information...
alphazero committed Jan 15, 2012
1 parent f07aa36 commit ae4f8ec664c3fbb46f973ee8dcaff1eb4521853d
@@ -1,5 +1,5 @@
/*
- * Copyright 2009 Joubin Houshyar
+ * Copyright 2009-2012 Joubin Houshyar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,18 +18,38 @@
/**
* [TODO: document me!]
- * [TODO: dbN:keys=2,expires=0 - where N: {0->n}]
-
+ * [TODO: dbN:keys=2,expires=0 - where N: {0->n}] << not sure if this is possible, cleanly...
*
* @author Joubin Houshyar (alphazero@sensesay.net)
* @version alpha.0, 04/02/09
* @since alpha.0
*
*/
-/*
- * TOOD:
- */
public enum RedisInfo {
+ redis_git_dirty,
+ redis_git_sha1,
+ used_cpu_user,
+ client_longest_output_list,
+ latest_fork_usec,
+ used_memory_peak,
+ pubsub_patterns,
+ used_cpu_sys_children,
+ used_memory_rss,
+ lru_clock,
+ aof_enabled,
+ mem_fragmentation_ratio,
+ used_memory_peak_human,
+ loading,
+ client_biggest_input_buf,
+ used_cpu_sys,
+ keyspace_hits,
+ evicted_keys,
+ pubsub_channels,
+ used_cpu_user_children,
+ gcc_version,
+ expired_keys,
+ mem_allocator,
+ keyspace_misses,
arch_bits,
multiplexing_api,
redis_version,
@@ -47,8 +67,8 @@
total_commands_processed,
uptime_in_seconds,
uptime_in_days,
- hash_max_zipmap_entries,
- hash_max_zipmap_value,
+// hash_max_zipmap_entries,
+// hash_max_zipmap_value,
vm_enabled,
role
}
@@ -0,0 +1,52 @@
+package org.jredis.ri.adhoc;
+
+import java.util.Map;
+
+import org.jredis.JRedisFuture;
+import org.jredis.RedisInfo;
+import org.jredis.connector.ConnectionSpec;
+import org.jredis.ri.alphazero.JRedisPipeline;
+import org.jredis.ri.alphazero.connection.DefaultConnectionSpec;
+import org.jredis.ri.alphazero.support.Log;
+
+public class AdHocTestInfo {
+ public static void main(String[] args) throws Throwable {
+ try {
+ new AdHocTestInfo().run();
+ } catch (Exception e) {
+ Log.error(e.getMessage());
+ }
+ }
+ final ConnectionSpec spec;
+ JRedisFuture jredis = null;
+ public AdHocTestInfo() throws Throwable{
+ spec = DefaultConnectionSpec.newSpec().setCredentials("jredis".getBytes());
+ jredis = new JRedisPipeline(spec);
+ }
+ /** this is not supposed to get called unless you actually run redis on port 9999 :P */
+ public void run() {
+ try {
+ Map<String, String> infomap = jredis.info().get();
+ for(String k : infomap.keySet()){
+ System.out.format("%s => %s\n", k, infomap.get(k));
+ }
+
+ System.out.format("\n\n### InfoMap needs to be updated to include ###\n");
+ for(String k : infomap.keySet()){
+ try {
+ RedisInfo.valueOf(k);
+ }
+ catch (IllegalArgumentException e){
+ System.out.format("%s,\n", k);
+ }
+ }
+ System.out.format("### END ###\n");
+
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
+ finally {
+ jredis.quit();
+ }
+ }
+}
@@ -1,2 +1,2 @@
compliance: Redis 2.2.0
-tested with: Redis 2.2.4
+tested with: Redis 2.2.6

0 comments on commit ae4f8ec

Please sign in to comment.