<!--
 ⚠️  AUTO-GENERATED FILE - DO NOT EDIT MANUALLY
 This file is automatically generated by scripts/docs-generator.js
 To make changes, edit the source TypeScript files or update the generator script
-->

[playground](../../) / [Exports](../modules) / PlaygroundStatisticsPlugin

# Class: PlaygroundStatisticsPlugin

PlaygroundStatisticsPlugin

Standalone recorder for Playground metrics. This is intentionally not coupled
to the SDK plugin system; it just stores metrics for the Playground UI.

## Table of contents

### Constructors

- [constructor](PlaygroundStatisticsPlugin#constructor)

### Methods

- [recordPlaygroundExecution](PlaygroundStatisticsPlugin#recordplaygroundexecution)
- [recordUIInteraction](PlaygroundStatisticsPlugin#recorduiinteraction)
- [recordBlockCreation](PlaygroundStatisticsPlugin#recordblockcreation)
- [getPlaygroundStats](PlaygroundStatisticsPlugin#getplaygroundstats)
- [resetStatistics](PlaygroundStatisticsPlugin#resetstatistics)

## Constructors

### constructor

• **new PlaygroundStatisticsPlugin**(`options?`, `logger?`): [`PlaygroundStatisticsPlugin`](PlaygroundStatisticsPlugin)

#### Parameters

| Name      | Type                           | Default value  |
| :-------- | :----------------------------- | :------------- |
| `options` | `IPlaygroundStatisticsOptions` | `{}`           |
| `logger`  | `AbstractLogger`               | `SilentLogger` |

#### Returns

[`PlaygroundStatisticsPlugin`](PlaygroundStatisticsPlugin)

#### Defined in

[playground/src/lib/playground/plugins/playground-statistics-plugin.ts:26](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/playground/src/lib/playground/plugins/playground-statistics-plugin.ts#L26)

## Methods

### recordPlaygroundExecution

▸ **recordPlaygroundExecution**(`result`): `Promise`\<`void`\>

#### Parameters

| Name     | Type                         |
| :------- | :--------------------------- |
| `result` | `IPlaygroundExecutionResult` |

#### Returns

`Promise`\<`void`\>

#### Defined in

[playground/src/lib/playground/plugins/playground-statistics-plugin.ts:59](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/playground/src/lib/playground/plugins/playground-statistics-plugin.ts#L59)

---

### recordUIInteraction

▸ **recordUIInteraction**(`type`, `metadata?`): `Promise`\<`void`\>

#### Parameters

| Name        | Type                                                                                                                                                                                        |
| :---------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `type`      | `"chat_send"` \| `"agent_create"` \| `"team_create"` \| `"agent_start"` \| `"team_start"` \| `"agent_stop"` \| `"team_stop"` \| `"block_expand"` \| `"block_collapse"` \| `"config_change"` |
| `metadata?` | `Record`\<`string`, `TUniversalValue`\>                                                                                                                                                     |

#### Returns

`Promise`\<`void`\>

#### Defined in

[playground/src/lib/playground/plugins/playground-statistics-plugin.ts:78](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/playground/src/lib/playground/plugins/playground-statistics-plugin.ts#L78)

---

### recordBlockCreation

▸ **recordBlockCreation**(`_blockType`, `_metadata?`): `Promise`\<`void`\>

#### Parameters

| Name         | Type                                    |
| :----------- | :-------------------------------------- |
| `_blockType` | `string`                                |
| `_metadata?` | `Record`\<`string`, `TUniversalValue`\> |

#### Returns

`Promise`\<`void`\>

#### Defined in

[playground/src/lib/playground/plugins/playground-statistics-plugin.ts:90](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/playground/src/lib/playground/plugins/playground-statistics-plugin.ts#L90)

---

### getPlaygroundStats

▸ **getPlaygroundStats**(): `IPlaygroundStatisticsStats`

#### Returns

`IPlaygroundStatisticsStats`

#### Defined in

[playground/src/lib/playground/plugins/playground-statistics-plugin.ts:97](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/playground/src/lib/playground/plugins/playground-statistics-plugin.ts#L97)

---

### resetStatistics

▸ **resetStatistics**(): `void`

#### Returns

`void`

#### Defined in

[playground/src/lib/playground/plugins/playground-statistics-plugin.ts:107](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/playground/src/lib/playground/plugins/playground-statistics-plugin.ts#L107)
