Ferricstore.Commands.Memory (ferricstore v0.3.4)

Copy Markdown View Source

Handles Redis MEMORY subcommands.

Provides introspection into memory usage of keys and the overall BEAM VM.

Supported subcommands

  • MEMORY USAGE key [SAMPLES count] -- estimate memory used by a key
  • MEMORY DOCTOR -- diagnostic string (stub)
  • MEMORY STATS -- memory statistics from :erlang.memory/0
  • MEMORY HELP -- list of subcommand help strings
  • MEMORY PURGE -- trigger garbage collection
  • MEMORY MALLOC-STATS -- allocator info (stub)

Summary

Functions

Handles a MEMORY subcommand.

Functions

handle(subcmd, args, store)

@spec handle(binary(), [binary()], map()) :: term()

Handles a MEMORY subcommand.

Parameters

  • subcmd -- uppercased subcommand name (e.g. "USAGE", "DOCTOR")
  • args -- list of string arguments following the subcommand
  • store -- injected store map with get, exists? callbacks

Returns

Plain Elixir term suitable for RESP encoding.