or run

tessl search
Log in

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/aioredis@2.0.x
tile.json

tessl/pypi-aioredis

tessl install tessl/pypi-aioredis@2.0.0

asyncio (PEP 3156) Redis support

Agent Success

Agent success rate when using this tile

98%

Improvement

Agent success rate improvement when using this tile compared to baseline

1.01x

Baseline

Agent success rate without this tile

97%

task.mdevals/scenario-8/

Redis Command Monitor and Analyzer

Build a Redis command monitoring tool that captures and analyzes commands executed on a Redis server in real-time.

Capabilities

Command Monitoring

Create a monitor that connects to a Redis server and captures executed commands.

  • It monitors Redis commands and captures command details @test
  • It uses async iteration to process monitored commands @test
  • It handles connection lifecycle properly @test

Command Analysis

Analyze captured commands to extract useful statistics and patterns.

  • It counts commands by type (GET, SET, DEL, etc.) @test
  • It tracks which clients execute which commands @test
  • It calculates command frequency statistics @test

Real-time Reporting

Generate reports from monitored command data.

  • It produces a summary report of command types and their counts @test
  • It identifies the most frequently used commands @test

Implementation

@generates

API

import asyncio
from typing import Dict, List, Any, AsyncIterator

class RedisMonitor:
    """Monitor and analyze Redis commands in real-time."""

    def __init__(self, host: str = 'localhost', port: int = 6379):
        """
        Initialize Redis monitor.

        Args:
            host: Redis server host
            port: Redis server port
        """
        pass

    async def start_monitoring(self, duration: float) -> None:
        """
        Start monitoring Redis commands for specified duration.

        Args:
            duration: How long to monitor in seconds
        """
        pass

    def get_command_counts(self) -> Dict[str, int]:
        """
        Get count of each command type observed.

        Returns:
            Dictionary mapping command names to their counts
        """
        pass

    def get_top_commands(self, n: int = 5) -> List[tuple[str, int]]:
        """
        Get the N most frequently used commands.

        Args:
            n: Number of top commands to return

        Returns:
            List of (command_name, count) tuples sorted by count descending
        """
        pass

    def generate_report(self) -> str:
        """
        Generate a text report of monitoring results.

        Returns:
            Formatted string report with command statistics
        """
        pass

    async def close(self) -> None:
        """Close the monitor connection."""
        pass

Dependencies { .dependencies }

aioredis { .dependency }

Provides async Redis client support with command monitoring capabilities.