# journey.diagnostics

### Overview

{% hint style="info" %}
**Version compatibility**

`journey.diagnostics` was introduced with version **4.37.0** of the JourneyApps Container.
{% endhint %}

Returns diagnostics information otherwise only available to the user via the context menu.

Available diagnostics:

<table><thead><tr><th width="240.33333333333331">Diagnostic</th><th>Property</th><th>Description</th></tr></thead><tbody><tr><td><code>getSyncStatus()</code></td><td><code>lastFullSync</code></td><td><p>Timestamp of the last full sync that was completed. </p><p></p><p>See an <a href="#getsyncstatus">example</a> below.</p></td></tr><tr><td></td><td><code>attachmentQueue</code></td><td><p>Count and size of the attachment upload queue.</p><p></p><p>See an <a href="#getsyncstatus">example</a> below.</p></td></tr><tr><td></td><td><code>attachmentQueue.size</code></td><td>Total size in bytes of attachments to upload.</td></tr><tr><td></td><td><code>attachmentQueue.count</code></td><td>Number of attachments to be uploaded.</td></tr><tr><td></td><td><code>crudQueue</code></td><td><p>Size of the data upload queue.</p><p></p><p>See an <a href="#getsyncstatus">example</a> below.</p></td></tr><tr><td></td><td><code>crudQueue.count</code></td><td>Number of operations in the upload queue.</td></tr><tr><td></td><td><code>crudQueue.size</code></td><td>Total size of object data in upload queue.</td></tr><tr><td><code>getStorageStats()</code></td><td><code>database</code></td><td>Stats for the main on-device object database. Not LocalDB or attachments.</td></tr><tr><td></td><td><code>database.dataSize</code></td><td>Total size in bytes of object data.</td></tr><tr><td></td><td><code>database.dataCount</code></td><td>Number of objects.</td></tr><tr><td></td><td><code>database.indexSize</code></td><td>Total size in bytes of all indexes.</td></tr><tr><td></td><td><code>database.indexCount</code></td><td>Number of index entries.</td></tr><tr><td></td><td><code>database.storageSize</code></td><td>Total size in bytes of the main database (excluding attachments).</td></tr><tr><td><code>all()</code></td><td></td><td><p>All available diagnostic information. </p><p></p><p>See an <a href="#all">example</a> below.</p></td></tr></tbody></table>

### Examples

#### `getSyncStatus()`

{% code title="main.js" %}

```javascript
var syncStatus = journey.diagnostics.getSyncStatus();

syncStatus.lastFullSync
// => Fri Jul 27 2018 17:07:56 GMT+0200 (South Africa Standard Time)

syncStatus.lastFullSync.getTime()
// => 1532704076000

syncStatus.attachmentQueue.size // => 174575
syncStatus.attachmentQueue.count // => 1

syncStatus.crudQueue.count // => 3
```

{% endcode %}

#### `all()`

{% code title="main.js" %}

```javascript
var diagnostics = journey.diagnostics.all();
var syncStatus = diagnostics.syncStatus;
var storageStats = diagnostics.storageStats;
```

{% endcode %}
