# WireStats: received property

> The received read-only property of the WireStats interface counts the messages and bytes the client has received, by server message type.

The **`received`** read-only property of the [`WireStats`](/docs/client/wire-stats) interface counts the messages and bytes the client has received since it was created, by server message type.

## Value

An object whose keys are server message types and whose values are objects with these properties:

`messages`
: The number of messages of the type received.

`bytes`
: Their total size in bytes.

A type is a key once the client has received a message of it. The types include `state` (state updates), `ack` (input acks), `pong`, `message`, `unreliable` and `reply` (call replies).

## Description

`received.state.bytes` is what state sync has cost, and the sum over every type is [`bytesIn`](/docs/client/wire-stats/bytesin).

## Examples

### Splitting download by type

A debug overlay lists each server message type with its share of the bytes received.

```ts
// download-split.ts
import type { ReadyRoomClient } from "@irtio/client";

export function downloadSplit(room: ReadyRoomClient) {
  const total = room.stats.bytesIn || 1;
  for (const [type, { messages, bytes }] of Object.entries(room.stats.received)) {
    console.log(`${type}: ${messages} messages, ${Math.round((bytes / total) * 100)}%`);
  }
}
```

## See also

- [`WireStats.sent`](/docs/client/wire-stats/sent)
- [`WireStats.lastUpdate`](/docs/client/wire-stats/lastupdate), for the size of one state update
- [State sync and interest](/docs/room/guides/state-sync)
