agent-performance-benchmarker

15
2
Source

Agent skill for performance-benchmarker - invoke with $agent-performance-benchmarker

Install

mkdir -p .claude/skills/agent-performance-benchmarker && curl -L -o skill.zip "https://mcp.directory/api/skills/download/1728" && unzip -o skill.zip -d .claude/skills/agent-performance-benchmarker && rm skill.zip

Installs to .claude/skills/agent-performance-benchmarker

About this skill


name: performance-benchmarker type: analyst color: "#607D8B" description: Implements comprehensive performance benchmarking for distributed consensus protocols capabilities:

  • throughput_measurement
  • latency_analysis
  • resource_monitoring
  • comparative_analysis
  • adaptive_tuning priority: medium hooks: pre: | echo "📊 Performance Benchmarker analyzing: $TASK"

    Initialize monitoring systems

    if [[ "$TASK" == "benchmark" ]]; then echo "⚡ Starting performance metric collection" fi post: | echo "📈 Performance analysis complete"

    Generate performance report

    echo "📋 Compiling benchmarking results and recommendations"

Performance Benchmarker

Implements comprehensive performance benchmarking and optimization analysis for distributed consensus protocols.

Core Responsibilities

  1. Protocol Benchmarking: Measure throughput, latency, and scalability across consensus algorithms
  2. Resource Monitoring: Track CPU, memory, network, and storage utilization patterns
  3. Comparative Analysis: Compare Byzantine, Raft, and Gossip protocol performance
  4. Adaptive Tuning: Implement real-time parameter optimization and load balancing
  5. Performance Reporting: Generate actionable insights and optimization recommendations

Technical Implementation

Core Benchmarking Framework

class ConsensusPerformanceBenchmarker {
  constructor() {
    this.benchmarkSuites = new Map();
    this.performanceMetrics = new Map();
    this.historicalData = new TimeSeriesDatabase();
    this.currentBenchmarks = new Set();
    this.adaptiveOptimizer = new AdaptiveOptimizer();
    this.alertSystem = new PerformanceAlertSystem();
  }

  // Register benchmark suite for specific consensus protocol
  registerBenchmarkSuite(protocolName, benchmarkConfig) {
    const suite = new BenchmarkSuite(protocolName, benchmarkConfig);
    this.benchmarkSuites.set(protocolName, suite);
    
    return suite;
  }

  // Execute comprehensive performance benchmarks
  async runComprehensiveBenchmarks(protocols, scenarios) {
    const results = new Map();
    
    for (const protocol of protocols) {
      const protocolResults = new Map();
      
      for (const scenario of scenarios) {
        console.log(`Running ${scenario.name} benchmark for ${protocol}`);
        
        const benchmarkResult = await this.executeBenchmarkScenario(
          protocol, scenario
        );
        
        protocolResults.set(scenario.name, benchmarkResult);
        
        // Store in historical database
        await this.historicalData.store({
          protocol: protocol,
          scenario: scenario.name,
          timestamp: Date.now(),
          metrics: benchmarkResult
        });
      }
      
      results.set(protocol, protocolResults);
    }
    
    // Generate comparative analysis
    const analysis = await this.generateComparativeAnalysis(results);
    
    // Trigger adaptive optimizations
    await this.adaptiveOptimizer.optimizeBasedOnResults(results);
    
    return {
      benchmarkResults: results,
      comparativeAnalysis: analysis,
      recommendations: await this.generateOptimizationRecommendations(results)
    };
  }

  async executeBenchmarkScenario(protocol, scenario) {
    const benchmark = this.benchmarkSuites.get(protocol);
    if (!benchmark) {
      throw new Error(`No benchmark suite found for protocol: ${protocol}`);
    }

    // Initialize benchmark environment
    const environment = await this.setupBenchmarkEnvironment(scenario);
    
    try {
      // Pre-benchmark setup
      await benchmark.setup(environment);
      
      // Execute benchmark phases
      const results = {
        throughput: await this.measureThroughput(benchmark, scenario),
        latency: await this.measureLatency(benchmark, scenario),
        resourceUsage: await this.measureResourceUsage(benchmark, scenario),
        scalability: await this.measureScalability(benchmark, scenario),
        faultTolerance: await this.measureFaultTolerance(benchmark, scenario)
      };
      
      // Post-benchmark analysis
      results.analysis = await this.analyzeBenchmarkResults(results);
      
      return results;
      
    } finally {
      // Cleanup benchmark environment
      await this.cleanupBenchmarkEnvironment(environment);
    }
  }
}

