# WireStats: messagesIn property

> The messagesIn property of the WireStats interface is the number of protocol messages the client has received.

The **`messagesIn`** property of the [`WireStats`](/docs/client/wire-stats) interface is the number of protocol messages the client has received since it was created, across reconnects.

## Value

A number, from 0. The client counts every message the router sends it: state updates, pongs, room messages, call replies and the rest. [`received`](/docs/client/wire-stats/received) splits it by message type.

## Examples

### Counting messages a second

A debug overlay shows how many messages arrive each second, which rises with the room's tick rate and with what the client sees.

```ts
// messages-per-second.ts
import type { ReadyRoomClient } from "@irtio/client";

export function countMessages(room: ReadyRoomClient) {
  let last = room.stats.messagesIn;
  return setInterval(() => {
    console.log(`${room.stats.messagesIn - last} messages/s in`);
    last = room.stats.messagesIn;
  }, 1000);
}
```

## See also

- [`WireStats.bytesIn`](/docs/client/wire-stats/bytesin)
- [`WireStats.messagesOut`](/docs/client/wire-stats/messagesout)
