# `ExUtcp.Monitoring.Performance`
[🔗](https://github.com/universal-tool-calling-protocol/elixir-utcp/blob/main/lib/ex_utcp/monitoring/performance.ex#L1)

Performance monitoring for ExUtcp operations.

Tracks performance metrics, identifies bottlenecks, and provides alerts.

# `metric_type`

```elixir
@type metric_type() :: :counter | :gauge | :histogram | :summary
```

# `metric_value`

```elixir
@type metric_value() :: number() | [number()]
```

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `get_operation_stats`

```elixir
@spec get_operation_stats(String.t()) :: map()
```

Gets performance statistics for a specific operation.

# `get_performance_alerts`

```elixir
@spec get_performance_alerts(map() | nil) :: [map()]
```

Checks for performance alerts based on thresholds.

# `get_performance_summary`

```elixir
@spec get_performance_summary() :: %{
  operations: map(),
  system: map(),
  alerts: [map()],
  timestamp: integer(),
  status: atom()
}
```

Gets performance summary for all operations.

# `measure`

```elixir
@spec measure(String.t(), map(), (-&gt; any())) :: any()
```

Measures the execution time of a function and emits telemetry.

# `measure_connection`

```elixir
@spec measure_connection(String.t(), atom(), (-&gt; any())) :: any()
```

Measures connection performance.

# `measure_search`

```elixir
@spec measure_search(String.t(), atom(), map(), (-&gt; any())) :: any()
```

Measures search performance.

# `measure_tool_call`

```elixir
@spec measure_tool_call(String.t(), String.t(), map(), (-&gt; any())) :: any()
```

Measures tool call performance.

# `record_custom_metric`

```elixir
@spec record_custom_metric(String.t(), metric_type(), metric_value(), map()) :: :ok
```

Records a custom performance metric.

# `start_link`

```elixir
@spec start_link(keyword()) :: {:ok, pid()} | {:error, term()}
```

Starts the performance monitor.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
