# Performance Monitor Helper

## Interface Definition

**Interface Name**: `IPerformanceMonitor`

### Interface Methods

```python
class IPerformanceMonitor(ABC):
    @abstractmethod
    def start_timer(self, operation: str) -> str:
        pass
    
    @abstractmethod
    def end_timer(self, timer_id: str) -> float:
        pass
    
    @abstractmethod
    def get_statistics(self, operation: str) -> PerformanceStats:
        pass
    
    @abstractmethod
    def check_sla(self, operation: str, threshold: float) -> bool:
        pass
    
    @abstractmethod
    def get_bottlenecks(self) -> List[Tuple[str, float]]:
        pass
```

## Component Description

Tracks processing times, ensures <5s constraint per frame.

## API Methods

### `start_timer(operation: str) -> str`

**Description**: Starts timing an operation.

**Returns**: timer_id (UUID)

---

### `end_timer(timer_id: str) -> float`

**Description**: Ends timer and records duration.

**Returns**: Duration in seconds

---

### `get_statistics(operation: str) -> PerformanceStats`

**Description**: Gets statistics for an operation.

**Output**:
```python
PerformanceStats:
    operation: str
    count: int
    mean: float
    p50: float
    p95: float
    p99: float
    max: float
```

---

### `check_sla(operation: str, threshold: float) -> bool`

**Description**: Checks if operation meets SLA threshold.

**Example**: check_sla("frame_processing", 5.0) → True if < 5s

---

### `get_bottlenecks() -> List[Tuple[str, float]]`

**Description**: Returns slowest operations.

## Dependencies

**External**: time, statistics

## Test Cases

1. Start/end timer → records duration
2. Get statistics → returns percentiles
3. Check SLA → returns True if meeting targets

