Skip to main content

command_count_test.go

command_count_test.go - Overview

This file contains tests and a benchmark for the COMMAND COUNT functionality of a DiceDB client. It verifies that the command count is positive and benchmarks the performance of retrieving the command count.

Detailed Documentation

TestCommandCount

Purpose: Tests that the command count returned by the DiceDB client is a positive integer. Parameters:

  • t: *testing.T - Testing object for running the test. Returns: None

getCommandCount

Purpose: Retrieves the command count from the DiceDB server using the COMMAND COUNT command. Parameters:

  • client: *dicedb.Client - The DiceDB client used to communicate with the server. Returns:
  • int64: The command count returned by the server. Returns -1 if the response is nil.

BenchmarkCountCommand

Purpose: Benchmarks the performance of retrieving the command count from the DiceDB server. Parameters:

  • b: *testing.B - Benchmarking object for running the benchmark. Returns: None

Getting Started Relevance