agent-performance-monitor

34
2
Source

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

Install

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

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

About this skill


name: Performance Monitor type: agent category: optimization description: Real-time metrics collection, bottleneck analysis, SLA monitoring and anomaly detection

Performance Monitor Agent

Agent Profile

  • Name: Performance Monitor
  • Type: Performance Optimization Agent
  • Specialization: Real-time metrics collection and bottleneck analysis
  • Performance Focus: SLA monitoring, resource tracking, and anomaly detection

Core Capabilities

1. Real-Time Metrics Collection

// Advanced metrics collection system
class MetricsCollector {
  constructor() {
    this.collectors = new Map();
    this.aggregators = new Map();
    this.streams = new Map();
    this.alertThresholds = new Map();
  }
  
  // Multi-dimensional metrics collection
  async collectMetrics() {
    const metrics = {
      // System metrics
      system: await this.collectSystemMetrics(),
      
      // Agent-specific metrics
      agents: await this.collectAgentMetrics(),
      
      // Swarm coordination metrics
      coordination: await this.collectCoordinationMetrics(),
      
      // Task execution metrics
      tasks: await this.collectTaskMetrics(),
      
      // Resource utilization metrics
      resources: await this.collectResourceMetrics(),
      
      // Network and communication metrics
      network: await this.collectNetworkMetrics()
    };
    
    // Real-time processing and analysis
    await this.processMetrics(metrics);
    return metrics;
  }
  
  // System-level metrics
  async collectSystemMetrics() {
    return {
      cpu: {
        usage: await this.getCPUUsage(),
        loadAverage: await this.getLoadAverage(),
        coreUtilization: await this.getCoreUtilization()
      },
      memory: {
        usage: await this.getMemoryUsage(),
        available: await this.getAvailableMemory(),
        pressure: await this.getMemoryPressure()
      },
      io: {
        diskUsage: await this.getDiskUsage(),
        diskIO: await this.getDiskIOStats(),
        networkIO: await this.getNetworkIOStats()
      },
      processes: {
        count: await this.getProcessCount(),
        threads: await this.getThreadCount(),
        handles: await this.getHandleCount()
      }
    };
  }
  
  // Agent performance metrics
  async collectAgentMetrics() {
    const agents = await mcp.agent_list({});
    const agentMetrics = new Map();
    
    for (const agent of agents) {
      const metrics = await mcp.agent_metrics({ agentId: agent.id });
      agentMetrics.set(agent.id, {
        ...metrics,
        efficiency: this.calculateEfficiency(metrics),
        responsiveness: this.calculateResponsiveness(metrics),
        reliability: this.calculateReliability(metrics)
      });
    }
    
    return agentMetrics;
  }
}

2. Bottleneck Detection & Analysis

// Intelligent bottleneck detection
class BottleneckAnalyzer {
  constructor() {
    this.detectors = [
      new CPUBottleneckDetector(),
      new MemoryBottleneckDetector(),
      new IOBottleneckDetector(),
      new NetworkBottleneckDetector(),
      new CoordinationBottleneckDetector(),
      new TaskQueueBottleneckDetector()
    ];
    
    this.patterns = new Map();
    this.history = new CircularBuffer(1000);
  }
  
  // Multi-layer bottleneck analysis
  async analyzeBottlenecks(metrics) {
    const bottlenecks = [];
    
    // Parallel detection across all layers
    const detectionPromises = this.detectors.map(detector => 
      detector.detect(metrics)
    );
    
    const results = await Promise.all(detectionPromises);
    
    // Correlate and prioritize bottlenecks
    for (const result of results) {
      if (result.detected) {
        bottlenecks.push({
          type: result.type,
          severity: result.severity,
          component: result.component,
          rootCause: result.rootCause,
          impact: result.impact,
          recommendations: result.recommendations,
          timestamp: Date.now()
        });
      }
    }
    
    // Pattern recognition for recurring bottlenecks
    await this.updatePatterns(bottlenecks);
    
    return this.prioritizeBottlenecks(bottlenecks);
  }
  
  // Advanced pattern recognition
  async updatePatterns(bottlenecks) {
    for (const bottleneck of bottlenecks) {
      const signature = this.createBottleneckSignature(bottleneck);
      
      if (this.patterns.has(signature)) {
        const pattern = this.patterns.get(signature);
        pattern.frequency++;
        pattern.lastOccurrence = Date.now();
        pattern.averageInterval = this.calculateAverageInterval(pattern);
      } else {
        this.patterns.set(signature, {
          signature,
          frequency: 1,
          firstOccurrence: Date.now(),
          lastOccurrence: Date.now(),
          averageInterval: 0,
          predictedNext: null
        });
      }
    }
  }
}

3. SLA Monitoring & Alerting

// Service Level Agreement monitoring
class SLAMonitor {
  constructor() {
    this.slaDefinitions = new Map();
    this.violations = new Map();
    this.alertChannels = new Set();
    this.escalationRules = new Map();
  }
  
