journey.diagnostics
Overview
Returns diagnostics information otherwise only available to the user via the context menu.
Available diagnostics:
getSyncStatus()
lastFullSync
Timestamp of the last full sync that was completed.
See an example below.
attachmentQueue.size
Total size in bytes of attachments to upload.
attachmentQueue.count
Number of attachments to be uploaded.
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).
Examples
getSyncStatus()
getSyncStatus()
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()
all()
var diagnostics = journey.diagnostics.all();
var syncStatus = diagnostics.syncStatus;
var storageStats = diagnostics.storageStats;
Last updated