# RunStatisticsQuery

> Tracon documentation. Tracon is a .NET package family that adds a control
> plane on Microsoft Agent Framework, published as NuGet packages that run
> inside your own ASP.NET Core application.
>
> Page: https://tracon.dev/api/tracon.runstatisticsquery/
> Summary: RunStatisticsQuery: The filter for a run statistics query.

<div class="api-provenance">Namespace Tracon · Assembly <code>Tracon.Abstractions.dll</code></div>

The filter for a run statistics query.

```csharp
public sealed record RunStatisticsQuery : IEquatable<RunStatisticsQuery>
```

<dl class="api-relations"><dt>Inheritance</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.object">object</a> ← <a href="/api/tracon.runstatisticsquery/">RunStatisticsQuery</a></dd><dt>Implements</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.iequatable-1">IEquatable&lt;RunStatisticsQuery&gt;</a></dd><dt>Inherited Members</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.object.gettype">object.GetType()</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.tostring">object.ToString()</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)">object.Equals(object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)">object.Equals(object?, object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.referenceequals">object.ReferenceEquals(object?, object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.gethashcode">object.GetHashCode()</a></dd></dl>

## Remarks

There is no pagination: the result is always a single summary row. Use
[RunStatisticsQuery.StartedAfter](/api/tracon.runstatisticsquery/#Tracon_RunStatisticsQuery_StartedAfter) to limit the volume.

## Constructors

### <a id="Tracon_RunStatisticsQuery__ctor"></a> RunStatisticsQuery\(\)

```csharp
public RunStatisticsQuery()
```

## Properties

### <a id="Tracon_RunStatisticsQuery_AgentName"></a> AgentName

Count only this agent's runs.

```csharp
public string? AgentName { get; init; }
```

#### Property Value

 [string](https://learn.microsoft.com/dotnet/api/system.string)?

### <a id="Tracon_RunStatisticsQuery_LabelKey"></a> LabelKey

Count only runs carrying this label key. [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) applies
no label filter.

```csharp
public string? LabelKey { get; init; }
```

#### Property Value

 [string](https://learn.microsoft.com/dotnet/api/system.string)?

### <a id="Tracon_RunStatisticsQuery_LabelValue"></a> LabelValue

The value [RunStatisticsQuery.LabelKey](/api/tracon.runstatisticsquery/#Tracon_RunStatisticsQuery_LabelKey) must have. [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null)
matches any value of that key, and the field is ignored when
[RunStatisticsQuery.LabelKey](/api/tracon.runstatisticsquery/#Tracon_RunStatisticsQuery_LabelKey) is [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null).

```csharp
public string? LabelValue { get; init; }
```

#### Property Value

 [string](https://learn.microsoft.com/dotnet/api/system.string)?

### <a id="Tracon_RunStatisticsQuery_MaxAgents"></a> MaxAgents

The maximum number of rows to return in the agent breakdown. Agents
with the highest run count are returned first.

```csharp
public int MaxAgents { get; init; }
```

#### Property Value

 [int](https://learn.microsoft.com/dotnet/api/system.int32)

#### Remarks

The same ceiling bounds every other breakdown — model, version, user and
label. A statistics response is a summary; paging belongs to
`GET /api/runs`.

### <a id="Tracon_RunStatisticsQuery_StartedAfter"></a> StartedAfter

Count only runs that started after this moment.

```csharp
public DateTimeOffset? StartedAfter { get; init; }
```

#### Property Value

 [DateTimeOffset](https://learn.microsoft.com/dotnet/api/system.datetimeoffset)?

### <a id="Tracon_RunStatisticsQuery_TenantId"></a> TenantId

The tenant filter. The current tenant is used if left empty.

```csharp
public string? TenantId { get; init; }
```

#### Property Value

 [string](https://learn.microsoft.com/dotnet/api/system.string)?

### <a id="Tracon_RunStatisticsQuery_UserId"></a> UserId

Count only this user's runs. [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) counts every user.

```csharp
public string? UserId { get; init; }
```

#### Property Value

 [string](https://learn.microsoft.com/dotnet/api/system.string)?

## Methods

### <a id="Tracon_RunStatisticsQuery_Equals_System_Object_"></a> Equals\(object?\)

```csharp
public override bool Equals(object? obj)
```

#### Parameters

`obj` [object](https://learn.microsoft.com/dotnet/api/system.object)?

#### Returns

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### <a id="Tracon_RunStatisticsQuery_Equals_Tracon_RunStatisticsQuery_"></a> Equals\(RunStatisticsQuery?\)

```csharp
public bool Equals(RunStatisticsQuery? other)
```

#### Parameters

`other` [RunStatisticsQuery](/api/tracon.runstatisticsquery/)?

#### Returns

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### <a id="Tracon_RunStatisticsQuery_GetHashCode"></a> GetHashCode\(\)

```csharp
public override int GetHashCode()
```

#### Returns

 [int](https://learn.microsoft.com/dotnet/api/system.int32)

### <a id="Tracon_RunStatisticsQuery_ToString"></a> ToString\(\)

```csharp
public override string ToString()
```

#### Returns

 [string](https://learn.microsoft.com/dotnet/api/system.string)

## Operators

### <a id="Tracon_RunStatisticsQuery_op_Equality_Tracon_RunStatisticsQuery_Tracon_RunStatisticsQuery_"></a> operator ==\(RunStatisticsQuery?, RunStatisticsQuery?\)

```csharp
public static bool operator ==(RunStatisticsQuery? left, RunStatisticsQuery? right)
```

#### Parameters

`left` [RunStatisticsQuery](/api/tracon.runstatisticsquery/)?

`right` [RunStatisticsQuery](/api/tracon.runstatisticsquery/)?

#### Returns

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### <a id="Tracon_RunStatisticsQuery_op_Inequality_Tracon_RunStatisticsQuery_Tracon_RunStatisticsQuery_"></a> operator \!=\(RunStatisticsQuery?, RunStatisticsQuery?\)

```csharp
public static bool operator !=(RunStatisticsQuery? left, RunStatisticsQuery? right)
```

#### Parameters

`left` [RunStatisticsQuery](/api/tracon.runstatisticsquery/)?

`right` [RunStatisticsQuery](/api/tracon.runstatisticsquery/)?

#### Returns

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)