Throughput Measurement System

class ThroughputBenchmark {
  constructor(protocol, configuration) {
    this.protocol = protocol;
    this.config = configuration;
    this.metrics = new MetricsCollector();
    this.loadGenerator = new LoadGenerator();
  }

  async measureThroughput(scenario) {
    const measurements = [];
    const duration = scenario.duration || 60000; // 1 minute default
    const startTime = Date.now();
    
    // Initialize load generator
    await this.loadGenerator.initialize({
      requestRate: scenario.initialRate || 10,
      rampUp: scenario.rampUp || false,
      pattern: scenario.pattern || 'constant'
    });
    
    // Start metrics collection
    this.metrics.startCollection(['transactions_per_second', 'success_rate']);
    
    let currentRate = scenario.initialRate || 10;
    const rateIncrement = scenario.rateIncrement || 5;
    const measurementInterval = 5000; // 5 seconds
    
    while (Date.now() - startTime < duration) {
      const intervalStart = Date.now();
      
      // Generate load for this interval
      const transactions = await this.generateTransactionLoad(
        currentRate, measurementInterval
      );
      
      // Measure throughput for this interval
      const intervalMetrics = await this.measureIntervalThroughput(
        transactions, measurementInterval
      );
      
      measurements.push({
        timestamp: intervalStart,
        requestRate: currentRate,
        actualThroughput: intervalMetrics.throughput,
        successRate: intervalMetrics.successRate,
        averageLatency: intervalMetrics.averageLatency,
        p95Latency: intervalMetrics.p95Latency,
        p99Latency: intervalMetrics.p99Latency
      });
      
      // Adaptive rate adjustment
      if (scenario.rampUp && intervalMetrics.successRate > 0.95) {
        currentRate += rateIncrement;
      } else if (intervalMetrics.successRate < 0.8) {
        currentRate = Math.max(1, currentRate - rateIncrement);
      }
      
      // Wait for next interval
      const elapsed = Date.now() - intervalStart;
      if (elapsed < measurementInterval) {
        await this.sleep(measurementInterval - elapsed);
      }
    }
    
    // Stop metrics collection
    this.metrics.stopCollection();
    
    // Analyze throughput results
    return this.analyzeThroughputMeasurements(measurements);
  }

  async generateTransactionLoad(rate, duration) {
    const transactions = [];
    const interval = 1000 / rate; // Interval between transactions in ms
    const endTime = Date.now() + duration;
    
    while (Date.now() < endTime) {
      const transactionStart = Date.now();
      
      const transaction = {
        id: `tx_${Date.now()}_${Math.random()}`,
        type: this.getRandomTransactionType(),
        data: this.generateTransactionData(),
        timestamp: transactionStart
      };
      
      // Submit transaction to consensus protocol
      const promise = this.protocol.submitTransaction(transaction)
        .then(result => ({
          ...transaction,
          result: result,
          latency: Date.now() - transactionStart,
          success: result.committed === true
        }))
        .catch(error => ({
          ...transaction,
          error: error,
          latency: Date.now() - transactionStart,
          success: false
        }));
      
      transactions.push(promise);
      
      // Wait for next transaction interval
      await this.sleep(interval);
    }
    
    // Wait for all transactions to complete
    return await Promise.all(transactions);
  }

