Skip to content

Commit 966a564

Browse files
authored
Merge pull request rdkcentral#5916 from adrianM27/main_analytics_documentation
RDK-54875: Analytics plugin documentation
2 parents add8a2f + 6950992 commit 966a564

File tree

7 files changed

+205
-52
lines changed

7 files changed

+205
-52
lines changed

Analytics/Analytics.json

Lines changed: 12 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"info": {
55
"title": "Analytics API",
66
"class": "Analytics",
7-
"description": "The `Analytics` plugin allows sending analytics events to dedicated backends."
7+
"description": "The `Analytics` plugin allows sending analytics events to dedicated backends. Currently the SIFT backend is supported."
88
},
99
"common": {
1010
"$ref": "../common/common.json"
@@ -49,17 +49,20 @@
4949
"example": 35000
5050
},
5151
"eventPayload":{
52-
"summary": "The payload of the event",
52+
"summary": "Custom payload of the event in JSON format. User defined colection of objects and keys. May be an empty object",
5353
"type": "object",
54-
"example": {
55-
"key1": "value1",
56-
"key2": "value2"
54+
"properties": {
55+
"keyOrObject": {
56+
"summary": "User defined custom key or object",
57+
"type": "string",
58+
"example": "value1"
59+
}
5760
}
5861
}
5962
},
6063
"methods": {
6164
"sendEvent":{
62-
"summary": "Send event",
65+
"summary": "Enqueue an event to be sent to the SIFT analytics backend",
6366
"params": {
6467
"type":"object",
6568
"properties": {
@@ -97,32 +100,9 @@
97100
]
98101
},
99102
"result": {
100-
"$ref": "#/common/result"
101-
}
102-
},
103-
"setSessionId" : {
104-
"summary": "Set the session ID for the analytics events",
105-
"params": {
106-
"type":"object",
107-
"properties": {
108-
"sessionId":{
109-
"summary": "Session ID",
110-
"type": "string",
111-
"example": "1234567890"
112-
}
113-
},
114-
"required": [
115-
"sessionId"
116-
]
117-
},
118-
"result": {
119-
"$ref": "#/common/result"
120-
}
121-
},
122-
"setTimeReady" : {
123-
"summary": "Let the analytics plugin know that the system time is ready and valid",
124-
"result": {
125-
"$ref": "#/common/result"
103+
"summary": "On success null will be returned",
104+
"type": "string",
105+
"example": "null"
126106
}
127107
}
128108
}

Analytics/AnalyticsPlugin.json

Lines changed: 119 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,120 @@
11
{
2-
"$schema": "https://raw.githubusercontent.com/rdkcentral/rdkservices/main/Tools/json_generator/schemas/plugin.schema.json",
3-
"info": {
4-
"title": "Analytics Plugin",
5-
"callsign": "org.rdk.Analytics",
6-
"locator": "libWPEFrameworkAnalytics.so",
7-
"status": "development",
8-
"description": "The `Analytics` plugin allows to send analytics events to dedicated backends."
9-
},
10-
"interface": {
11-
"$ref": "Analytics.json#"
12-
}
13-
}
2+
"$schema":"https://raw.githubusercontent.com/rdkcentral/rdkservices/main/Tools/json_generator/schemas/plugin.schema.json",
3+
"info":{
4+
"title":"Analytics Plugin",
5+
"callsign":"org.rdk.Analytics",
6+
"locator":"libWPEFrameworkAnalytics.so",
7+
"status":"development",
8+
"description":"The `Analytics` plugin allows to send analytics events to dedicated backends. Currently the SIFT backend is supported."
9+
},
10+
"configuration":{
11+
"type":"object",
12+
"properties":{
13+
"configuration":{
14+
"type":"object",
15+
"properties":{
16+
"deviceosname":{
17+
"description":"Device OS name",
18+
"type":"string"
19+
},
20+
"sift":{
21+
"type":"object",
22+
"properties":{
23+
"schema2":{
24+
"description":"If true, enables Sift 2.0 schema, otherwise uses Sift 1.0 schema",
25+
"type":"boolean"
26+
},
27+
"commonschema":{
28+
"description":"Sift schema common schema",
29+
"type":"string"
30+
},
31+
"env":{
32+
"description":"Sift schema environment",
33+
"type":"string"
34+
},
35+
"productname":{
36+
"description":"Sift schema product name",
37+
"type":"string"
38+
},
39+
"loggername":{
40+
"description":"Sift schema logger name",
41+
"type":"string"
42+
},
43+
"loggerversion":{
44+
"description":"Sift schema logger version",
45+
"type":"string"
46+
},
47+
"platformdefault":{
48+
"description":"Sift schema platform default value",
49+
"type":"string"
50+
},
51+
"maxrandomisationwindowtime":{
52+
"description":"Sift uploader max randomisation window time of posting queued events in seconds",
53+
"type":"number"
54+
},
55+
"maxeventsinpost":{
56+
"description":"Sift uploader max events in single post",
57+
"type":"number"
58+
},
59+
"maxretries":{
60+
"description":"Sift uploader max retries posting events",
61+
"type":"number"
62+
},
63+
"minretryperiod":{
64+
"description":"Sift uploader min retry period seconds",
65+
"type":"number"
66+
},
67+
"maxretryperiod":{
68+
"description":"Sift uploader max retry period seconds",
69+
"type":"number"
70+
},
71+
"exponentialperiodicfactor":{
72+
"description":"Sift uploader exponential periodic factor for retry delay",
73+
"type":"number"
74+
},
75+
"storepath":{
76+
"description":"Sift store path to persistent queue with events",
77+
"type":"number"
78+
},
79+
"eventslimit":{
80+
"description":"Sift store events limit",
81+
"type":"number"
82+
},
83+
"url":{
84+
"description":"URL to Sift server endpoint",
85+
"type":"string"
86+
}
87+
},
88+
"required":[
89+
"schema2",
90+
"commonschema",
91+
"productname",
92+
"loggername",
93+
"loggerversion",
94+
"platformdefault",
95+
"maxrandomisationwindowtime",
96+
"maxeventsinpost",
97+
"maxretries",
98+
"minretryperiod",
99+
"maxretryperiod",
100+
"exponentialperiodicfactor",
101+
"storepath",
102+
"eventslimit",
103+
"url"
104+
]
105+
}
106+
},
107+
"required":[
108+
"deviceosname",
109+
"sift"
110+
]
111+
}
112+
},
113+
"required":[
114+
"configuration"
115+
]
116+
},
117+
"interface":{
118+
"$ref":"Analytics.json#"
119+
}
120+
}

