View Source Trifle.Stats.Driver.Redis (Trifle.Stats v2.5.0)

Redis driver for Trifle.Stats with Ruby gem compatibility.

Supports configurable key prefixes and full compatibility with Ruby trifle-stats.

Summary

Functions

Link to this function

from_config(connection, config)

View Source

Create a new Redis driver from configuration (Ruby compatible).

Link to this function

inc(keys, values, driver, count \\ 1, tracking_key \\ nil)

View Source
Link to this function

new(connection, prefix \\ "trfl", separator \\ "::", system_tracking \\ true)

View Source

Create a new Redis driver instance.

Parameters

  • connection: Redis connection
  • prefix: Key prefix for all stored keys (default: "trfl")
  • separator: Key separator (default: "::")

Examples

# Basic usage
{:ok, conn} = Redix.start_link()
driver = Trifle.Stats.Driver.Redis.new(conn)

# With custom prefix (Ruby compatible)
driver = Trifle.Stats.Driver.Redis.new(conn, "analytics")
Link to this function

ping(key, values, driver)

View Source
Link to this function

set(keys, values, driver, count \\ 1, tracking_key \\ nil)

View Source