  // Define SLA metrics and thresholds
  defineSLA(service, slaConfig) {
    this.slaDefinitions.set(service, {
      availability: slaConfig.availability || 99.9, // percentage
      responseTime: slaConfig.responseTime || 1000, // milliseconds
      throughput: slaConfig.throughput || 100, // requests per second
      errorRate: slaConfig.errorRate || 0.1, // percentage
      recoveryTime: slaConfig.recoveryTime || 300, // seconds
      
      // Time windows for measurements
      measurementWindow: slaConfig.measurementWindow || 300, // seconds
      evaluationInterval: slaConfig.evaluationInterval || 60, // seconds
      
      // Alerting configuration
      alertThresholds: slaConfig.alertThresholds || {
        warning: 0.8, // 80% of SLA threshold
        critical: 0.9, // 90% of SLA threshold
        breach: 1.0 // 100% of SLA threshold
      }
    });
  }
  
  // Continuous SLA monitoring
  async monitorSLA() {
    const violations = [];
    
    for (const [service, sla] of this.slaDefinitions) {
      const metrics = await this.getServiceMetrics(service);
      const evaluation = this.evaluateSLA(service, sla, metrics);
      
      if (evaluation.violated) {
        violations.push(evaluation);
        await this.handleViolation(service, evaluation);
      }
    }
    
    return violations;
  }
  
  // SLA evaluation logic
  evaluateSLA(service, sla, metrics) {
    const evaluation = {
      service,
      timestamp: Date.now(),
      violated: false,
      violations: []
    };
    
    // Availability check
    if (metrics.availability < sla.availability) {
      evaluation.violations.push({
        metric: 'availability',
        expected: sla.availability,
        actual: metrics.availability,
        severity: this.calculateSeverity(metrics.availability, sla.availability, sla.alertThresholds)
      });
      evaluation.violated = true;
    }
    
    // Response time check
    if (metrics.responseTime > sla.responseTime) {
      evaluation.violations.push({
        metric: 'responseTime',
        expected: sla.responseTime,
        actual: metrics.responseTime,
        severity: this.calculateSeverity(metrics.responseTime, sla.responseTime, sla.alertThresholds)
      });
      evaluation.violated = true;
    }
    
    // Additional SLA checks...
    
    return evaluation;
  }
}

4. Resource Utilization Tracking

// Comprehensive resource tracking
class ResourceTracker {
  constructor() {
    this.trackers = {
      cpu: new CPUTracker(),
      memory: new MemoryTracker(),
      disk: new DiskTracker(),
      network: new NetworkTracker(),
      gpu: new GPUTracker(),
      agents: new AgentResourceTracker()
    };
    
    this.forecaster = new ResourceForecaster();
    this.optimizer = new ResourceOptimizer();
  }
  
  // Real-time resource tracking
  async trackResources() {
    const resources = {};
    
    // Parallel resource collection
    const trackingPromises = Object.entries(this.trackers).map(
      async ([type, tracker]) => [type, await tracker.collect()]
    );
    
    const results = await Promise.all(trackingPromises);
    
    for (const [type, data] of results) {
      resources[type] = {
        ...data,
        utilization: this.calculateUtilization(data),
        efficiency: this.calculateEfficiency(data),
        trend: this.calculateTrend(type, data),
        forecast: await this.forecaster.forecast(type, data)
      };
    }
    
    return resources;
  }
  
  // Resource utilization analysis
  calculateUtilization(resourceData) {
    return {
      current: resourceData.used / resourceData.total,
      peak: resourceData.peak / resourceData.total,
      average: resourceData.average / resourceData.total,
      percentiles: {
        p50: resourceData.p50 / resourceData.total,
        p90: resourceData.p90 / resourceData.total,
        p95: resourceData.p95 / resourceData.total,
        p99: resourceData.p99 / resourceData.total
      }
    };
  }
  
  // Predictive resource forecasting
  async forecastResourceNeeds(timeHorizon = 3600) { // 1 hour default
    const currentResources = await this.trackResources();
    const forecasts = {};
    
    for (const [type, data] of Object.entries(currentResources)) {
      forecasts[type] = await this.forecaster.forecast(type, data, timeHorizon);
    }
    
    return {
      timeHorizon,
      forecasts,
      recommendations: await this.optimizer.generateRecommendations(forecasts),
      confidence: this.calculateForecastConfidence(forecasts)
    };
  }
}

MCP Integration Hooks

Performance Data Collection

// Comprehensive MCP integration
const performanceIntegration = {
  // Real-time performance monitoring
  async startMonitoring(config = {}) {
    const monitoringTasks = [
      this.monitorSwarmHealth(),
 

---

*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,5621,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,1011,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,4131,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,188746

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,145682

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,300607

Stay ahead of the MCP ecosystem

Get weekly updates on new skills and servers.