chore(doc): Update doc for Activity Stream heartbeat ping

This commit is contained in:
Nan Jiang 2018-05-22 20:38:05 -04:00
Родитель eb96bc0f2e
Коммит c7b0456316
2 изменённых файлов: 42 добавлений и 0 удалений

Просмотреть файл

@ -1,6 +1,7 @@
# Activity Stream Pings
The Activity Stream system add-on sends various types of pings to the backend (HTTPS POST) [Onyx server](https://github.com/mozilla/onyx) :
- a `health` ping that reports whether or not a user has a custom about:home or about:newtab page
- a `session` ping that describes the ending of an Activity Stream session (a new tab is closed or refreshed), and
- an `event` ping that records specific data about individual user interactions while interacting with Activity Stream
- a `performance` ping that records specific performance related events
@ -9,6 +10,26 @@ The Activity Stream system add-on sends various types of pings to the backend (H
Schema definitions/validations that can be used for tests can be found in `system-addon/test/schemas/pings.js`.
# Example Activity Stream `health` log
```js
{
"addon_version": "1.0.0",
"client_id": "374dc4d8-0cb2-4ac5-a3cf-c5a9bc3c602e",
"locale": "en-US",
"version": "62.0a1",
"release_channel": "nightly",
"event": "AS_ENABLED",
"value": 10,
// These fields are generated on the server
"date": "2016-03-07",
"ip": "10.192.171.13",
"ua": "python-requests/2.9.1",
"receive_at": 1457396660000
}
```
# Example Activity Stream `session` Log
```js

Просмотреть файл

@ -10,6 +10,27 @@ Data collected from Activity Stream is retained on Mozilla secured servers for a
The following is a detailed overview of the different kinds of data we collect in the Activity Stream. See [data_dictionary.md](data_dictionary.md) for more details for each field.
## Health ping
This is a heartbeat ping indicating whether Activity Stream is currently being used or not, it's submitted once upon the browser initialization.
```js
{
"client_id": "374dc4d8-0cb2-4ac5-a3cf-c5a9bc3c602e",
"locale": "en-US",
"version": "62.0a1",
"release_channel": "nightly",
"event": "AS_ENABLED",
"value": 10
}
```
where the "value" is encoded as:
* Value 0: default
* Value 1: about:blank
* Value 2: web extension
* Value 3: other custom URL(s)
Two encoded integers for about:newtab and about:home are combined in a bitwise fashion. For instance, if both about:home and about:newtab were set to about:blank, then `value = 5 = (1 | (1 << 2))`, i.e `value = (bitfield of about:newtab) | (bitfield of about:newhome << 2)`.
## User event pings
These pings are captured when a user **performs some kind of interaction** in the add-on.