This module is meant to handle event tracking
- Description:
This module is meant to handle event tracking
- Source:
Methods
(static) collectServerData() → {Object}
- Description:
Get server data
- Source:
Returns:
server data
- Type
- Object
(static) collectServerStats() → {Promise.<Object>}
- Description:
Get server stats
- Source:
Returns:
server stats
- Type
- Promise.<Object>
(static) enable()
- Description:
Enable tracking for this server
- Source:
(static) getAllData() → {Object}
- Description:
Get all eligible data
- Source:
Returns:
all eligible data
- Type
- Object
(static) getBulkServer() → {Object}
- Description:
Get bulk server instance
- Source:
Returns:
Countly Bulk instance
- Type
- Object
(static) getBulkUser(serverInstance) → {Object}
- Description:
Get bulk user instance
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
serverInstance |
Object | Countly Bulk server instance |
Returns:
Countly Bulk User instance
- Type
- Object
(static) getSDK() → {Object}
- Description:
Get SDK instance
- Source:
Returns:
Countly NodeJS SDK instance
- Type
- Object
(static) getSDKData() → {Promise.<Object>}
- Description:
Query sdks collection for current and previous year (month 0) and combine meta_v2 data
- Source:
Returns:
Combined meta_v2 data from all matching documents
- Type
- Promise.<Object>
(static) isEnabled() → {boolean}
- Description:
Check if tracking enabled
- Source:
Returns:
if enabled
- Type
- boolean
(static) reportEvent(event)
- Description:
Report server level event
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
event |
object | event object |
(static) reportEventBulk(events)
- Description:
Report server level event in bulk
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
events |
Array | array of event objects |
(static) reportLicenseEvent(name, license, extraopt)
- Description:
Report a license lifecycle event with the shared segmentation core (license v2 design §6). Events are edge-triggered by the caller (License.check transition tracking) — this helper only stamps the shared core and forwards through the standard gates (isEnabled + server_events).
- Source:
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
name |
string | event key, e.g. "license_expired" |
|
license |
object | decoded license content (may be empty for license_removed) |
|
extra |
object |
<optional> |
event-specific segmentation |
(static) reportLicenseState(license, extraopt)
- Description:
Upsert the current license state as user properties on this server's tracked user (license v2 design §7) — slow-changing current-state props, so the whole fleet is segmentable by license on the tracking server.
- Source:
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
license |
object | decoded license content |
|
extra |
object |
<optional> |
additional current-state props (e.g. license_status, apps) |
(static) reportUserEvent(id, event)
- Description:
Report user level event
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
id |
string | id of the device |
event |
object | event object |
(static) uploadBase64FileFromGridFS(base64String) → {Promise.<Object>}
- Description:
Upload a base64-encoded file from GridFS to the stats server This function handles files stored in GridFS as base64 strings (e.g., data URIs) and decodes them before uploading
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
base64String |
Object | Picture data |
Returns:
Upload result
- Type
- Promise.<Object>
(inner) hasDockerCGroup() → {boolean}
- Description:
Check if running in Docker by inspecting cgroup info
- Source:
Returns:
if running in docker
- Type
- boolean
(inner) hasDockerEnv() → {boolean}
- Description:
Check if running in Docker environment
- Source:
Returns:
if running in docker
- Type
- boolean
(inner) hasDockerMountInfo() → {boolean}
- Description:
Check if running in Docker by inspecting mountinfo
- Source:
Returns:
if running in docker
- Type
- boolean
(inner) stripTrailingSlash(str) → {string}
- Description:
Strip traling slashes from url
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
str |
string | url to strip |
Returns:
stripped url
- Type
- string