[DataCollector] Improves the readability of the collected arrays in the profiler

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| License       | MIT

This PR is based on #10155.

Original description:

It simply improves the readability of the collected arrays in the profiler:

__before__:
```
Array(date => Array(year => , month => , day => ), time => Array(hour => ))
```

__after__:
```
[
  date => [
      year => , 
      month => , 
      day => 
  ], 
  time => [
      hour => 
  ]
]
```