Analytics/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ All notable changes to this RDK Service will be documented in this file.
1414

1515
For more details, refer to versioning section under Main README.
1616

17+
## [1.0.2] - 2024-12-04
18+
- Documentation update
19+
1720
## [1.0.1] - 2024-10-16
1821
- Support generation of sessionID, SysTime validation and limit nbr of external attributes for Sift
1922

Analytics/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ set(MODULE_NAME ${NAMESPACE}${PLUGIN_NAME})
2020

2121
set(VERSION_MAJOR 1)
2222
set(VERSION_MINOR 0)
23-
set(VERSION_PATCH 1)
23+
set(VERSION_PATCH 2)
2424

2525
add_compile_definitions(ANALYTICS_MAJOR_VERSION=${VERSION_MAJOR})
2626
add_compile_definitions(ANALYTICS_MINOR_VERSION=${VERSION_MINOR})

docs/_sidebar.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
- [**Developer Guide**](developerguide/develperguidefornewplugin.md)
55
- [**API Reference**](/README)
66
- [ActivityMonitor](api/ActivityMonitorPlugin.md)
7+
- [Analytics](api/AnalyticsPlugin.md)
78
- [AVInput](api/AVInputPlugin.md)
89
- [Bluetooth](api/BluetoothPlugin.md)
910
- [CompositeInput](api/CompositeInputPlugin.md)

docs/api/AnalyticsPlugin.md

Lines changed: 68 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<a name="Analytics_Plugin"></a>
33
# Analytics Plugin
44

