Bug 1680805 - Remove all performance pings in Activity Stream r=thecount

Differential Revision: https://phabricator.services.mozilla.com/D98808
This commit is contained in:
Nan Jiang
2020-12-09 01:34:53 +00:00
parent 2765539a80
commit ccf0b13265
16 changed files with 12 additions and 930 deletions

View File

@@ -4,7 +4,6 @@ The Activity Stream system add-on sends various types of pings to the backend (H
- 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
- an `undesired` ping that records data about bad app states and missing data
- an `impression_stats` ping that records data about Pocket impressions and user interactions
@@ -78,30 +77,6 @@ Schema definitions/validations that can be used for tests can be found in `syste
}
```
## Example Activity Stream `performance` Log
```js
{
"action": "activity_stream_performance_event",
"addon_version": "20180710100040",
"client_id": "374dc4d8-0cb2-4ac5-a3cf-c5a9bc3c602e",
"event": "previewCacheHit",
"event_id": "45f1912165ca4dfdb5c1c2337dbdc58f",
"locale": "en-US",
"page": "unknown", // all session-specific perf events should be part of the session perf object
"receive_at": 1457396660000,
"source": "TOP_FRECENT_SITES",
"value": 1,
"user_prefs": 7,
// These fields are generated on the server
"ip": "10.192.171.13",
"ua": "python-requests/2.9.1",
"receive_at": 1457396660000,
"date": "2016-03-07"
}
```
## Example Activity Stream `undesired event` Log
```js
@@ -208,7 +183,7 @@ Schema definitions/validations that can be used for tests can be found in `syste
+============================+======================================================================================================================================================+==================+
| ``action_position`` | [Optional] The index of the element in the ``source`` that was clicked. | :one: |
+----------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+------------------+
| ``action`` | [Required] Either ``activity_stream_event``, ``activity_stream_session``, or ``activity_stream_performance``. | :one: |
| ``action`` | [Required] Either ``activity_stream_event`` or ``activity_stream_session``. | :one: |
+----------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+------------------+
| ``addon_version`` | [Required] Firefox build ID, i.e. ``Services.appinfo.appBuildID``. | :one: |
+----------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+------------------+
@@ -223,8 +198,6 @@ Schema definitions/validations that can be used for tests can be found in `syste
+----------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+------------------+
| ``shield_id`` | [Optional] DEPRECATED: use `experiments` instead. The unique identifier for a specific experiment. | :one: |
+----------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+------------------+
| ``event_id`` | [Required] An identifier shared by multiple performance pings that describe an entire request flow. | :one: |
+----------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+------------------+
| ``event`` | [Required] The type of event. Any user defined string ("click", "share", "delete", "more\_items") | :one: |
+----------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+------------------+
| ``event_context`` | [Optional] A string to record the context of an AS Router event ping. Compound context values will be stringified by JSON.stringify | :one: |
@@ -267,9 +240,6 @@ Schema definitions/validations that can be used for tests can be found in `syste
+----------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+------------------+
| ``url`` | [Optional] The URL of the recommendation shown in one of the highlights spots, if any. | :one: |
+----------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+------------------+
| ``value`` (performance) | [Required] An integer that represents the measured performance value. Can store counts, times in milliseconds, and should always be a positive | |
| | integer. | :one: |
+----------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+------------------+
| ``value`` (event) | [Optional] An object with keys "icon\_type" and "card\_type" to record the extra information for event ping | :one: |
+----------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+------------------+
| ``ver`` | [Auto populated by Onyx] The version of the Onyx API the ping was sent to. | :one: |

View File

@@ -689,336 +689,7 @@ These pings record user interaction with the save to Pocket button.
}
```
## Performance pings
These pings are captured to record performance related events i.e. how long certain operations take to execute.
### Domain affinity calculation v1
This reports the duration of the domain affinity calculation in milliseconds.
```js
{
"action": "activity_stream_performance_event",
"client_id": "26288a14-5cc4-d14f-ae0a-bb01ef45be9c",
"addon_version": "20180710100040",
"locale": "en-US",
"experiments": {
"experiment_1": {"branch": "control"},
"experiment_2": {"branch": "treatment"}
},
"user_prefs": 7,
"event": "topstories.domain.affinity.calculation.ms",
"value": 43
}
```
### Domain affinity calculation v2
These report the duration of the domain affinity v2 calculations in milliseconds.
#### Total calculation in ms
```js
{
"action": "activity_stream_performance_event",
"client_id": "26288a14-5cc4-d14f-ae0a-bb01ef45be9c",
"addon_version": "20180710100040",
"locale": "en-US",
"experiments": {
"experiment_1": {"branch": "control"},
"experiment_2": {"branch": "treatment"}
},
"user_prefs": 7,
"event": "PERSONALIZATION_V2_TOTAL_DURATION",
"value": 43
}
```
#### getRecipe calculation in ms
```js
{
"action": "activity_stream_performance_event",
"client_id": "26288a14-5cc4-d14f-ae0a-bb01ef45be9c",
"addon_version": "20180710100040",
"locale": "en-US",
"experiments": {
"experiment_1": {"branch": "control"},
"experiment_2": {"branch": "treatment"}
},
"user_prefs": 7,
"event": "PERSONALIZATION_V2_GET_RECIPE_DURATION",
"value": 43
}
```
#### RecipeExecutor calculation in ms
```js
{
"action": "activity_stream_performance_event",
"client_id": "26288a14-5cc4-d14f-ae0a-bb01ef45be9c",
"addon_version": "20180710100040",
"locale": "en-US",
"experiments": {
"experiment_1": {"branch": "control"},
"experiment_2": {"branch": "treatment"}
},
"user_prefs": 7,
"event": "PERSONALIZATION_V2_RECIPE_EXECUTOR_DURATION",
"value": 43
}
```
#### taggers calculation in ms
```js
{
"action": "activity_stream_performance_event",
"client_id": "26288a14-5cc4-d14f-ae0a-bb01ef45be9c",
"addon_version": "20180710100040",
"locale": "en-US",
"experiments": {
"experiment_1": {"branch": "control"},
"experiment_2": {"branch": "treatment"}
},
"user_prefs": 7,
"event": "PERSONALIZATION_V2_TAGGERS_DURATION",
"value": 43
}
```
#### createInterestVector calculation in ms
```js
{
"action": "activity_stream_performance_event",
"client_id": "26288a14-5cc4-d14f-ae0a-bb01ef45be9c",
"addon_version": "20180710100040",
"locale": "en-US",
"experiments": {
"experiment_1": {"branch": "control"},
"experiment_2": {"branch": "treatment"}
},
"user_prefs": 7,
"event": "PERSONALIZATION_V2_CREATE_INTEREST_VECTOR_DURATION",
"value": 43
}
```
#### calculateItemRelevanceScore calculation in ms
```js
{
"action": "activity_stream_performance_event",
"client_id": "26288a14-5cc4-d14f-ae0a-bb01ef45be9c",
"addon_version": "20180710100040",
"locale": "en-US",
"experiments": {
"experiment_1": {"branch": "control"},
"experiment_2": {"branch": "treatment"}
},
"user_prefs": 7,
"event": "PERSONALIZATION_V2_ITEM_RELEVANCE_SCORE_DURATION",
"value": 43
}
```
### History size used for v2 calculation
```js
{
"action": "activity_stream_performance_event",
"client_id": "26288a14-5cc4-d14f-ae0a-bb01ef45be9c",
"addon_version": "20180710100040",
"locale": "en-US",
"experiments": {
"experiment_1": {"branch": "control"},
"experiment_2": {"branch": "treatment"}
},
"user_prefs": 7,
"event": "PERSONALIZATION_V2_HISTORY_SIZE",
"value": 43
}
```
### Error events for v2 calculation
These report any failures during domain affinity v2 calculations, and where it failed.
#### getRecipe error
```js
{
"action": "activity_stream_performance_event",
"client_id": "26288a14-5cc4-d14f-ae0a-bb01ef45be9c",
"addon_version": "20180710100040",
"locale": "en-US",
"experiments": {
"experiment_1": {"branch": "control"},
"experiment_2": {"branch": "treatment"}
},
"user_prefs": 7,
"event": "PERSONALIZATION_V2_GET_RECIPE_ERROR"
}
```
#### generateRecipeExecutor error
```js
{
"action": "activity_stream_performance_event",
"client_id": "26288a14-5cc4-d14f-ae0a-bb01ef45be9c",
"addon_version": "20180710100040",
"locale": "en-US",
"experiments": {
"experiment_1": {"branch": "control"},
"experiment_2": {"branch": "treatment"}
},
"user_prefs": 7,
"event": "PERSONALIZATION_V2_GENERATE_RECIPE_EXECUTOR_ERROR"
}
```
#### createInterestVector error
```js
{
"action": "activity_stream_performance_event",
"client_id": "26288a14-5cc4-d14f-ae0a-bb01ef45be9c",
"addon_version": "20180710100040",
"locale": "en-US",
"experiments": {
"experiment_1": {"branch": "control"},
"experiment_2": {"branch": "treatment"}
},
"user_prefs": 7,
"event": "PERSONALIZATION_V2_CREATE_INTEREST_VECTOR_ERROR"
}
```
### Discovery Stream loaded content
This reports all the loaded content (a list of `id`s and positions) when the user opens a newtab page and the page becomes visible. Note that this ping is a superset of the Discovery Stream impression ping, as impression pings are also subject to the individual visibility.
```js
{
"action": "activity_stream_impression_stats",
// Both "client_id" and "session_id" are set to "n/a" in this ping.
"client_id": "n/a",
"session_id": "n/a",
"impression_id": "{005deed0-e3e4-4c02-a041-17405fd703f6}",
"addon_version": "20180710100040",
"locale": "en-US",
"source": ["HERO" | "CARDGRID" | "LIST"],
"page": ["about:newtab" | "about:home" | "about:welcome" | "unknown"],
"experiments": {
"experiment_1": {"branch": "control"},
"experiment_2": {"branch": "treatment"}
},
"user_prefs": 7,
// Indicating this is a `loaded content` ping (as opposed to impression) as well as the size of `tiles`
"loaded": 3,
"tiles": [{"id": 10000, "pos": 0}, {"id": 10001, "pos": 1}, {"id": 10002, "pos": 2}]
}
```
### Discovery Stream performance pings
#### Request time of layout feed in ms
```js
{
"action": "activity_stream_performance_event",
"client_id": "26288a14-5cc4-d14f-ae0a-bb01ef45be9c",
"addon_version": "20180710100040",
"locale": "en-US",
"experiments": {
"experiment_1": {"branch": "control"},
"experiment_2": {"branch": "treatment"}
},
"user_prefs": 7,
"event": "LAYOUT_REQUEST_TIME",
"value": 42
}
```
#### Request time of SPOCS feed in ms
```js
{
"action": "activity_stream_performance_event",
"client_id": "26288a14-5cc4-d14f-ae0a-bb01ef45be9c",
"addon_version": "20180710100040",
"locale": "en-US",
"experiments": {
"experiment_1": {"branch": "control"},
"experiment_2": {"branch": "treatment"}
},
"user_prefs": 7,
"event": "SPOCS_REQUEST_TIME",
"value": 42
}
```
#### Request time of component feed feed in ms
```js
{
"action": "activity_stream_performance_event",
"client_id": "26288a14-5cc4-d14f-ae0a-bb01ef45be9c",
"addon_version": "20180710100040",
"locale": "en-US",
"experiments": {
"experiment_1": {"branch": "control"},
"experiment_2": {"branch": "treatment"}
},
"user_prefs": 7,
"event": "COMPONENT_FEED_REQUEST_TIME",
"value": 42
}
```
#### Request time of total Discovery Stream feed in ms
```js
{
"action": "activity_stream_performance_event",
"client_id": "26288a14-5cc4-d14f-ae0a-bb01ef45be9c",
"addon_version": "20180710100040",
"locale": "en-US",
"experiments": {
"experiment_1": {"branch": "control"},
"experiment_2": {"branch": "treatment"}
},
"user_prefs": 7,
"event": "DS_FEED_TOTAL_REQUEST_TIME",
"value": 136
}
```
#### Cache age of Discovery Stream feed in second
```js
{
"action": "activity_stream_performance_event",
"client_id": "26288a14-5cc4-d14f-ae0a-bb01ef45be9c",
"addon_version": "20180710100040",
"locale": "en-US",
"experiments": {
"experiment_1": {"branch": "control"},
"experiment_2": {"branch": "treatment"}
},
"user_prefs": 7,
"event": "DS_CACHE_AGE_IN_SEC",
"value": 1800 // 30 minutes
}
```
### Discovery Stream SPOCS Fill ping
## Discovery Stream SPOCS Fill ping
This reports the internal status of Pocket SPOCS (Sponsored Contents).