journey.diagnostics

Overview

Version compatibility

journey.diagnostics was introduced with version 4.37.0 of the JourneyApps Container.

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

Available diagnostics:

DiagnosticPropertyDescription

getSyncStatus()

lastFullSync

Timestamp of the last full sync that was completed.

See an example below.

attachmentQueue

Count and size of the attachment upload queue.

See an example below.

attachmentQueue.size

Total size in bytes of attachments to upload.

attachmentQueue.count

Number of attachments to be uploaded.

crudQueue

Size of the data upload queue.

See an example below.

crudQueue.count

Number of operations in the upload queue.

crudQueue.size

Total size of object data in upload queue.

getStorageStats()

database

Stats for the main on-device object database. Not LocalDB or attachments.

database.dataSize

Total size in bytes of object data.

database.dataCount

Number of objects.

database.indexSize

Total size in bytes of all indexes.

database.indexCount

Number of index entries.

database.storageSize

Total size in bytes of the main database (excluding attachments).

all()

All available diagnostic information.

See an example below.

Examples

getSyncStatus()

main.js
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

all()

main.js
var diagnostics = journey.diagnostics.all();
var syncStatus = diagnostics.syncStatus;
var storageStats = diagnostics.storageStats;

Last updated