# `Journey.Insights.Status`
[🔗](https://github.com/shipworthy/journey/blob/main/lib/journey/insights/status.ex#L1)

Provides system health and monitoring insights for Journey executions.

# `status`

Returns current system health for monitoring/alerting

## Response Structure

- `status` - `:healthy` or `:unhealthy`
- `database_connected` - Boolean indicating DB connectivity
- `graphs` - List of graph statistics, one per graph name/version

## Example output:

```elixir
%{
  status: :healthy,
  graphs: [
    %{
      stats: %{
        computations: %{
          by_state: %{
            abandoned: 239,
            cancelled: 0,
            success: 21106,
            failed: 0,
            not_set: 59294,
            computing: 0
          },
          most_recently_created: "2025-07-30T00:07:37Z",
          most_recently_updated: "2025-07-30T00:07:41Z"
        },
        executions: %{
          active: 4597,
          most_recently_created: "2025-07-30T00:07:37Z",
          most_recently_updated: "2025-07-30T00:07:41Z",
          archived: 2103
        }
      },
      graph_name: "Credit Card Application flow graph",
      graph_version: "v1.0.0"
    }
  ],
  database_connected: true
}
```

# `to_text`

Formats status data as human-readable text output.

## Example:

    iex> status_data = Journey.Insights.Status.status()
    iex> Journey.Insights.Status.to_text(status_data) |> IO.puts()
    System Status: HEALTHY
    Database: Connected
    ================================================================================

    GRAPHS (3 total):
    ----------

    Name: 'Credit Card Application flow graph'
    Version: 'v1.0.0'
    Executions:
    - active: 12.7k
    - archived: 5.1k
    First activity: 2025-07-28T19:50:40Z
    Last activity: 2025-08-14T05:31:05Z
    Computations:
    ✓ success: 61.4k
    ✗ failed: 0
    ⏳ computing: 33
    ◯ not_set: 151.7k
    ⚠ abandoned: 1.0k

    ---------

    Name: 'flow_analytics_perf_test'
    Version: '1.0.0'
    Executions:
    - active: 900
    - archived: 100
    First activity: 2025-08-01T22:05:06Z
    Last activity: 2025-08-01T22:05:09Z
    Computations:
    ✓ success: 1.7k
    ⏳ computing: 54
    ◯ not_set: 2.3k

    ---------

    Name: 'g1'
    Version: 'v1'
    Executions:
    - active: 25
    - archived: 0
    First activity: 2025-08-14T17:23:16Z
    Last activity: 2025-08-14T17:29:36Z
    Computations:
    ✓ success: 38
    ✗ failed: 7
    ◯ not_set: 4
    ⚠ abandoned: 2

---

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