Parse and return Redis INFO data.

redis_info(con)

parse_info(x)

redis_version(con)

Arguments

con

A Redis connection

x

character string

Examples

if (redux::redis_available()) {
  r <- redux::hiredis()

  # Redis server version:
  redux::redis_version(r)
  # This is a 'numeric_version' object so you can compute with it
  # if you need to check for minimum versions
  redux::redis_version(r) >= numeric_version("2.1.1")

  # Extensive information is given back by the server:
  redux::redis_info(r)

  # Which is just:
  redux::parse_info(r$INFO())
}
#> $redis_version
#> [1] ‘4.0.14’
#> 
#> $redis_git_sha1
#> [1] "00000000"
#> 
#> $redis_git_dirty
#> [1] "0"
#> 
#> $redis_build_id
#> [1] "477137dd16103839"
#> 
#> $redis_mode
#> [1] "standalone"
#> 
#> $os
#> [1] "Darwin 21.6.0 x86_64"
#> 
#> $arch_bits
#> [1] "64"
#> 
#> $multiplexing_api
#> [1] "kqueue"
#> 
#> $atomicvar_api
#> [1] "atomic-builtin"
#> 
#> $gcc_version
#> [1] "4.2.1"
#> 
#> $process_id
#> [1] "2966"
#> 
#> $run_id
#> [1] "807c073a181bbcb287d68f094f49e63002cb3e68"
#> 
#> $tcp_port
#> [1] "6379"
#> 
#> $uptime_in_seconds
#> [1] "37"
#> 
#> $uptime_in_days
#> [1] "0"
#> 
#> $hz
#> [1] "10"
#> 
#> $lru_clock
#> [1] "10379712"
#> 
#> $executable
#> [1] "/Users/runner/hostedtoolcache/redis/4.0.14/x64/bin/redis-server"
#> 
#> $config_file
#> [1] "/Users/runner/work/_temp/3b70f0/redis.conf"
#> 
#> $connected_clients
#> [1] "1"
#> 
#> $client_longest_output_list
#> [1] "0"
#> 
#> $client_biggest_input_buf
#> [1] "0"
#> 
#> $blocked_clients
#> [1] "0"
#> 
#> $used_memory
#> [1] "1045408"
#> 
#> $used_memory_human
#> [1] "1020.91K"
#> 
#> $used_memory_rss
#> [1] "1712128"
#> 
#> $used_memory_rss_human
#> [1] "1.63M"
#> 
#> $used_memory_peak
#> [1] "1062704"
#> 
#> $used_memory_peak_human
#> [1] "1.01M"
#> 
#> $used_memory_peak_perc
#> [1] "98.37%"
#> 
#> $used_memory_overhead
#> [1] "1031086"
#> 
#> $used_memory_startup
#> [1] "981376"
#> 
#> $used_memory_dataset
#> [1] "14322"
#> 
#> $used_memory_dataset_perc
#> [1] "22.37%"
#> 
#> $total_system_memory
#> [1] "15032385536"
#> 
#> $total_system_memory_human
#> [1] "14.00G"
#> 
#> $used_memory_lua
#> [1] "37888"
#> 
#> $used_memory_lua_human
#> [1] "37.00K"
#> 
#> $maxmemory
#> [1] "0"
#> 
#> $maxmemory_human
#> [1] "0B"
#> 
#> $maxmemory_policy
#> [1] "noeviction"
#> 
#> $mem_fragmentation_ratio
#> [1] "1.64"
#> 
#> $mem_allocator
#> [1] "libc"
#> 
#> $active_defrag_running
#> [1] "0"
#> 
#> $lazyfree_pending_objects
#> [1] "0"
#> 
#> $loading
#> [1] "0"
#> 
#> $rdb_changes_since_last_save
#> [1] "5"
#> 
#> $rdb_bgsave_in_progress
#> [1] "0"
#> 
#> $rdb_last_save_time
#> [1] "1704878491"
#> 
#> $rdb_last_bgsave_status
#> [1] "ok"
#> 
#> $rdb_last_bgsave_time_sec
#> [1] "-1"
#> 
#> $rdb_current_bgsave_time_sec
#> [1] "-1"
#> 
#> $rdb_last_cow_size
#> [1] "0"
#> 
#> $aof_enabled
#> [1] "0"
#> 
#> $aof_rewrite_in_progress
#> [1] "0"
#> 
#> $aof_rewrite_scheduled
#> [1] "0"
#> 
#> $aof_last_rewrite_time_sec
#> [1] "-1"
#> 
#> $aof_current_rewrite_time_sec
#> [1] "-1"
#> 
#> $aof_last_bgrewrite_status
#> [1] "ok"
#> 
#> $aof_last_write_status
#> [1] "ok"
#> 
#> $aof_last_cow_size
#> [1] "0"
#> 
#> $total_connections_received
#> [1] "9"
#> 
#> $total_commands_processed
#> [1] "19"
#> 
#> $instantaneous_ops_per_sec
#> [1] "1"
#> 
#> $total_net_input_bytes
#> [1] "704"
#> 
#> $total_net_output_bytes
#> [1] "8747"
#> 
#> $instantaneous_input_kbps
#> [1] "0.02"
#> 
#> $instantaneous_output_kbps
#> [1] "0.01"
#> 
#> $rejected_connections
#> [1] "0"
#> 
#> $sync_full
#> [1] "0"
#> 
#> $sync_partial_ok
#> [1] "0"
#> 
#> $sync_partial_err
#> [1] "0"
#> 
#> $expired_keys
#> [1] "0"
#> 
#> $expired_stale_perc
#> [1] "0.00"
#> 
#> $expired_time_cap_reached_count
#> [1] "0"
#> 
#> $evicted_keys
#> [1] "0"
#> 
#> $keyspace_hits
#> [1] "7"
#> 
#> $keyspace_misses
#> [1] "0"
#> 
#> $pubsub_channels
#> [1] "0"
#> 
#> $pubsub_patterns
#> [1] "0"
#> 
#> $latest_fork_usec
#> [1] "0"
#> 
#> $migrate_cached_sockets
#> [1] "0"
#> 
#> $slave_expires_tracked_keys
#> [1] "0"
#> 
#> $active_defrag_hits
#> [1] "0"
#> 
#> $active_defrag_misses
#> [1] "0"
#> 
#> $active_defrag_key_hits
#> [1] "0"
#> 
#> $active_defrag_key_misses
#> [1] "0"
#> 
#> $role
#> [1] "master"
#> 
#> $connected_slaves
#> [1] "0"
#> 
#> $master_replid
#> [1] "aa13b77decadeb0b31913b8b2ee4a80e3d4acc9b"
#> 
#> $master_replid2
#> [1] "0000000000000000000000000000000000000000"
#> 
#> $master_repl_offset
#> [1] "0"
#> 
#> $second_repl_offset
#> [1] "-1"
#> 
#> $repl_backlog_active
#> [1] "0"
#> 
#> $repl_backlog_size
#> [1] "1048576"
#> 
#> $repl_backlog_first_byte_offset
#> [1] "0"
#> 
#> $repl_backlog_histlen
#> [1] "0"
#> 
#> $used_cpu_sys
#> [1] "0.03"
#> 
#> $used_cpu_user
#> [1] "0.01"
#> 
#> $used_cpu_sys_children
#> [1] "0.00"
#> 
#> $used_cpu_user_children
#> [1] "0.00"
#> 
#> $cluster_enabled
#> [1] "0"
#> 
#> $db0
#> [1] "keys=1"    "expires=0" "avg_ttl=0"
#>