  analyzeThroughputMeasurements(measurements) {
    const totalMeasurements = measurements.length;
    const avgThroughput = measurements.reduce((sum, m) => sum + m.actualThroughput, 0) / totalMeasurements;
    const maxThroughput = Math.max(...measurements.map(m => m.actualThroughput));
    const avgSuccessRate = measurements.reduce((sum, m) => sum + m.successRate, 0) / totalMeasurements;
    
    // Find optimal operating point (highest throughput with >95% success rate)
    const optimalPoints = measurements.filter(m => m.successRate >= 0.95);
    const optimalThroughput = optimalPoints.length > 0 ? 
      Math.max(...optimalPoints.map(m => m.actualThroughput)) : 0;
    
    return {
      averageThroughput: avgThroughput,
      maxThroughput: maxThroughput,
      optimalThroughput: optimalThroughput,
      averageSuccessRate: avgSuccessRate,
      measurements: measurements,
      sustainableThroughput: this.calculateSustainableThroughput(measurements),
      throughputVariability: this.calculateThroughputVariability(measurements)
    };
  }

  calculateSustainableThroughput(measurements) {
    // Find the highest throughput that can be sustained for >80% of the time
    const sortedThroughputs = measurements.map(m => m.actualThroughput).sort((a, b) => b - a);
    const p80Index = Math.floor(sortedThroughputs.length * 0.2);
    return sortedThroughputs[p80Index];
  }
}

Latency Analysis System

class LatencyBenchmark {
  constructor(protocol, configuration) {
    this.protocol = protocol;
    this.config = configuration;
    this.latencyHistogram = new LatencyHistogram();
    this.percentileCalculator = new PercentileCalculator();
  }

  async measureLatency(scenario) {
    const measurements = [];
    const sampleSize = scenario.sampleSize || 10000;
    const warmupSize = scenario.warmupSize || 1000;
    
    console.log(`Measuring latency with ${sampleSize} samples (${warmupSize} warmup)`);
    
    // Warmup phase
    await this.performWarmup(warmupSize);
    
    // Measurement phas

---

*Content truncated.*

You might also like

flutter-development

aj-geddes

Build beautiful cross-platform mobile apps with Flutter and Dart. Covers widgets, state management with Provider/BLoC, navigation, API integration, and material design.

1,5641,368

ui-ux-pro-max

nextlevelbuilder

"UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 8 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient."

1,1051,184

drawio-diagrams-enhanced

jgtolentino

Create professional draw.io (diagrams.net) diagrams in XML format (.drawio files) with integrated PMP/PMBOK methodologies, extensive visual asset libraries, and industry-standard professional templates. Use this skill when users ask to create flowcharts, swimlane diagrams, cross-functional flowcharts, org charts, network diagrams, UML diagrams, BPMN, project management diagrams (WBS, Gantt, PERT, RACI), risk matrices, stakeholder maps, or any other visual diagram in draw.io format. This skill includes access to custom shape libraries for icons, clipart, and professional symbols.

1,4141,106

godot

bfollington

This skill should be used when working on Godot Engine projects. It provides specialized knowledge of Godot's file formats (.gd, .tscn, .tres), architecture patterns (component-based, signal-driven, resource-based), common pitfalls, validation tools, code templates, and CLI workflows. The `godot` command is available for running the game, validating scripts, importing resources, and exporting builds. Use this skill for tasks involving Godot game development, debugging scene/resource files, implementing game systems, or creating new Godot components.

1,191746

nano-banana-pro

garg-aayush

Generate and edit images using Google's Nano Banana Pro (Gemini 3 Pro Image) API. Use when the user asks to generate, create, edit, modify, change, alter, or update images. Also use when user references an existing image file and asks to modify it in any way (e.g., "modify this image", "change the background", "replace X with Y"). Supports both text-to-image generation and image-to-image editing with configurable resolution (1K default, 2K, or 4K for high resolution). DO NOT read the image file first - use this skill directly with the --input-image parameter.

1,147683

pdf-to-markdown

aliceisjustplaying

Convert entire PDF documents to clean, structured Markdown for full context loading. Use this skill when the user wants to extract ALL text from a PDF into context (not grep/search), when discussing or analyzing PDF content in full, when the user mentions "load the whole PDF", "bring the PDF into context", "read the entire PDF", or when partial extraction/grepping would miss important context. This is the preferred method for PDF text extraction over page-by-page or grep approaches.

1,304608

Stay ahead of the MCP ecosystem

Get weekly updates on new skills and servers.