5-
**Version: [1.0.0](https://github.com/rdkcentral/rdkservices/blob/main/Analytics/CHANGELOG.md)**
5+
**Version: [1.0.2](https://github.com/rdkcentral/rdkservices/blob/main/Analytics/CHANGELOG.md)**
66

77
A org.rdk.Analytics plugin for Thunder framework.
88

@@ -21,7 +21,7 @@ A org.rdk.Analytics plugin for Thunder framework.
2121
<a name="Description"></a>
2222
# Description
2323

24-
The `Analytics` plugin allows to send analytics events to dedicated backends.
24+
The `Analytics` plugin allows to send analytics events to dedicated backends. Currently the SIFT backend is supported.
2525

2626
The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#Thunder)].
2727

@@ -36,6 +36,25 @@ The table below lists configuration options of the plugin.
3636
| classname | string | Class name: *org.rdk.Analytics* |
3737
| locator | string | Library name: *libWPEFrameworkAnalytics.so* |
3838
| autostart | boolean | Determines if the plugin shall be started automatically along with the framework |
39+
| configuration | object | |
40+
| configuration.deviceosname | string | Device OS name |
41+
| configuration.sift | object | |
42+
| configuration.sift.schema2 | boolean | If true, enables Sift 2.0 schema, otherwise uses Sift 1.0 schema |
43+
| configuration.sift.commonschema | string | Sift schema common schema |
44+
| configuration.sift?.env | string | <sup>*(optional)*</sup> Sift schema environment |
45+
| configuration.sift.productname | string | Sift schema product name |
46+
| configuration.sift.loggername | string | Sift schema logger name |
47+
| configuration.sift.loggerversion | string | Sift schema logger version |
48+
| configuration.sift.platformdefault | string | Sift schema platform default value |
49+
| configuration.sift.maxrandomisationwindowtime | number | Sift uploader max randomisation window time of posting queued events in seconds |
50+
| configuration.sift.maxeventsinpost | number | Sift uploader max events in single post |
51+
| configuration.sift.maxretries | number | Sift uploader max retries posting events |
52+
| configuration.sift.minretryperiod | number | Sift uploader min retry period seconds |
53+
| configuration.sift.maxretryperiod | number | Sift uploader max retry period seconds |
54+
| configuration.sift.exponentialperiodicfactor | number | Sift uploader exponential periodic factor for retry delay |
55+
| configuration.sift.storepath | number | Sift store path to persistent queue with events |
56+
| configuration.sift.eventslimit | number | Sift store events limit |
57+
| configuration.sift.url | string | URL to Sift server endpoint |
3958

4059
<a name="Methods"></a>
4160
# Methods
@@ -46,15 +65,13 @@ Analytics interface methods:
4665

4766
| Method | Description |
4867
| :-------- | :-------- |
49-
| [sendEvent](#sendEvent) | Send event |
50-
| [setSessionId](#setSessionId) | Set the session ID for the analytics events |
51-
| [setTimeReady](#setTimeReady) | Let the analytics plugin know that the system time is ready and valid |
68+
| [sendEvent](#sendEvent) | Enqueue an event to be sent to the SIFT analytics backend |
5269

5370

5471
<a name="sendEvent"></a>
5572
## *sendEvent*
5673

57-
Send
74+
Enqueue an event to be sent to the SIFT analytics backend.
5875

5976
### Events
6077

@@ -73,4 +90,48 @@ No Events
7390
| params.cetList[#] | string | |
7491
| params?.epochTimestamp | integer | <sup>*(optional)*</sup> Timestamp for the START of this event, epoch time, in ms UTC |
7592
| params?.uptimeTimestamp | integer | <sup>*(optional)*</sup> Timestamp for the START of this event, uptime of the device, in ms. ONLY to be used when Time quality is not good |
76-
| params.eventPayload | object | The payload of the event |
93+
| params.eventPayload | object | Custom payload of the event in JSON format. User defined colection of objects and keys. May be an empty object |
94+
| params.eventPayload.keyOrObject | string | User defined custom key or object |
95+
96+
### Result
97+
98+
| Name | Type | Description |
99+
| :-------- | :-------- | :-------- |
100+
| result | string | On success null will be returned |
101+
102+
### Example
103+
104+
#### Request
105+
106+
```json
107+
{
108+
"jsonrpc": "2.0",
109+
"id": 42,
110+
"method": "org.rdk.Analytics.sendEvent",
111+
"params": {
112+
"eventName": "app_summary",
113+
"eventVersion": "1.0.0",
114+
"eventSource": "epg",
115+
"eventSourceVersion": "1.0.0",
116+
"cetList": [
117+
"cet1"
118+
],
119+
"epochTimestamp": 1721906631000,
120+
"uptimeTimestamp": 35000,
121+
"eventPayload": {
122+
"keyOrObject": "value1"
123+
}
124+
}
125+
}
126+
```
127+
128+
#### Response
129+
130+
```json
131+
{
132+
"jsonrpc": "2.0",
133+
"id": 42,
134+
"result": "null"
135+
}
136+
```
137+

docs/api/_sidebar.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
- [**Developer Guide**](developerguide/develperguidefornewplugin.md)
55
- [**API Reference**](/README)
66
- [ActivityMonitor](api/ActivityMonitorPlugin.md)
7+
- [Analytics](api/AnalyticsPlugin.md)
78
- [AVInput](api/AVInputPlugin.md)
89
- [Bluetooth](api/BluetoothPlugin.md)
910
- [CompositeInput](api/CompositeInputPlugin.md)

0 commit comments

Comments
 (0)