Bug 1686670 - Break the book in two: a developer and a user book (#1502)
|
@ -400,6 +400,7 @@ jobs:
|
|||
root: build/
|
||||
paths:
|
||||
- docs/book
|
||||
- docs/dev
|
||||
- docs/docs
|
||||
- docs/index.html
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
docs/book
|
||||
docs/appendix/changelog.md
|
||||
docs/*/book
|
||||
docs/user/appendix/changelog.md
|
||||
target
|
||||
.cargo
|
||||
|
||||
|
|
2
Makefile
|
@ -151,7 +151,7 @@ metrics-docs: python-setup ## Build the internal metrics documentation
|
|||
$(GLEAN_PYENV)/bin/pip install glean_parser==2.2.0
|
||||
$(GLEAN_PYENV)/bin/glean_parser translate --allow-reserved \
|
||||
-f markdown \
|
||||
-o ./docs/user/collected-metrics \
|
||||
-o ./docs/user/user/collected-metrics \
|
||||
glean-core/metrics.yaml glean-core/pings.yaml glean-core/android/metrics.yaml
|
||||
|
||||
linkcheck: docs ## Run link-checker on the generated docs
|
||||
|
|
|
@ -12,9 +12,16 @@ set -xe
|
|||
CRATE_NAME=glean_core
|
||||
|
||||
# Add the changelog file
|
||||
cp -a CHANGELOG.md docs/appendix/changelog.md
|
||||
cp -a CHANGELOG.md docs/user/appendix/changelog.md
|
||||
|
||||
output=$(mdbook build docs/ 2>&1)
|
||||
# Build the Glean client user book
|
||||
output=$(mdbook build docs/user/ 2>&1)
|
||||
if echo "$output" | grep -q "\[ERROR\]" ; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Build the Glean SDK development book
|
||||
output=$(mdbook build docs/dev/ 2>&1)
|
||||
if echo "$output" | grep -q "\[ERROR\]" ; then
|
||||
exit 1
|
||||
fi
|
||||
|
@ -26,7 +33,13 @@ mkdir -p build/docs
|
|||
echo '<meta http-equiv=refresh content=0;url=book/index.html>' > build/docs/index.html
|
||||
|
||||
mkdir -p build/docs/book
|
||||
cp -a docs/book/. build/docs/book
|
||||
cp -a docs/user/book/. build/docs/book
|
||||
|
||||
mkdir -p build/docs/dev
|
||||
cp -a docs/dev/book/. build/docs/dev
|
||||
|
||||
mkdir -p build/docs/shared
|
||||
cp -a docs/shared/. build/docs/shared
|
||||
|
||||
mkdir -p build/docs/docs
|
||||
cp -a target/doc/. build/docs/docs
|
||||
|
|
|
@ -0,0 +1,37 @@
|
|||
# Developing the Glean SDK
|
||||
|
||||
![Glean logo](glean.jpeg)
|
||||
|
||||
The `Glean SDK` is a modern approach for a Telemetry library and is part of the [Glean project](https://docs.telemetry.mozilla.org/concepts/glean/glean.html).
|
||||
|
||||
To contact us you can:
|
||||
- Find us in the [#glean channel on chat.mozilla.org](https://chat.mozilla.org/#/room/#glean:mozilla.org).
|
||||
- To report issues or request changes, file a bug in [Bugzilla in Data Platform & Tools :: Glean: SDK](https://bugzilla.mozilla.org/enter_bug.cgi?product=Data+Platform+and+Tools&component=Glean%3A+SDK&priority=P3&status_whiteboard=%5Btelemetry%3Aglean-rs%3Am%3F%5D).
|
||||
- Send an email to *glean-team@mozilla.com*.
|
||||
- The Glean SDK team is: *:janerik*, *:dexter*, *:travis*, *:mdroettboom*, *:gfritzsche*, *:chutten*, *:brizental*.
|
||||
|
||||
The source code is available [on GitHub](https://github.com/mozilla/glean/).
|
||||
|
||||
## Using this book
|
||||
|
||||
This book is specifically about **contributing to and developing** the `Glean SDK`.
|
||||
|
||||
For documentation on **using** the `Glean SDK`, refer to [the Glean Book](../book).
|
||||
|
||||
For documentation about the broader end-to-end Glean project, refer to the [Mozilla Data Documentation](https://docs.telemetry.mozilla.org/concepts/glean/glean.html).
|
||||
|
||||
This book is divided into 2 main parts:
|
||||
|
||||
### [Developing the Glean SDK](testing.md)
|
||||
|
||||
This chapter describes how to develop the Glean SDK and its various implementations.
|
||||
This is relevant if you plan to contribute to the Glean SDK code base.
|
||||
|
||||
### [API Reference Documentation](api/index.md)
|
||||
|
||||
Reference documentation for the API in its various language bindings.
|
||||
|
||||
## License
|
||||
|
||||
The Glean SDK Source Code is subject to the terms of the Mozilla Public License v2.0.
|
||||
You can obtain a copy of the MPL at <https://mozilla.org/MPL/2.0/>.
|
|
@ -0,0 +1,38 @@
|
|||
[Developing the Glean SDK](README.md)
|
||||
|
||||
- [Testing](testing.md)
|
||||
- [Continuous Integration](ci.md)
|
||||
- [Release process](cut-a-new-release.md)
|
||||
- [Contributing](contributing.md)
|
||||
- [Code coverage](code_coverage.md)
|
||||
- [Developing documentation](docs.md)
|
||||
- [Upgrading glean_parser](upgrading-glean-parser.md)
|
||||
- [Android bindings](android/index.md)
|
||||
- [Setup Build Environment](android/setup-android-build-environment.md)
|
||||
- [Android SDK/NDK versions](android/sdk-ndk-versions.md)
|
||||
- [Development with android-components](android/development-with-android-components.md)
|
||||
- [Locally-published components in Fenix](android/locally-published-components-in-fenix.md)
|
||||
- [iOS bindings](ios/index.md)
|
||||
- [Setup Build Environment](ios/setup-ios-build-environment.md)
|
||||
- [Debugging Different Versions of Glean](ios/debug-glean-on-ios.md)
|
||||
- [Python bindings](python/index.md)
|
||||
- [Setup Build Environment](python/setting-up-python-build-environment.md)
|
||||
- [Rust Component](core/index.md)
|
||||
- [Documentation guidelines](core/documentation-guidelines.md)
|
||||
- [Dependency Management](core/dependency-management.md)
|
||||
- [Adding a new metric type](core/new-metric-type.md)
|
||||
- [FFI](core/new-metric-type/ffi.md)
|
||||
- [Kotlin](core/new-metric-type/kotlin.md)
|
||||
- [Swift](core/new-metric-type/swift.md)
|
||||
- [Python](core/new-metric-type/python.md)
|
||||
- [FFI Layer](ffi/index.md)
|
||||
- [When/How FFI](ffi/when-to-use-what-in-the-ffi.md)
|
||||
- [Internal implementation details](core/internal/index.md)
|
||||
- [Reserved ping names](core/internal/reserved-ping-names.md).
|
||||
- [Clearing metrics when disabling/enabling Glean](core/internal/clearing.md).
|
||||
- [Payload format](core/internal/payload.md).
|
||||
- [Directory & file structure](core/internal/directory-structure.md)
|
||||
- [Debug Pings](core/internal/debug-pings.md)
|
||||
- [Upload mechanism](core/internal/upload.md)
|
||||
- [Implementations](core/internal/implementations.md)
|
||||
- [API Documentation](api/index.md)
|
|
@ -1,6 +1,6 @@
|
|||
[book]
|
||||
title = "Glean - Cross-platform Telemetry library"
|
||||
authors = ["Jan-Erik Rediger", "Glean Team"]
|
||||
authors = ["Glean Team"]
|
||||
src = "."
|
||||
|
||||
[build]
|
||||
|
@ -8,8 +8,8 @@ build-dir = "book"
|
|||
create-missing = false
|
||||
|
||||
[output.html]
|
||||
additional-css = ["glean.css", "mermaid.css"]
|
||||
additional-js = ["tabs.js", "mermaid.min.js", "mermaid-init.js", "chart.min.js", "chart-distributions.js", "chart-distributions-ui.js"]
|
||||
additional-css = ["../shared/glean.css", "../shared/mermaid.css"]
|
||||
additional-js = ["../shared/tabs.js", "../shared/mermaid.min.js", "../shared/mermaid-init.js"]
|
||||
git-repository-url = "https://github.com/mozilla/glean"
|
||||
git-branch = "main"
|
||||
mathjax-support = true
|
|
@ -94,7 +94,7 @@ Glean core will take care of file management, cleanup, rescheduling and rate lim
|
|||
|
||||
## Available APIs
|
||||
|
||||
{{#include ../../../tab_header.md}}
|
||||
{{#include ../../../shared/tab_header.md}}
|
||||
|
||||
<div data-lang="Rust" class="tab">
|
||||
|
||||
|
@ -135,4 +135,4 @@ See the documentation for additional information about the types:
|
|||
|
||||
</div>
|
||||
|
||||
{{#include ../../../tab_footer.md}}
|
||||
{{#include ../../../shared/tab_footer.md}}
|
||||
|
|
|
@ -31,7 +31,7 @@ The built narrative documentation is saved in `build/docs/book`, and the Rust AP
|
|||
|
||||
### Building API documentation
|
||||
|
||||
{{#include ../tab_header.md}}
|
||||
{{#include ../shared/tab_header.md}}
|
||||
|
||||
<div data-lang="Kotlin" class="tab">
|
||||
|
||||
|
@ -88,7 +88,7 @@ TODO. To be implemented in [bug 1648410](https://bugzilla.mozilla.org/show_bug.c
|
|||
|
||||
</div>
|
||||
|
||||
{{#include ../tab_footer.md}}
|
||||
{{#include ../shared/tab_footer.md}}
|
||||
|
||||
### Checking links
|
||||
|
||||
|
|
До Ширина: | Высота: | Размер: 113 KiB После Ширина: | Высота: | Размер: 113 KiB |
|
@ -0,0 +1,169 @@
|
|||
/* Style the tab */
|
||||
.tabbar {
|
||||
overflow: hidden;
|
||||
border: 1px solid #ccc;
|
||||
background-color: #f1f1f1;
|
||||
}
|
||||
|
||||
/* Style the buttons that are used to open the tab content */
|
||||
.tabbar button {
|
||||
background-color: inherit;
|
||||
float: left;
|
||||
border: none;
|
||||
outline: none;
|
||||
cursor: pointer;
|
||||
padding: 14px 16px;
|
||||
transition: 0.3s;
|
||||
}
|
||||
|
||||
/* Change background color of buttons on hover */
|
||||
.tabbar button:hover {
|
||||
background-color: #ddd;
|
||||
}
|
||||
|
||||
/* Create an active/current tablink class */
|
||||
.tabbar button.active {
|
||||
background-color: #ccc;
|
||||
}
|
||||
|
||||
/* The container that holds all of the tab contents */
|
||||
.tabcontents {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
/* The container for each individual language */
|
||||
.tab {
|
||||
display: none;
|
||||
width: 100%;
|
||||
border: 1px solid #ccc;
|
||||
border-top: none;
|
||||
padding: 6px 12px;
|
||||
}
|
||||
|
||||
.tab.active {
|
||||
display: block;
|
||||
}
|
||||
|
||||
/* The footer with the "Open on GitHub" link */
|
||||
footer#open-on-gh {
|
||||
font-size: 0.8em;
|
||||
text-align: center;
|
||||
border-top: 1px solid black;
|
||||
padding: 5px 0;
|
||||
}
|
||||
|
||||
/* Distribution simulator styles */
|
||||
|
||||
#simulator-container {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#simulator-container h3 {
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
#simulator-container .input-group {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#simulator-container .input-group label {
|
||||
display: block;
|
||||
font-weight: bold;
|
||||
font-size: 14px;
|
||||
margin-bottom: 7px;
|
||||
}
|
||||
|
||||
#simulator-container .input-group input,
|
||||
#simulator-container .input-group select,
|
||||
#custom-data-modal textarea {
|
||||
display: block;
|
||||
width: 100%;
|
||||
padding: 5px;
|
||||
margin-bottom: 10px;
|
||||
border-radius: 3px;
|
||||
border: 1px solid #e0e0e0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
#histogram-props,
|
||||
#data-options {
|
||||
width: 50%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
#data-options {
|
||||
padding-right: 50px;
|
||||
}
|
||||
|
||||
#data-options .input-group {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
#data-options .input-group:first-of-type {
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
#data-options .input-group:last-of-type {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
#data-options .input-group label {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
#data-options .input-group input {
|
||||
display: inline;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
#histogram-chart-container {
|
||||
width: 100%;
|
||||
padding: 30px;
|
||||
border: 1px solid #e0e0e0;
|
||||
margin: 30px 0;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
#histogram-chart {
|
||||
margin-top: 50px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#histogram-chart-legend {
|
||||
font-size: 14px;
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#histogram-functional-props,
|
||||
#histogram-non-functional-props {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#custom-data-modal-overlay {
|
||||
background-color: rgba(0, 0, 0, .5);
|
||||
position: fixed;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 999;
|
||||
display: none;
|
||||
}
|
||||
|
||||
#custom-data-modal {
|
||||
width: 50%;
|
||||
background-color: white;
|
||||
border-radius: 5px;
|
||||
position: relative;
|
||||
top: 15%;
|
||||
left: 25%;
|
||||
padding: 50px;
|
||||
}
|
||||
|
||||
.hide {
|
||||
display: none !important;
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
mermaid.initialize({startOnLoad:true});
|
|
@ -0,0 +1,356 @@
|
|||
/*
|
||||
Licensed under the MIT License (MIT).
|
||||
Copyright (c) 2014 - 2018 Knut Sveidqvist
|
||||
Full license: https://github.com/mermaid-js/mermaid/blob/develop/LICENSE
|
||||
*/
|
||||
/* Flowchart variables */
|
||||
/* Sequence Diagram variables */
|
||||
/* Gantt chart variables */
|
||||
.mermaid .mermaid .label {
|
||||
color: #333;
|
||||
}
|
||||
.mermaid .node rect,
|
||||
.mermaid .node circle,
|
||||
.mermaid .node ellipse,
|
||||
.mermaid .node polygon {
|
||||
fill: #ECECFF;
|
||||
stroke: #CCCCFF;
|
||||
stroke-width: 1px;
|
||||
}
|
||||
.mermaid .arrowheadPath {
|
||||
fill: #333333;
|
||||
}
|
||||
.mermaid .edgePath .path {
|
||||
stroke: #333333;
|
||||
}
|
||||
.mermaid .edgeLabel {
|
||||
background-color: #e8e8e8;
|
||||
}
|
||||
.mermaid .cluster rect {
|
||||
fill: #ffffde !important;
|
||||
rx: 4 !important;
|
||||
stroke: #aaaa33 !important;
|
||||
stroke-width: 1px !important;
|
||||
}
|
||||
.mermaid .cluster text {
|
||||
fill: #333;
|
||||
}
|
||||
.mermaid .actor {
|
||||
stroke: #CCCCFF;
|
||||
fill: #ECECFF;
|
||||
}
|
||||
.mermaid text.actor {
|
||||
fill: black;
|
||||
stroke: none;
|
||||
}
|
||||
.mermaid .actor-line {
|
||||
stroke: grey;
|
||||
}
|
||||
.mermaid .messageLine0 {
|
||||
stroke-width: 1.5;
|
||||
stroke-dasharray: "2 2";
|
||||
marker-end: "url(#arrowhead)";
|
||||
stroke: #333;
|
||||
}
|
||||
.mermaid .messageLine1 {
|
||||
stroke-width: 1.5;
|
||||
stroke-dasharray: "2 2";
|
||||
stroke: #333;
|
||||
}
|
||||
.mermaid #arrowhead {
|
||||
fill: #333;
|
||||
}
|
||||
.mermaid #crosshead path {
|
||||
fill: #333 !important;
|
||||
stroke: #333 !important;
|
||||
}
|
||||
.mermaid .messageText {
|
||||
fill: #333;
|
||||
stroke: none;
|
||||
}
|
||||
.mermaid .labelBox {
|
||||
stroke: #CCCCFF;
|
||||
fill: #ECECFF;
|
||||
}
|
||||
.mermaid .labelText {
|
||||
fill: black;
|
||||
stroke: none;
|
||||
}
|
||||
.mermaid .loopText {
|
||||
fill: black;
|
||||
stroke: none;
|
||||
}
|
||||
.mermaid .loopLine {
|
||||
stroke-width: 2;
|
||||
stroke-dasharray: "2 2";
|
||||
marker-end: "url(#arrowhead)";
|
||||
stroke: #CCCCFF;
|
||||
}
|
||||
.mermaid .note {
|
||||
stroke: #aaaa33;
|
||||
fill: #fff5ad;
|
||||
}
|
||||
.mermaid .noteText {
|
||||
fill: black;
|
||||
stroke: none;
|
||||
font-family: 'trebuchet ms', verdana, arial;
|
||||
font-size: 14px;
|
||||
}
|
||||
/** Section styling */
|
||||
.mermaid .section {
|
||||
stroke: none;
|
||||
opacity: 0.2;
|
||||
}
|
||||
.mermaid .section0 {
|
||||
fill: rgba(102, 102, 255, 0.49);
|
||||
}
|
||||
.mermaid .section2 {
|
||||
fill: #fff400;
|
||||
}
|
||||
.mermaid .section1,
|
||||
.mermaid .section3 {
|
||||
fill: white;
|
||||
opacity: 0.2;
|
||||
}
|
||||
.mermaid .sectionTitle0 {
|
||||
fill: #333;
|
||||
}
|
||||
.mermaid .sectionTitle1 {
|
||||
fill: #333;
|
||||
}
|
||||
.mermaid .sectionTitle2 {
|
||||
fill: #333;
|
||||
}
|
||||
.mermaid .sectionTitle3 {
|
||||
fill: #333;
|
||||
}
|
||||
.mermaid .sectionTitle {
|
||||
text-anchor: start;
|
||||
font-size: 11px;
|
||||
text-height: 14px;
|
||||
}
|
||||
/* Grid and axis */
|
||||
.mermaid .grid .tick {
|
||||
stroke: lightgrey;
|
||||
opacity: 0.3;
|
||||
shape-rendering: crispEdges;
|
||||
}
|
||||
.mermaid .grid path {
|
||||
stroke-width: 0;
|
||||
}
|
||||
/* Today line */
|
||||
.mermaid .today {
|
||||
fill: none;
|
||||
stroke: red;
|
||||
stroke-width: 2px;
|
||||
}
|
||||
/* Task styling */
|
||||
/* Default task */
|
||||
.mermaid .task {
|
||||
stroke-width: 2;
|
||||
}
|
||||
.mermaid .taskText {
|
||||
text-anchor: middle;
|
||||
font-size: 11px;
|
||||
}
|
||||
.mermaid .taskTextOutsideRight {
|
||||
fill: black;
|
||||
text-anchor: start;
|
||||
font-size: 11px;
|
||||
}
|
||||
.mermaid .taskTextOutsideLeft {
|
||||
fill: black;
|
||||
text-anchor: end;
|
||||
font-size: 11px;
|
||||
}
|
||||
/* Specific task settings for the sections*/
|
||||
.mermaid .taskText0,
|
||||
.mermaid .taskText1,
|
||||
.mermaid .taskText2,
|
||||
.mermaid .taskText3 {
|
||||
fill: white;
|
||||
}
|
||||
.mermaid .task0,
|
||||
.mermaid .task1,
|
||||
.mermaid .task2,
|
||||
.mermaid .task3 {
|
||||
fill: #8a90dd;
|
||||
stroke: #534fbc;
|
||||
}
|
||||
.mermaid .taskTextOutside0,
|
||||
.mermaid .taskTextOutside2 {
|
||||
fill: black;
|
||||
}
|
||||
.mermaid .taskTextOutside1,
|
||||
.mermaid .taskTextOutside3 {
|
||||
fill: black;
|
||||
}
|
||||
/* Active task */
|
||||
.mermaid .active0,
|
||||
.mermaid .active1,
|
||||
.mermaid .active2,
|
||||
.mermaid .active3 {
|
||||
fill: #bfc7ff;
|
||||
stroke: #534fbc;
|
||||
}
|
||||
.mermaid .activeText0,
|
||||
.mermaid .activeText1,
|
||||
.mermaid .activeText2,
|
||||
.mermaid .activeText3 {
|
||||
fill: black !important;
|
||||
}
|
||||
/* Completed task */
|
||||
.mermaid .done0,
|
||||
.mermaid .done1,
|
||||
.mermaid .done2,
|
||||
.mermaid .done3 {
|
||||
stroke: grey;
|
||||
fill: lightgrey;
|
||||
stroke-width: 2;
|
||||
}
|
||||
.mermaid .doneText0,
|
||||
.mermaid .doneText1,
|
||||
.mermaid .doneText2,
|
||||
.mermaid .doneText3 {
|
||||
fill: black !important;
|
||||
}
|
||||
/* Tasks on the critical line */
|
||||
.mermaid .crit0,
|
||||
.mermaid .crit1,
|
||||
.mermaid .crit2,
|
||||
.mermaid .crit3 {
|
||||
stroke: #ff8888;
|
||||
fill: red;
|
||||
stroke-width: 2;
|
||||
}
|
||||
.mermaid .activeCrit0,
|
||||
.mermaid .activeCrit1,
|
||||
.mermaid .activeCrit2,
|
||||
.mermaid .activeCrit3 {
|
||||
stroke: #ff8888;
|
||||
fill: #bfc7ff;
|
||||
stroke-width: 2;
|
||||
}
|
||||
.mermaid .doneCrit0,
|
||||
.mermaid .doneCrit1,
|
||||
.mermaid .doneCrit2,
|
||||
.mermaid .doneCrit3 {
|
||||
stroke: #ff8888;
|
||||
fill: lightgrey;
|
||||
stroke-width: 2;
|
||||
cursor: pointer;
|
||||
shape-rendering: crispEdges;
|
||||
}
|
||||
.mermaid .doneCritText0,
|
||||
.mermaid .doneCritText1,
|
||||
.mermaid .doneCritText2,
|
||||
.mermaid .doneCritText3 {
|
||||
fill: black !important;
|
||||
}
|
||||
.mermaid .activeCritText0,
|
||||
.mermaid .activeCritText1,
|
||||
.mermaid .activeCritText2,
|
||||
.mermaid .activeCritText3 {
|
||||
fill: black !important;
|
||||
}
|
||||
.mermaid .titleText {
|
||||
text-anchor: middle;
|
||||
font-size: 18px;
|
||||
fill: black;
|
||||
}
|
||||
.mermaid g.classGroup text {
|
||||
fill: #9370DB;
|
||||
stroke: none;
|
||||
font-family: 'trebuchet ms', verdana, arial;
|
||||
font-size: 10px;
|
||||
}
|
||||
.mermaid g.classGroup rect {
|
||||
fill: #ECECFF;
|
||||
stroke: #9370DB;
|
||||
}
|
||||
.mermaid g.classGroup line {
|
||||
stroke: #9370DB;
|
||||
stroke-width: 1;
|
||||
}
|
||||
.mermaid svg .classLabel .box {
|
||||
stroke: none;
|
||||
stroke-width: 0;
|
||||
fill: #ECECFF;
|
||||
opacity: 0.5;
|
||||
}
|
||||
.mermaid svg .classLabel .label {
|
||||
fill: #9370DB;
|
||||
font-size: 10px;
|
||||
}
|
||||
.mermaid .relation {
|
||||
stroke: #9370DB;
|
||||
stroke-width: 1;
|
||||
fill: none;
|
||||
}
|
||||
.mermaid .composition {
|
||||
fill: #9370DB;
|
||||
stroke: #9370DB;
|
||||
stroke-width: 1;
|
||||
}
|
||||
.mermaid #compositionStart {
|
||||
fill: #9370DB;
|
||||
stroke: #9370DB;
|
||||
stroke-width: 1;
|
||||
}
|
||||
.mermaid #compositionEnd {
|
||||
fill: #9370DB;
|
||||
stroke: #9370DB;
|
||||
stroke-width: 1;
|
||||
}
|
||||
.mermaid .aggregation {
|
||||
fill: #ECECFF;
|
||||
stroke: #9370DB;
|
||||
stroke-width: 1;
|
||||
}
|
||||
.mermaid #aggregationStart {
|
||||
fill: #ECECFF;
|
||||
stroke: #9370DB;
|
||||
stroke-width: 1;
|
||||
}
|
||||
.mermaid #aggregationEnd {
|
||||
fill: #ECECFF;
|
||||
stroke: #9370DB;
|
||||
stroke-width: 1;
|
||||
}
|
||||
.mermaid #dependencyStart {
|
||||
fill: #9370DB;
|
||||
stroke: #9370DB;
|
||||
stroke-width: 1;
|
||||
}
|
||||
.mermaid #dependencyEnd {
|
||||
fill: #9370DB;
|
||||
stroke: #9370DB;
|
||||
stroke-width: 1;
|
||||
}
|
||||
.mermaid #extensionStart {
|
||||
fill: #9370DB;
|
||||
stroke: #9370DB;
|
||||
stroke-width: 1;
|
||||
}
|
||||
.mermaid #extensionEnd {
|
||||
fill: #9370DB;
|
||||
stroke: #9370DB;
|
||||
stroke-width: 1;
|
||||
}
|
||||
.mermaid .node text {
|
||||
font-family: 'trebuchet ms', verdana, arial;
|
||||
font-size: 14px;
|
||||
}
|
||||
.mermaid div.mermaidTooltip {
|
||||
position: absolute;
|
||||
text-align: center;
|
||||
max-width: 200px;
|
||||
padding: 2px;
|
||||
font-family: 'trebuchet ms', verdana, arial;
|
||||
font-size: 12px;
|
||||
background: #ffffde;
|
||||
border: 1px solid #aaaa33;
|
||||
border-radius: 2px;
|
||||
pointer-events: none;
|
||||
z-index: 100;
|
||||
}
|
|
@ -0,0 +1,97 @@
|
|||
/**
|
||||
* Returns true if browser supports HTML5 localStorage.
|
||||
*/
|
||||
function supportsHTML5Storage() {
|
||||
try {
|
||||
return 'localStorage' in window && window['localStorage'] !== null;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Event handler for when a tab is clicked.
|
||||
*/
|
||||
function onClickTab(event) {
|
||||
let target = event.currentTarget;
|
||||
let language = target.dataset.lang;
|
||||
|
||||
const initialTargetOffset = target.offsetTop;
|
||||
const initialScrollPosition = window.scrollY;
|
||||
switchAllTabs(language);
|
||||
|
||||
// Keep initial perceived scroll position after resizing
|
||||
// that may happen due to activation of multiple tabs in the same page.
|
||||
const finalTargetOffset = target.offsetTop;
|
||||
window.scrollTo({
|
||||
top: initialScrollPosition + (finalTargetOffset - initialTargetOffset)
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Switches the displayed tab for the given container.
|
||||
*
|
||||
* :param container: The div containing both the tab bar and the individual tabs
|
||||
* as direct children.
|
||||
* :param language: The language to switch to.
|
||||
*/
|
||||
function switchTab(container, language) {
|
||||
const previouslyActiveTab = container.querySelector(".tabcontents .active");
|
||||
previouslyActiveTab && previouslyActiveTab.classList.remove("active");
|
||||
let tab = container.querySelector(`.tabcontents [data-lang="${language}"]`);
|
||||
tab && tab.classList.add("active");
|
||||
|
||||
const previouslyActiveButton = container.querySelector(".tabbar .active");
|
||||
previouslyActiveButton && previouslyActiveButton.classList.remove("active");
|
||||
let button = container.querySelector(`.tabbar [data-lang="${language}"]`);
|
||||
button && button.classList.add("active");
|
||||
}
|
||||
|
||||
/**
|
||||
* Switches all tabs on the page to the given language.
|
||||
*
|
||||
* :param language: The language to switch to.
|
||||
*/
|
||||
function switchAllTabs(language) {
|
||||
const containers = document.getElementsByClassName("tabs");
|
||||
for (let i = 0; i < containers.length; ++i) {
|
||||
switchTab(containers[i], language);
|
||||
}
|
||||
|
||||
if (supportsHTML5Storage()) {
|
||||
localStorage.setItem("glean-preferred-language", language);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Opens all tabs on the page to the given language on page load.
|
||||
*/
|
||||
function openTabs() {
|
||||
if (!supportsHTML5Storage()) {
|
||||
return;
|
||||
}
|
||||
|
||||
let containers = document.getElementsByClassName("tabs");
|
||||
for (let i = 0; i < containers.length; ++i) {
|
||||
// Create tabs for every language that has content
|
||||
let tabs = containers[i].children[0];
|
||||
let tabcontents = containers[i].children[1];
|
||||
for (let tabcontent of tabcontents.children) {
|
||||
let button = document.createElement("button");
|
||||
button.dataset.lang = tabcontent.dataset.lang;
|
||||
button.className = "tablinks";
|
||||
button.onclick = onClickTab;
|
||||
button.innerText = tabcontent.dataset.lang;
|
||||
tabs.appendChild(button);
|
||||
}
|
||||
}
|
||||
|
||||
var language = localStorage.getItem("glean-preferred-language");
|
||||
if (language == null) {
|
||||
language = "Kotlin";
|
||||
}
|
||||
|
||||
switchAllTabs(language);
|
||||
}
|
||||
|
||||
openTabs()
|
|
@ -14,9 +14,13 @@ The source code is available [on GitHub](https://github.com/mozilla/glean/).
|
|||
|
||||
## Using this book
|
||||
|
||||
This book is specifically about the `Glean SDK` (the client side code for collecting telemetry). Documentation about the broader end-to-end [Glean project](https://docs.telemetry.mozilla.org/concepts/glean/glean.html).
|
||||
This book is specifically about **using** the `Glean SDK`.
|
||||
|
||||
This book is divided into 5 main chapters:
|
||||
For documentation on **contributing to and developing** the `Glean SDK`, refer to [the Glean SDK development book](https://mozilla.github.io/glean/).
|
||||
|
||||
For documentation about the broader end-to-end Glean project, refer to the [Mozilla Data Documentation](https://docs.telemetry.mozilla.org/concepts/glean/glean.html).
|
||||
|
||||
This book is divided into 3 main chapters:
|
||||
|
||||
### [Using the Glean SDK](user/index.html)
|
||||
|
||||
|
@ -29,15 +33,6 @@ and how to do send your own custom pings.
|
|||
|
||||
This chapter lists all metrics collected by the Glean SDK itself.
|
||||
|
||||
### [Developing the Glean SDK](dev/testing.md)
|
||||
|
||||
This chapter describes how to develop the Glean SDK and its various implementations.
|
||||
This is relevant if you plan to contribute to the Glean SDK code base.
|
||||
|
||||
### [API Reference Documentation](api/index.md)
|
||||
|
||||
Reference documentation for the API in its various language bindings.
|
||||
|
||||
### [This Week in Glean](appendix/twig.md)
|
||||
|
||||
“This Week in Glean” is a series of blog posts that the Glean Team at Mozilla is using to try to communicate better about our work.
|
|
@ -45,45 +45,6 @@
|
|||
- [Instrumenting Android crashes with the Glean SDK](user/instrument-android-crashes-example.md)
|
||||
- [Metrics collected by the Glean SDK](user/collected-metrics/metrics.md)
|
||||
|
||||
# Developing the Glean SDK
|
||||
|
||||
- [Testing](dev/testing.md)
|
||||
- [Continuous Integration](dev/ci.md)
|
||||
- [Release process](dev/cut-a-new-release.md)
|
||||
- [Contributing](contributing.md)
|
||||
- [Code coverage](code_coverage.md)
|
||||
- [Developing documentation](dev/docs.md)
|
||||
- [Upgrading glean_parser](dev/upgrading-glean-parser.md)
|
||||
- [Android bindings](dev/android/index.md)
|
||||
- [Setup Build Environment](dev/android/setup-android-build-environment.md)
|
||||
- [Android SDK/NDK versions](dev/android/sdk-ndk-versions.md)
|
||||
- [Development with android-components](dev/android/development-with-android-components.md)
|
||||
- [Locally-published components in Fenix](dev/android/locally-published-components-in-fenix.md)
|
||||
- [iOS bindings](dev/ios/index.md)
|
||||
- [Setup Build Environment](dev/ios/setup-ios-build-environment.md)
|
||||
- [Debugging Different Versions of Glean](dev/ios/debug-glean-on-ios.md)
|
||||
- [Python bindings](dev/python/index.md)
|
||||
- [Setup Build Environment](dev/python/setting-up-python-build-environment.md)
|
||||
- [Rust Component](dev/core/index.md)
|
||||
- [Documentation guidelines](dev/core/documentation-guidelines.md)
|
||||
- [Dependency Management](dev/core/dependency-management.md)
|
||||
- [Adding a new metric type](dev/core/new-metric-type.md)
|
||||
- [FFI](dev/core/new-metric-type/ffi.md)
|
||||
- [Kotlin](dev/core/new-metric-type/kotlin.md)
|
||||
- [Swift](dev/core/new-metric-type/swift.md)
|
||||
- [Python](dev/core/new-metric-type/python.md)
|
||||
- [FFI Layer](dev/ffi/index.md)
|
||||
- [When/How FFI](dev/ffi/when-to-use-what-in-the-ffi.md)
|
||||
- [Internal implementation details](dev/core/internal/index.md)
|
||||
- [Reserved ping names](dev/core/internal/reserved-ping-names.md).
|
||||
- [Clearing metrics when disabling/enabling Glean](dev/core/internal/clearing.md).
|
||||
- [Payload format](dev/core/internal/payload.md).
|
||||
- [Directory & file structure](dev/core/internal/directory-structure.md)
|
||||
- [Debug Pings](dev/core/internal/debug-pings.md)
|
||||
- [Upload mechanism](dev/core/internal/upload.md)
|
||||
- [Implementations](dev/core/internal/implementations.md)
|
||||
- [API Documentation](api/index.md)
|
||||
|
||||
# Appendix
|
||||
|
||||
- [Glossary](appendix/glossary.md)
|
|
@ -0,0 +1,18 @@
|
|||
[book]
|
||||
title = "Glean - Cross-platform Telemetry library"
|
||||
authors = ["Glean Team"]
|
||||
src = "."
|
||||
|
||||
[build]
|
||||
build-dir = "book"
|
||||
create-missing = false
|
||||
|
||||
[output.html]
|
||||
additional-css = ["../shared/glean.css", "../shared/mermaid.css"]
|
||||
additional-js = ["../shared/tabs.js", "../shared/mermaid.min.js", "../shared/mermaid-init.js", "chart.min.js", "chart-distributions.js", "chart-distributions-ui.js"]
|
||||
git-repository-url = "https://github.com/mozilla/glean"
|
||||
git-branch = "main"
|
||||
mathjax-support = true
|
||||
|
||||
[preprocessor.open-on-gh]
|
||||
command = "mdbook-open-on-gh"
|
После Ширина: | Высота: | Размер: 113 KiB |
|
@ -0,0 +1,169 @@
|
|||
/* Style the tab */
|
||||
.tabbar {
|
||||
overflow: hidden;
|
||||
border: 1px solid #ccc;
|
||||
background-color: #f1f1f1;
|
||||
}
|
||||
|
||||
/* Style the buttons that are used to open the tab content */
|
||||
.tabbar button {
|
||||
background-color: inherit;
|
||||
float: left;
|
||||
border: none;
|
||||
outline: none;
|
||||
cursor: pointer;
|
||||
padding: 14px 16px;
|
||||
transition: 0.3s;
|
||||
}
|
||||
|
||||
/* Change background color of buttons on hover */
|
||||
.tabbar button:hover {
|
||||
background-color: #ddd;
|
||||
}
|
||||
|
||||
/* Create an active/current tablink class */
|
||||
.tabbar button.active {
|
||||
background-color: #ccc;
|
||||
}
|
||||
|
||||
/* The container that holds all of the tab contents */
|
||||
.tabcontents {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
/* The container for each individual language */
|
||||
.tab {
|
||||
display: none;
|
||||
width: 100%;
|
||||
border: 1px solid #ccc;
|
||||
border-top: none;
|
||||
padding: 6px 12px;
|
||||
}
|
||||
|
||||
.tab.active {
|
||||
display: block;
|
||||
}
|
||||
|
||||
/* The footer with the "Open on GitHub" link */
|
||||
footer#open-on-gh {
|
||||
font-size: 0.8em;
|
||||
text-align: center;
|
||||
border-top: 1px solid black;
|
||||
padding: 5px 0;
|
||||
}
|
||||
|
||||
/* Distribution simulator styles */
|
||||
|
||||
#simulator-container {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#simulator-container h3 {
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
#simulator-container .input-group {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#simulator-container .input-group label {
|
||||
display: block;
|
||||
font-weight: bold;
|
||||
font-size: 14px;
|
||||
margin-bottom: 7px;
|
||||
}
|
||||
|
||||
#simulator-container .input-group input,
|
||||
#simulator-container .input-group select,
|
||||
#custom-data-modal textarea {
|
||||
display: block;
|
||||
width: 100%;
|
||||
padding: 5px;
|
||||
margin-bottom: 10px;
|
||||
border-radius: 3px;
|
||||
border: 1px solid #e0e0e0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
#histogram-props,
|
||||
#data-options {
|
||||
width: 50%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
#data-options {
|
||||
padding-right: 50px;
|
||||
}
|
||||
|
||||
#data-options .input-group {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
#data-options .input-group:first-of-type {
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
#data-options .input-group:last-of-type {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
#data-options .input-group label {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
#data-options .input-group input {
|
||||
display: inline;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
#histogram-chart-container {
|
||||
width: 100%;
|
||||
padding: 30px;
|
||||
border: 1px solid #e0e0e0;
|
||||
margin: 30px 0;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
#histogram-chart {
|
||||
margin-top: 50px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#histogram-chart-legend {
|
||||
font-size: 14px;
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#histogram-functional-props,
|
||||
#histogram-non-functional-props {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#custom-data-modal-overlay {
|
||||
background-color: rgba(0, 0, 0, .5);
|
||||
position: fixed;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 999;
|
||||
display: none;
|
||||
}
|
||||
|
||||
#custom-data-modal {
|
||||
width: 50%;
|
||||
background-color: white;
|
||||
border-radius: 5px;
|
||||
position: relative;
|
||||
top: 15%;
|
||||
left: 25%;
|
||||
padding: 50px;
|
||||
}
|
||||
|
||||
.hide {
|
||||
display: none !important;
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
mermaid.initialize({startOnLoad:true});
|
|
@ -0,0 +1,356 @@
|
|||
/*
|
||||
Licensed under the MIT License (MIT).
|
||||
Copyright (c) 2014 - 2018 Knut Sveidqvist
|
||||
Full license: https://github.com/mermaid-js/mermaid/blob/develop/LICENSE
|
||||
*/
|
||||
/* Flowchart variables */
|
||||
/* Sequence Diagram variables */
|
||||
/* Gantt chart variables */
|
||||
.mermaid .mermaid .label {
|
||||
color: #333;
|
||||
}
|
||||
.mermaid .node rect,
|
||||
.mermaid .node circle,
|
||||
.mermaid .node ellipse,
|
||||
.mermaid .node polygon {
|
||||
fill: #ECECFF;
|
||||
stroke: #CCCCFF;
|
||||
stroke-width: 1px;
|
||||
}
|
||||
.mermaid .arrowheadPath {
|
||||
fill: #333333;
|
||||
}
|
||||
.mermaid .edgePath .path {
|
||||
stroke: #333333;
|
||||
}
|
||||
.mermaid .edgeLabel {
|
||||
background-color: #e8e8e8;
|
||||
}
|
||||
.mermaid .cluster rect {
|
||||
fill: #ffffde !important;
|
||||
rx: 4 !important;
|
||||
stroke: #aaaa33 !important;
|
||||
stroke-width: 1px !important;
|
||||
}
|
||||
.mermaid .cluster text {
|
||||
fill: #333;
|
||||
}
|
||||
.mermaid .actor {
|
||||
stroke: #CCCCFF;
|
||||
fill: #ECECFF;
|
||||
}
|
||||
.mermaid text.actor {
|
||||
fill: black;
|
||||
stroke: none;
|
||||
}
|
||||
.mermaid .actor-line {
|
||||
stroke: grey;
|
||||
}
|
||||
.mermaid .messageLine0 {
|
||||
stroke-width: 1.5;
|
||||
stroke-dasharray: "2 2";
|
||||
marker-end: "url(#arrowhead)";
|
||||
stroke: #333;
|
||||
}
|
||||
.mermaid .messageLine1 {
|
||||
stroke-width: 1.5;
|
||||
stroke-dasharray: "2 2";
|
||||
stroke: #333;
|
||||
}
|
||||
.mermaid #arrowhead {
|
||||
fill: #333;
|
||||
}
|
||||
.mermaid #crosshead path {
|
||||
fill: #333 !important;
|
||||
stroke: #333 !important;
|
||||
}
|
||||
.mermaid .messageText {
|
||||
fill: #333;
|
||||
stroke: none;
|
||||
}
|
||||
.mermaid .labelBox {
|
||||
stroke: #CCCCFF;
|
||||
fill: #ECECFF;
|
||||
}
|
||||
.mermaid .labelText {
|
||||
fill: black;
|
||||
stroke: none;
|
||||
}
|
||||
.mermaid .loopText {
|
||||
fill: black;
|
||||
stroke: none;
|
||||
}
|
||||
.mermaid .loopLine {
|
||||
stroke-width: 2;
|
||||
stroke-dasharray: "2 2";
|
||||
marker-end: "url(#arrowhead)";
|
||||
stroke: #CCCCFF;
|
||||
}
|
||||
.mermaid .note {
|
||||
stroke: #aaaa33;
|
||||
fill: #fff5ad;
|
||||
}
|
||||
.mermaid .noteText {
|
||||
fill: black;
|
||||
stroke: none;
|
||||
font-family: 'trebuchet ms', verdana, arial;
|
||||
font-size: 14px;
|
||||
}
|
||||
/** Section styling */
|
||||
.mermaid .section {
|
||||
stroke: none;
|
||||
opacity: 0.2;
|
||||
}
|
||||
.mermaid .section0 {
|
||||
fill: rgba(102, 102, 255, 0.49);
|
||||
}
|
||||
.mermaid .section2 {
|
||||
fill: #fff400;
|
||||
}
|
||||
.mermaid .section1,
|
||||
.mermaid .section3 {
|
||||
fill: white;
|
||||
opacity: 0.2;
|
||||
}
|
||||
.mermaid .sectionTitle0 {
|
||||
fill: #333;
|
||||
}
|
||||
.mermaid .sectionTitle1 {
|
||||
fill: #333;
|
||||
}
|
||||
.mermaid .sectionTitle2 {
|
||||
fill: #333;
|
||||
}
|
||||
.mermaid .sectionTitle3 {
|
||||
fill: #333;
|
||||
}
|
||||
.mermaid .sectionTitle {
|
||||
text-anchor: start;
|
||||
font-size: 11px;
|
||||
text-height: 14px;
|
||||
}
|
||||
/* Grid and axis */
|
||||
.mermaid .grid .tick {
|
||||
stroke: lightgrey;
|
||||
opacity: 0.3;
|
||||
shape-rendering: crispEdges;
|
||||
}
|
||||
.mermaid .grid path {
|
||||
stroke-width: 0;
|
||||
}
|
||||
/* Today line */
|
||||
.mermaid .today {
|
||||
fill: none;
|
||||
stroke: red;
|
||||
stroke-width: 2px;
|
||||
}
|
||||
/* Task styling */
|
||||
/* Default task */
|
||||
.mermaid .task {
|
||||
stroke-width: 2;
|
||||
}
|
||||
.mermaid .taskText {
|
||||
text-anchor: middle;
|
||||
font-size: 11px;
|
||||
}
|
||||
.mermaid .taskTextOutsideRight {
|
||||
fill: black;
|
||||
text-anchor: start;
|
||||
font-size: 11px;
|
||||
}
|
||||
.mermaid .taskTextOutsideLeft {
|
||||
fill: black;
|
||||
text-anchor: end;
|
||||
font-size: 11px;
|
||||
}
|
||||
/* Specific task settings for the sections*/
|
||||
.mermaid .taskText0,
|
||||
.mermaid .taskText1,
|
||||
.mermaid .taskText2,
|
||||
.mermaid .taskText3 {
|
||||
fill: white;
|
||||
}
|
||||
.mermaid .task0,
|
||||
.mermaid .task1,
|
||||
.mermaid .task2,
|
||||
.mermaid .task3 {
|
||||
fill: #8a90dd;
|
||||
stroke: #534fbc;
|
||||
}
|
||||
.mermaid .taskTextOutside0,
|
||||
.mermaid .taskTextOutside2 {
|
||||
fill: black;
|
||||
}
|
||||
.mermaid .taskTextOutside1,
|
||||
.mermaid .taskTextOutside3 {
|
||||
fill: black;
|
||||
}
|
||||
/* Active task */
|
||||
.mermaid .active0,
|
||||
.mermaid .active1,
|
||||
.mermaid .active2,
|
||||
.mermaid .active3 {
|
||||
fill: #bfc7ff;
|
||||
stroke: #534fbc;
|
||||
}
|
||||
.mermaid .activeText0,
|
||||
.mermaid .activeText1,
|
||||
.mermaid .activeText2,
|
||||
.mermaid .activeText3 {
|
||||
fill: black !important;
|
||||
}
|
||||
/* Completed task */
|
||||
.mermaid .done0,
|
||||
.mermaid .done1,
|
||||
.mermaid .done2,
|
||||
.mermaid .done3 {
|
||||
stroke: grey;
|
||||
fill: lightgrey;
|
||||
stroke-width: 2;
|
||||
}
|
||||
.mermaid .doneText0,
|
||||
.mermaid .doneText1,
|
||||
.mermaid .doneText2,
|
||||
.mermaid .doneText3 {
|
||||
fill: black !important;
|
||||
}
|
||||
/* Tasks on the critical line */
|
||||
.mermaid .crit0,
|
||||
.mermaid .crit1,
|
||||
.mermaid .crit2,
|
||||
.mermaid .crit3 {
|
||||
stroke: #ff8888;
|
||||
fill: red;
|
||||
stroke-width: 2;
|
||||
}
|
||||
.mermaid .activeCrit0,
|
||||
.mermaid .activeCrit1,
|
||||
.mermaid .activeCrit2,
|
||||
.mermaid .activeCrit3 {
|
||||
stroke: #ff8888;
|
||||
fill: #bfc7ff;
|
||||
stroke-width: 2;
|
||||
}
|
||||
.mermaid .doneCrit0,
|
||||
.mermaid .doneCrit1,
|
||||
.mermaid .doneCrit2,
|
||||
.mermaid .doneCrit3 {
|
||||
stroke: #ff8888;
|
||||
fill: lightgrey;
|
||||
stroke-width: 2;
|
||||
cursor: pointer;
|
||||
shape-rendering: crispEdges;
|
||||
}
|
||||
.mermaid .doneCritText0,
|
||||
.mermaid .doneCritText1,
|
||||
.mermaid .doneCritText2,
|
||||
.mermaid .doneCritText3 {
|
||||
fill: black !important;
|
||||
}
|
||||
.mermaid .activeCritText0,
|
||||
.mermaid .activeCritText1,
|
||||
.mermaid .activeCritText2,
|
||||
.mermaid .activeCritText3 {
|
||||
fill: black !important;
|
||||
}
|
||||
.mermaid .titleText {
|
||||
text-anchor: middle;
|
||||
font-size: 18px;
|
||||
fill: black;
|
||||
}
|
||||
.mermaid g.classGroup text {
|
||||
fill: #9370DB;
|
||||
stroke: none;
|
||||
font-family: 'trebuchet ms', verdana, arial;
|
||||
font-size: 10px;
|
||||
}
|
||||
.mermaid g.classGroup rect {
|
||||
fill: #ECECFF;
|
||||
stroke: #9370DB;
|
||||
}
|
||||
.mermaid g.classGroup line {
|
||||
stroke: #9370DB;
|
||||
stroke-width: 1;
|
||||
}
|
||||
.mermaid svg .classLabel .box {
|
||||
stroke: none;
|
||||
stroke-width: 0;
|
||||
fill: #ECECFF;
|
||||
opacity: 0.5;
|
||||
}
|
||||
.mermaid svg .classLabel .label {
|
||||
fill: #9370DB;
|
||||
font-size: 10px;
|
||||
}
|
||||
.mermaid .relation {
|
||||
stroke: #9370DB;
|
||||
stroke-width: 1;
|
||||
fill: none;
|
||||
}
|
||||
.mermaid .composition {
|
||||
fill: #9370DB;
|
||||
stroke: #9370DB;
|
||||
stroke-width: 1;
|
||||
}
|
||||
.mermaid #compositionStart {
|
||||
fill: #9370DB;
|
||||
stroke: #9370DB;
|
||||
stroke-width: 1;
|
||||
}
|
||||
.mermaid #compositionEnd {
|
||||
fill: #9370DB;
|
||||
stroke: #9370DB;
|
||||
stroke-width: 1;
|
||||
}
|
||||
.mermaid .aggregation {
|
||||
fill: #ECECFF;
|
||||
stroke: #9370DB;
|
||||
stroke-width: 1;
|
||||
}
|
||||
.mermaid #aggregationStart {
|
||||
fill: #ECECFF;
|
||||
stroke: #9370DB;
|
||||
stroke-width: 1;
|
||||
}
|
||||
.mermaid #aggregationEnd {
|
||||
fill: #ECECFF;
|
||||
stroke: #9370DB;
|
||||
stroke-width: 1;
|
||||
}
|
||||
.mermaid #dependencyStart {
|
||||
fill: #9370DB;
|
||||
stroke: #9370DB;
|
||||
stroke-width: 1;
|
||||
}
|
||||
.mermaid #dependencyEnd {
|
||||
fill: #9370DB;
|
||||
stroke: #9370DB;
|
||||
stroke-width: 1;
|
||||
}
|
||||
.mermaid #extensionStart {
|
||||
fill: #9370DB;
|
||||
stroke: #9370DB;
|
||||
stroke-width: 1;
|
||||
}
|
||||
.mermaid #extensionEnd {
|
||||
fill: #9370DB;
|
||||
stroke: #9370DB;
|
||||
stroke-width: 1;
|
||||
}
|
||||
.mermaid .node text {
|
||||
font-family: 'trebuchet ms', verdana, arial;
|
||||
font-size: 14px;
|
||||
}
|
||||
.mermaid div.mermaidTooltip {
|
||||
position: absolute;
|
||||
text-align: center;
|
||||
max-width: 200px;
|
||||
padding: 2px;
|
||||
font-family: 'trebuchet ms', verdana, arial;
|
||||
font-size: 12px;
|
||||
background: #ffffde;
|
||||
border: 1px solid #aaaa33;
|
||||
border-radius: 2px;
|
||||
pointer-events: none;
|
||||
z-index: 100;
|
||||
}
|
|
@ -0,0 +1,97 @@
|
|||
/**
|
||||
* Returns true if browser supports HTML5 localStorage.
|
||||
*/
|
||||
function supportsHTML5Storage() {
|
||||
try {
|
||||
return 'localStorage' in window && window['localStorage'] !== null;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Event handler for when a tab is clicked.
|
||||
*/
|
||||
function onClickTab(event) {
|
||||
let target = event.currentTarget;
|
||||
let language = target.dataset.lang;
|
||||
|
||||
const initialTargetOffset = target.offsetTop;
|
||||
const initialScrollPosition = window.scrollY;
|
||||
switchAllTabs(language);
|
||||
|
||||
// Keep initial perceived scroll position after resizing
|
||||
// that may happen due to activation of multiple tabs in the same page.
|
||||
const finalTargetOffset = target.offsetTop;
|
||||
window.scrollTo({
|
||||
top: initialScrollPosition + (finalTargetOffset - initialTargetOffset)
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Switches the displayed tab for the given container.
|
||||
*
|
||||
* :param container: The div containing both the tab bar and the individual tabs
|
||||
* as direct children.
|
||||
* :param language: The language to switch to.
|
||||
*/
|
||||
function switchTab(container, language) {
|
||||
const previouslyActiveTab = container.querySelector(".tabcontents .active");
|
||||
previouslyActiveTab && previouslyActiveTab.classList.remove("active");
|
||||
let tab = container.querySelector(`.tabcontents [data-lang="${language}"]`);
|
||||
tab && tab.classList.add("active");
|
||||
|
||||
const previouslyActiveButton = container.querySelector(".tabbar .active");
|
||||
previouslyActiveButton && previouslyActiveButton.classList.remove("active");
|
||||
let button = container.querySelector(`.tabbar [data-lang="${language}"]`);
|
||||
button && button.classList.add("active");
|
||||
}
|
||||
|
||||
/**
|
||||
* Switches all tabs on the page to the given language.
|
||||
*
|
||||
* :param language: The language to switch to.
|
||||
*/
|
||||
function switchAllTabs(language) {
|
||||
const containers = document.getElementsByClassName("tabs");
|
||||
for (let i = 0; i < containers.length; ++i) {
|
||||
switchTab(containers[i], language);
|
||||
}
|
||||
|
||||
if (supportsHTML5Storage()) {
|
||||
localStorage.setItem("glean-preferred-language", language);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Opens all tabs on the page to the given language on page load.
|
||||
*/
|
||||
function openTabs() {
|
||||
if (!supportsHTML5Storage()) {
|
||||
return;
|
||||
}
|
||||
|
||||
let containers = document.getElementsByClassName("tabs");
|
||||
for (let i = 0; i < containers.length; ++i) {
|
||||
// Create tabs for every language that has content
|
||||
let tabs = containers[i].children[0];
|
||||
let tabcontents = containers[i].children[1];
|
||||
for (let tabcontent of tabcontents.children) {
|
||||
let button = document.createElement("button");
|
||||
button.dataset.lang = tabcontent.dataset.lang;
|
||||
button.className = "tablinks";
|
||||
button.onclick = onClickTab;
|
||||
button.innerText = tabcontent.dataset.lang;
|
||||
tabs.appendChild(button);
|
||||
}
|
||||
}
|
||||
|
||||
var language = localStorage.getItem("glean-preferred-language");
|
||||
if (language == null) {
|
||||
language = "Kotlin";
|
||||
}
|
||||
|
||||
switchAllTabs(language);
|
||||
}
|
||||
|
||||
openTabs()
|
|
@ -24,7 +24,7 @@ Additionally, applications (but not libraries) **must**:
|
|||
|
||||
### Integrating with your project
|
||||
|
||||
{{#include ../tab_header.md}}
|
||||
{{#include ../../shared/tab_header.md}}
|
||||
|
||||
<div data-lang="Kotlin" class="tab">
|
||||
|
||||
|
@ -161,7 +161,7 @@ TODO. To be implemented in [bug 1643568](https://bugzilla.mozilla.org/show_bug.c
|
|||
|
||||
</div>
|
||||
|
||||
{{#include ../tab_footer.md}}
|
||||
{{#include ../../shared/tab_footer.md}}
|
||||
|
||||
### Adding new metrics
|
||||
|
||||
|
@ -173,7 +173,7 @@ See the [metric parameters](metric-parameters.md) documentation which provides r
|
|||
> **Important**: as stated [before](adding-glean-to-your-project.md#glean-integration-checklist), any new data collection requires documentation and data-review.
|
||||
> This is also required for any new metric automatically collected by the Glean SDK.
|
||||
|
||||
{{#include ../tab_header.md}}
|
||||
{{#include ../../shared/tab_header.md}}
|
||||
|
||||
<div data-lang="Kotlin" class="tab">
|
||||
|
||||
|
@ -381,7 +381,7 @@ This is using the Python 3 interpreter found in `PATH` under the hood. The `GLEA
|
|||
|
||||
</div>
|
||||
|
||||
{{#include ../tab_footer.md}}
|
||||
{{#include ../../shared/tab_footer.md}}
|
||||
|
||||
### Adding custom pings
|
||||
|
||||
|
@ -394,7 +394,7 @@ Please refer to the [custom pings documentation](pings/custom.md).
|
|||
|
||||
All of the Glean SDK's target languages use a separate worker thread to do most of its work, including any I/O. This thread is fully managed by the Glean SDK as an implementation detail. Therefore, users should feel free to use the Glean SDK wherever it is most convenient, without worrying about the performance impact of updating metrics and sending pings.
|
||||
|
||||
{{#include ../tab_header.md}}
|
||||
{{#include ../../shared/tab_header.md}}
|
||||
|
||||
<div data-lang="Python" class="tab">
|
||||
Since the Glean SDK performs disk and networking I/O, it tries to do as much of its work as possible on separate threads and processes.
|
||||
|
@ -422,7 +422,7 @@ Therefore, if the Glean SDK detects that it is running in a `multiprocessing` su
|
|||
In practice, this should not be a performance issue: since the work is already in a subprocess, it will not block the main process of your application.
|
||||
</div>
|
||||
|
||||
{{#include ../tab_footer.md}}
|
||||
{{#include ../../shared/tab_footer.md}}
|
||||
|
||||
### Testing metrics
|
||||
|
|
@ -206,7 +206,7 @@ While this may seem limiting, this is required to:
|
|||
|
||||
One thing to note is that we try to adhere to the coding conventions of each language wherever possible, to the metric name in the `metrics.yaml` (which is in `snake_case`) may be changed to some other case convention, such as `camelCase`, when used from code.
|
||||
|
||||
{{#include ../tab_header.md}}
|
||||
{{#include ../../shared/tab_header.md}}
|
||||
|
||||
<div data-lang="Kotlin" class="tab">
|
||||
|
||||
|
@ -264,6 +264,6 @@ TODO. To be implemented in [this bug](https://bugzilla.mozilla.org/show_bug.cgi?
|
|||
|
||||
</div>
|
||||
|
||||
{{#include ../tab_footer.md}}
|
||||
{{#include ../../shared/tab_footer.md}}
|
||||
|
||||
[lean-data]: https://www.mozilla.org/en-US/about/policy/lean-data/stay-lean/
|
|
@ -0,0 +1,158 @@
|
|||
<!-- AUTOGENERATED BY glean_parser. DO NOT EDIT. -->
|
||||
|
||||
# Metrics
|
||||
|
||||
This document enumerates the metrics collected by this project using the [Glean SDK](https://mozilla.github.io/glean/book/index.html).
|
||||
This project may depend on other projects which also collect metrics.
|
||||
This means you might have to go searching through the dependency tree to get a full picture of everything collected by this project.
|
||||
|
||||
# Pings
|
||||
|
||||
- [all-pings](#all-pings)
|
||||
- [baseline](#baseline)
|
||||
- [deletion-request](#deletion-request)
|
||||
- [metrics](#metrics)
|
||||
|
||||
## all-pings
|
||||
|
||||
These metrics are sent in every ping.
|
||||
|
||||
All Glean pings contain built-in metrics in the [`ping_info`](https://mozilla.github.io/glean/book/user/pings/index.html#the-ping_info-section) and [`client_info`](https://mozilla.github.io/glean/book/user/pings/index.html#the-client_info-section) sections.
|
||||
|
||||
In addition to those built-in metrics, the following metrics are added to the ping:
|
||||
|
||||
| Name | Type | Description | Data reviews | Extras | Expiration | [Data Sensitivity](https://wiki.mozilla.org/Firefox/Data_Collection) |
|
||||
| --- | --- | --- | --- | --- | --- | --- |
|
||||
| glean.error.invalid_label |[labeled_counter](https://mozilla.github.io/glean/book/user/metrics/labeled_counters.html) |Counts the number of times a metric was set with an invalid label. The labels are the `category.name` identifier of the metric. |[Bug 1499761](https://bugzilla.mozilla.org/show_bug.cgi?id=1499761#c5)||never |1 |
|
||||
| glean.error.invalid_overflow |[labeled_counter](https://mozilla.github.io/glean/book/user/metrics/labeled_counters.html) |Counts the number of times a metric was set a value that overflowed. The labels are the `category.name` identifier of the metric. |[Bug 1591912](https://bugzilla.mozilla.org/show_bug.cgi?id=1591912#c3)||never |1 |
|
||||
| glean.error.invalid_state |[labeled_counter](https://mozilla.github.io/glean/book/user/metrics/labeled_counters.html) |Counts the number of times a timing metric was used incorrectly. The labels are the `category.name` identifier of the metric. |[Bug 1499761](https://bugzilla.mozilla.org/show_bug.cgi?id=1499761#c5)||never |1 |
|
||||
| glean.error.invalid_value |[labeled_counter](https://mozilla.github.io/glean/book/user/metrics/labeled_counters.html) |Counts the number of times a metric was set to an invalid value. The labels are the `category.name` identifier of the metric. |[Bug 1499761](https://bugzilla.mozilla.org/show_bug.cgi?id=1499761#c5)||never |1 |
|
||||
|
||||
## baseline
|
||||
|
||||
This is a built-in ping that is assembled out of the box by the Glean SDK.
|
||||
|
||||
See the Glean SDK documentation for the [`baseline` ping](https://mozilla.github.io/glean/book/user/pings/baseline.html).
|
||||
|
||||
This ping is sent if empty.
|
||||
|
||||
This ping includes the [client id](https://mozilla.github.io/glean/book/user/pings/index.html#the-client_info-section).
|
||||
|
||||
**Data reviews for this ping:**
|
||||
|
||||
- <https://bugzilla.mozilla.org/show_bug.cgi?id=1512938#c3>
|
||||
- <https://bugzilla.mozilla.org/show_bug.cgi?id=1599877#c25>
|
||||
|
||||
**Bugs related to this ping:**
|
||||
|
||||
- <https://bugzilla.mozilla.org/1512938>
|
||||
- <https://bugzilla.mozilla.org/1599877>
|
||||
|
||||
**Reasons this ping may be sent:**
|
||||
|
||||
- `active`: The ping was submitted when the application became active again, which
|
||||
includes when the application starts. In earlier versions, this was called
|
||||
`foreground`.
|
||||
|
||||
*Note*: this ping will not contain the `glean.baseline.duration` metric.
|
||||
|
||||
- `dirty_startup`: The ping was submitted at startup, because the application process was
|
||||
killed before the Glean SDK had the chance to generate this ping, before
|
||||
becoming inactive, in the last session.
|
||||
|
||||
*Note*: this ping will not contain the `glean.baseline.duration` metric.
|
||||
|
||||
- `inactive`: The ping was submitted when becoming inactive. In earlier versions, this
|
||||
was called `background`.
|
||||
|
||||
|
||||
All Glean pings contain built-in metrics in the [`ping_info`](https://mozilla.github.io/glean/book/user/pings/index.html#the-ping_info-section) and [`client_info`](https://mozilla.github.io/glean/book/user/pings/index.html#the-client_info-section) sections.
|
||||
|
||||
In addition to those built-in metrics, the following metrics are added to the ping:
|
||||
|
||||
| Name | Type | Description | Data reviews | Extras | Expiration | [Data Sensitivity](https://wiki.mozilla.org/Firefox/Data_Collection) |
|
||||
| --- | --- | --- | --- | --- | --- | --- |
|
||||
| glean.baseline.duration |[timespan](https://mozilla.github.io/glean/book/user/metrics/timespan.html) |The duration of the last foreground session. |[Bug 1512938](https://bugzilla.mozilla.org/show_bug.cgi?id=1512938#c3)||never |1, 2 |
|
||||
| glean.validation.first_run_hour |[datetime](https://mozilla.github.io/glean/book/user/metrics/datetime.html) |The hour of the first run of the application. |[Bug 1680783](https://bugzilla.mozilla.org/show_bug.cgi?id=1680783#c5)||never |1 |
|
||||
| glean.validation.pings_submitted |[labeled_counter](https://mozilla.github.io/glean/book/user/metrics/labeled_counters.html) |A count of the pings submitted, by ping type. This metric appears in both the metrics and baseline pings. - On the metrics ping, the counts include the number of pings sent since the last metrics ping (including the last metrics ping) - On the baseline ping, the counts include the number of pings send since the last baseline ping (including the last baseline ping) |[Bug 1586764](https://bugzilla.mozilla.org/show_bug.cgi?id=1586764#c3)||never |1 |
|
||||
|
||||
## deletion-request
|
||||
|
||||
This is a built-in ping that is assembled out of the box by the Glean SDK.
|
||||
|
||||
See the Glean SDK documentation for the [`deletion-request` ping](https://mozilla.github.io/glean/book/user/pings/deletion-request.html).
|
||||
|
||||
This ping is sent if empty.
|
||||
|
||||
This ping includes the [client id](https://mozilla.github.io/glean/book/user/pings/index.html#the-client_info-section).
|
||||
|
||||
**Data reviews for this ping:**
|
||||
|
||||
- <https://bugzilla.mozilla.org/show_bug.cgi?id=1587095#c6>
|
||||
|
||||
**Bugs related to this ping:**
|
||||
|
||||
- <https://bugzilla.mozilla.org/1587095>
|
||||
|
||||
All Glean pings contain built-in metrics in the [`ping_info`](https://mozilla.github.io/glean/book/user/pings/index.html#the-ping_info-section) and [`client_info`](https://mozilla.github.io/glean/book/user/pings/index.html#the-client_info-section) sections.
|
||||
|
||||
This ping contains no metrics.
|
||||
|
||||
## metrics
|
||||
|
||||
This is a built-in ping that is assembled out of the box by the Glean SDK.
|
||||
|
||||
See the Glean SDK documentation for the [`metrics` ping](https://mozilla.github.io/glean/book/user/pings/metrics.html).
|
||||
|
||||
This ping includes the [client id](https://mozilla.github.io/glean/book/user/pings/index.html#the-client_info-section).
|
||||
|
||||
**Data reviews for this ping:**
|
||||
|
||||
- <https://bugzilla.mozilla.org/show_bug.cgi?id=1512938#c3>
|
||||
- <https://bugzilla.mozilla.org/show_bug.cgi?id=1557048#c13>
|
||||
|
||||
**Bugs related to this ping:**
|
||||
|
||||
- <https://bugzilla.mozilla.org/1512938>
|
||||
|
||||
**Reasons this ping may be sent:**
|
||||
|
||||
- `overdue`: The last ping wasn't submitted on the current calendar day, but it's after
|
||||
4am, so this ping submitted immediately
|
||||
|
||||
- `reschedule`: A ping was just submitted. This ping was rescheduled for the next calendar
|
||||
day at 4am.
|
||||
|
||||
- `today`: The last ping wasn't submitted on the current calendar day, but it is
|
||||
still before 4am, so schedule to send this ping on the current calendar
|
||||
day at 4am.
|
||||
|
||||
- `tomorrow`: The last ping was already submitted on the current calendar day, so
|
||||
schedule this ping for the next calendar day at 4am.
|
||||
|
||||
- `upgrade`: This ping was submitted at startup because the application was just
|
||||
upgraded.
|
||||
|
||||
|
||||
All Glean pings contain built-in metrics in the [`ping_info`](https://mozilla.github.io/glean/book/user/pings/index.html#the-ping_info-section) and [`client_info`](https://mozilla.github.io/glean/book/user/pings/index.html#the-client_info-section) sections.
|
||||
|
||||
In addition to those built-in metrics, the following metrics are added to the ping:
|
||||
|
||||
| Name | Type | Description | Data reviews | Extras | Expiration | [Data Sensitivity](https://wiki.mozilla.org/Firefox/Data_Collection) |
|
||||
| --- | --- | --- | --- | --- | --- | --- |
|
||||
| glean.database.size |[memory_distribution](https://mozilla.github.io/glean/book/user/metrics/memory_distribution.html) |The size of the database file at startup. |[Bug 1656589](https://bugzilla.mozilla.org/show_bug.cgi?id=1656589#c7)||never |1 |
|
||||
| glean.error.io |[counter](https://mozilla.github.io/glean/book/user/metrics/counter.html) |The number of times we encountered an IO error when writing a pending ping to disk. |[Bug 1686233](https://bugzilla.mozilla.org/show_bug.cgi?id=1686233#c2)||never |1 |
|
||||
| glean.error.preinit_tasks_overflow |[counter](https://mozilla.github.io/glean/book/user/metrics/counter.html) |The number of tasks queued in the pre-initialization buffer. Only sent if the buffer overflows. |[Bug 1609482](https://bugzilla.mozilla.org/show_bug.cgi?id=1609482#c3)||never |1 |
|
||||
| glean.upload.deleted_pings_after_quota_hit |[counter](https://mozilla.github.io/glean/book/user/metrics/counter.html) |The number of pings deleted after the quota for the size of the pending pings directory or number of files is hit. Since quota is only calculated for the pending pings directory, and deletion request ping live in a different directory, deletion request pings are never deleted. |[Bug 1601550](https://bugzilla.mozilla.org/show_bug.cgi?id=1601550#c3)||never |1 |
|
||||
| glean.upload.discarded_exceeding_pings_size |[memory_distribution](https://mozilla.github.io/glean/book/user/metrics/memory_distribution.html) |The size of pings that exceeded the maximum ping size allowed for upload. |[Bug 1597761](https://bugzilla.mozilla.org/show_bug.cgi?id=1597761#c10)||never |1 |
|
||||
| glean.upload.pending_pings |[counter](https://mozilla.github.io/glean/book/user/metrics/counter.html) |The total number of pending pings at startup. This does not include deletion-request pings. |[Bug 1665041](https://bugzilla.mozilla.org/show_bug.cgi?id=1665041#c23)||never |1 |
|
||||
| glean.upload.pending_pings_directory_size |[memory_distribution](https://mozilla.github.io/glean/book/user/metrics/memory_distribution.html) |The size of the pending pings directory upon initialization of Glean. This does not include the size of the deletion request pings directory. |[Bug 1601550](https://bugzilla.mozilla.org/show_bug.cgi?id=1601550#c3)||never |1 |
|
||||
| glean.upload.ping_upload_failure |[labeled_counter](https://mozilla.github.io/glean/book/user/metrics/labeled_counters.html) |Counts the number of ping upload failures, by type of failure. This includes failures for all ping types, though the counts appear in the next successfully sent `metrics` ping. |[Bug 1589124](https://bugzilla.mozilla.org/show_bug.cgi?id=1589124#c1)|<ul><li>status_code_4xx</li><li>status_code_5xx</li><li>status_code_unknown</li><li>unrecoverable</li><li>recoverable</li></ul>|never |1 |
|
||||
| glean.validation.first_run_hour |[datetime](https://mozilla.github.io/glean/book/user/metrics/datetime.html) |The hour of the first run of the application. |[Bug 1680783](https://bugzilla.mozilla.org/show_bug.cgi?id=1680783#c5)||never |1 |
|
||||
| glean.validation.foreground_count |[counter](https://mozilla.github.io/glean/book/user/metrics/counter.html) |On mobile, the number of times the application went to foreground. |[Bug 1683707](https://bugzilla.mozilla.org/show_bug.cgi?id=1683707#c2)||never |1 |
|
||||
| glean.validation.pings_submitted |[labeled_counter](https://mozilla.github.io/glean/book/user/metrics/labeled_counters.html) |A count of the pings submitted, by ping type. This metric appears in both the metrics and baseline pings. - On the metrics ping, the counts include the number of pings sent since the last metrics ping (including the last metrics ping) - On the baseline ping, the counts include the number of pings send since the last baseline ping (including the last baseline ping) |[Bug 1586764](https://bugzilla.mozilla.org/show_bug.cgi?id=1586764#c3)||never |1 |
|
||||
|
||||
Data categories are [defined here](https://wiki.mozilla.org/Firefox/Data_Collection).
|
||||
|
||||
<!-- AUTOGENERATED BY glean_parser. DO NOT EDIT. -->
|
||||
|
|
@ -48,4 +48,4 @@ The Glean SDK logs warnings and errors through the platform-specific logging fra
|
|||
|
||||
### Implementation details
|
||||
|
||||
See [Debug Pings](../../dev/core/internal/debug-pings.md).
|
||||
See [Debug Pings](../../../dev/core/internal/debug-pings.md).
|
|
@ -7,7 +7,7 @@ The Glean SDK supports tagging all its pings with experiments annotations. The a
|
|||
|
||||
## API
|
||||
|
||||
{{#include ../tab_header.md}}
|
||||
{{#include ../../shared/tab_header.md}}
|
||||
|
||||
<div data-lang="Kotlin" class="tab">
|
||||
|
||||
|
@ -142,7 +142,7 @@ Assert.Equal(
|
|||
|
||||
</div>
|
||||
|
||||
{{#include ../tab_footer.md}}
|
||||
{{#include ../../shared/tab_footer.md}}
|
||||
|
||||
## Limits
|
||||
|
|
@ -34,7 +34,7 @@ The following steps are required for applications using the Glean SDK, but not l
|
|||
>
|
||||
> This does not apply to special builds where telemetry is disabled at build time. In that case, it is acceptable to not call `initialize` at all.
|
||||
|
||||
{{#include ../tab_header.md}}
|
||||
{{#include ../../shared/tab_header.md}}
|
||||
|
||||
<div data-lang="Kotlin" class="tab">
|
||||
|
||||
|
@ -205,7 +205,7 @@ GleanInstance.Initialize(
|
|||
|
||||
</div>
|
||||
|
||||
{{#include ../tab_footer.md}}
|
||||
{{#include ../../shared/tab_footer.md}}
|
||||
|
||||
## Behavior when uninitialized
|
||||
|
||||
|
@ -219,7 +219,7 @@ Built-in pings are only available after initialization.
|
|||
|
||||
## Enabling and disabling metrics
|
||||
|
||||
{{#include ../tab_header.md}}
|
||||
{{#include ../../shared/tab_header.md}}
|
||||
|
||||
<div data-lang="Kotlin" class="tab">
|
||||
|
||||
|
@ -261,7 +261,7 @@ Set the initial state using `uploadEnabled` on `GleanInstance.initialize()`.
|
|||
|
||||
</div>
|
||||
|
||||
{{#include ../tab_footer.md}}
|
||||
{{#include ../../shared/tab_footer.md}}
|
||||
|
||||
The application should provide some form of user interface to call this method.
|
||||
|
До Ширина: | Высота: | Размер: 75 KiB После Ширина: | Высота: | Размер: 75 KiB |
|
@ -18,7 +18,7 @@ flags:
|
|||
|
||||
## API
|
||||
|
||||
{{#include ../../tab_header.md}}
|
||||
{{#include ../../../shared/tab_header.md}}
|
||||
|
||||
<div data-lang="Kotlin" class="tab">
|
||||
|
||||
|
@ -181,7 +181,7 @@ Assert.equal(false, Glean.flags.a11yEnabled.testGetValue());
|
|||
|
||||
</div>
|
||||
|
||||
{{#include ../../tab_footer.md}}
|
||||
{{#include ../../../shared/tab_footer.md}}
|
||||
|
||||
## Limits
|
||||
|
|
@ -22,7 +22,7 @@ controls:
|
|||
|
||||
## API
|
||||
|
||||
{{#include ../../tab_header.md}}
|
||||
{{#include ../../../shared/tab_header.md}}
|
||||
|
||||
<div data-lang="Kotlin" class="tab">
|
||||
|
||||
|
@ -223,7 +223,7 @@ Assert.equal(6, Glean.controls.refreshPressed.testGetValue());
|
|||
|
||||
</div>
|
||||
|
||||
{{#include ../../tab_footer.md}}
|
||||
{{#include ../../../shared/tab_footer.md}}
|
||||
|
||||
## Limits
|
||||
|
|
@ -48,7 +48,7 @@ graphics:
|
|||
|
||||
Now you can use the custom distribution from the application's code.
|
||||
|
||||
{{#include ../../tab_header.md}}
|
||||
{{#include ../../../shared/tab_header.md}}
|
||||
|
||||
<div data-lang="Kotlin" class="tab">
|
||||
|
||||
|
@ -108,7 +108,7 @@ assert_eq!(
|
|||
|
||||
</div>
|
||||
|
||||
{{#include ../../tab_footer.md}}
|
||||
{{#include ../../../shared/tab_footer.md}}
|
||||
|
||||
## Limits
|
||||
|
|
@ -35,7 +35,7 @@ install:
|
|||
|
||||
## API
|
||||
|
||||
{{#include ../../tab_header.md}}
|
||||
{{#include ../../../shared/tab_header.md}}
|
||||
|
||||
<div data-lang="Kotlin" class="tab">
|
||||
|
||||
|
@ -254,7 +254,7 @@ Assert.ok(Glean.install.firstRun.testGetValue().startsWith("2020-06-11T12:00:00"
|
|||
|
||||
</div>
|
||||
|
||||
{{#include ../../tab_footer.md}}
|
||||
{{#include ../../../shared/tab_footer.md}}
|
||||
|
||||
## Limits
|
||||
|
|
@ -26,7 +26,7 @@ views:
|
|||
|
||||
## API
|
||||
|
||||
{{#include ../../tab_header.md}}
|
||||
{{#include ../../../shared/tab_header.md}}
|
||||
|
||||
<div data-lang="Kotlin" class="tab">
|
||||
|
||||
|
@ -230,7 +230,7 @@ There are test APIs available too:
|
|||
|
||||
</div>
|
||||
|
||||
{{#include ../../tab_footer.md}}
|
||||
{{#include ../../../shared/tab_footer.md}}
|
||||
|
||||
## Limits
|
||||
|
|
@ -25,7 +25,7 @@ user:
|
|||
|
||||
Now that the JWE is defined in `metrics.yaml`, you can use the metric to record values in the application's code.
|
||||
|
||||
{{#include ../../tab_header.md}}
|
||||
{{#include ../../../shared/tab_header.md}}
|
||||
|
||||
<div data-lang="Kotlin" class="tab">
|
||||
|
||||
|
@ -236,7 +236,7 @@ Assert.Equals(jwe, User.anonId.testGetCompactRepresentation())
|
|||
|
||||
</div>
|
||||
|
||||
{{#include ../../tab_footer.md}}
|
||||
{{#include ../../../shared/tab_footer.md}}
|
||||
|
||||
## Limits
|
||||
|
|
@ -24,7 +24,7 @@ accessibility:
|
|||
|
||||
Now you can use the labeled boolean from the application's code:
|
||||
|
||||
{{#include ../../tab_header.md}}
|
||||
{{#include ../../../shared/tab_header.md}}
|
||||
|
||||
<div data-lang="Kotlin" class="tab">
|
||||
|
||||
|
@ -163,7 +163,7 @@ assert_eq!(
|
|||
|
||||
</div>
|
||||
|
||||
{{#include ../../tab_footer.md}}
|
||||
{{#include ../../../shared/tab_footer.md}}
|
||||
|
||||
## Limits
|
||||
|
|
@ -24,7 +24,7 @@ stability:
|
|||
|
||||
Now you can use the labeled counter from the application's code:
|
||||
|
||||
{{#include ../../tab_header.md}}
|
||||
{{#include ../../../shared/tab_header.md}}
|
||||
|
||||
<div data-lang="Kotlin" class="tab">
|
||||
|
||||
|
@ -159,7 +159,7 @@ assert_eq!(
|
|||
|
||||
</div>
|
||||
|
||||
{{#include ../../tab_footer.md}}
|
||||
{{#include ../../../shared/tab_footer.md}}
|
||||
|
||||
## Limits
|
||||
|
|
@ -21,7 +21,7 @@ login:
|
|||
|
||||
Now you can use the labeled string from the application's code:
|
||||
|
||||
{{#include ../../tab_header.md}}
|
||||
{{#include ../../../shared/tab_header.md}}
|
||||
|
||||
<div data-lang="Kotlin" class="tab">
|
||||
|
||||
|
@ -139,7 +139,7 @@ assert_eq!(
|
|||
|
||||
</div>
|
||||
|
||||
{{#include ../../tab_footer.md}}
|
||||
{{#include ../../../shared/tab_footer.md}}
|
||||
|
||||
## Limits
|
||||
|
|
@ -33,7 +33,7 @@ Now you can use the memory distribution from the application's code.
|
|||
|
||||
For example, to measure the distribution of heap allocations:
|
||||
|
||||
{{#include ../../tab_header.md}}
|
||||
{{#include ../../../shared/tab_header.md}}
|
||||
|
||||
<div data-lang="Kotlin" class="tab">
|
||||
|
||||
|
@ -252,7 +252,7 @@ Assert.equal(1, Object.entries(data.values).reduce(([bucket, count], sum) => cou
|
|||
|
||||
</div>
|
||||
|
||||
{{#include ../../tab_footer.md}}
|
||||
{{#include ../../../shared/tab_footer.md}}
|
||||
|
||||
## Limits
|
||||
|
|
@ -23,7 +23,7 @@ Note that quantities have a required `unit` parameter, which is a free-form stri
|
|||
|
||||
## API
|
||||
|
||||
{{#include ../../tab_header.md}}
|
||||
{{#include ../../../shared/tab_header.md}}
|
||||
|
||||
<div data-lang="Kotlin" class="tab">
|
||||
|
||||
|
@ -165,7 +165,7 @@ assert_eq!(width, display::width.test_get_value(None).unwrap());
|
|||
|
||||
</div>
|
||||
|
||||
{{#include ../../tab_footer.md}}
|
||||
{{#include ../../../shared/tab_footer.md}}
|
||||
|
||||
## Limits
|
||||
|
|
@ -22,7 +22,7 @@ search.default:
|
|||
|
||||
## API
|
||||
|
||||
{{#include ../../tab_header.md}}
|
||||
{{#include ../../../shared/tab_header.md}}
|
||||
|
||||
<div data-lang="Kotlin" class="tab">
|
||||
|
||||
|
@ -214,7 +214,7 @@ Assert.equal("wikipedia", Glean.searchDefault.name.testGetValue());
|
|||
|
||||
</div>
|
||||
|
||||
{{#include ../../tab_footer.md}}
|
||||
{{#include ../../../shared/tab_footer.md}}
|
||||
|
||||
## Limits
|
||||
|
|
@ -24,7 +24,7 @@ search:
|
|||
|
||||
## API
|
||||
|
||||
{{#include ../../tab_header.md}}
|
||||
{{#include ../../../shared/tab_header.md}}
|
||||
|
||||
<div data-lang="Kotlin" class="tab">
|
||||
|
||||
|
@ -234,7 +234,7 @@ Assert.ok(engines.includes("duck duck go"));
|
|||
|
||||
</div>
|
||||
|
||||
{{#include ../../tab_footer.md}}
|
||||
{{#include ../../../shared/tab_footer.md}}
|
||||
|
||||
## Limits
|
||||
|
|
@ -34,7 +34,7 @@ auth:
|
|||
|
||||
## API
|
||||
|
||||
{{#include ../../tab_header.md}}
|
||||
{{#include ../../../shared/tab_header.md}}
|
||||
|
||||
<div data-lang="Kotlin" class="tab">
|
||||
|
||||
|
@ -317,7 +317,7 @@ Assert.ok(Glean.auth.loginTime.testGetValue() > 0);
|
|||
|
||||
</div>
|
||||
|
||||
{{#include ../../tab_footer.md}}
|
||||
{{#include ../../../shared/tab_footer.md}}
|
||||
|
||||
## Raw API
|
||||
|
||||
|
@ -329,7 +329,7 @@ This API should only be used if your library or application requires recording t
|
|||
|
||||
The raw API will not overwrite a running timer or existing timespan value.
|
||||
|
||||
{{#include ../../tab_header.md}}
|
||||
{{#include ../../../shared/tab_header.md}}
|
||||
|
||||
<div data-lang="Kotlin" class="tab">
|
||||
|
||||
|
@ -374,7 +374,7 @@ The raw API is not supported in Rust. See [bug 1680225](https://bugzilla.mozilla
|
|||
|
||||
</div>
|
||||
|
||||
{{#include ../../tab_footer.md}}
|
||||
{{#include ../../../shared/tab_footer.md}}
|
||||
|
||||
## Limits
|
||||
|
|
@ -50,7 +50,7 @@ Starting a timer returns a timer ID that needs to be used to stop or cancel the
|
|||
Multiple intervals can be measured concurrently.
|
||||
For example, to measure page load time on a number of tabs that are loading at the same time, each tab object needs to store the running timer ID.
|
||||
|
||||
{{#include ../../tab_header.md}}
|
||||
{{#include ../../../shared/tab_header.md}}
|
||||
|
||||
<div data-lang="Kotlin" class="tab">
|
||||
|
||||
|
@ -342,7 +342,7 @@ Assert.ok(Glean.pages.pageLoad.testGetValue().sum > 0);
|
|||
|
||||
</div>
|
||||
|
||||
{{#include ../../tab_footer.md}}
|
||||
{{#include ../../../shared/tab_footer.md}}
|
||||
|
||||
## Limits
|
||||
|
|
@ -20,7 +20,7 @@ user:
|
|||
|
||||
Now that the UUID is defined in `metrics.yaml`, you can use the metric to record values in the application's code.
|
||||
|
||||
{{#include ../../tab_header.md}}
|
||||
{{#include ../../../shared/tab_header.md}}
|
||||
|
||||
<div data-lang="Kotlin" class="tab">
|
||||
|
||||
|
@ -209,7 +209,7 @@ Assert.equal(Glean.user.clientId.testGetValue(), uuid);
|
|||
|
||||
</div>
|
||||
|
||||
{{#include ../../tab_footer.md}}
|
||||
{{#include ../../../shared/tab_footer.md}}
|
||||
|
||||
## Limits
|
||||
|
|
@ -47,7 +47,7 @@ search:
|
|||
|
||||
The Glean SDK build generates code from `pings.yaml` in a `Pings` object, which must be instantiated so Glean can send pings by name.
|
||||
|
||||
{{#include ../../tab_header.md}}
|
||||
{{#include ../../../shared/tab_header.md}}
|
||||
|
||||
<div data-lang="Kotlin" class="tab">
|
||||
|
||||
|
@ -137,7 +137,7 @@ class Program
|
|||
|
||||
</div>
|
||||
|
||||
{{#include ../../tab_footer.md}}
|
||||
{{#include ../../../shared/tab_footer.md}}
|
||||
|
||||
## Sending metrics in a custom ping
|
||||
|
||||
|
@ -171,7 +171,7 @@ By default, if the ping doesn't currently have any events or metrics set, `submi
|
|||
|
||||
For example, to submit the custom ping defined above:
|
||||
|
||||
{{#include ../../tab_header.md}}
|
||||
{{#include ../../../shared/tab_header.md}}
|
||||
|
||||
<div data-lang="Kotlin" class="tab">
|
||||
|
||||
|
@ -230,6 +230,6 @@ pings::search.submit(pings::SearchReasonCodes::Performed);
|
|||
|
||||
</div>
|
||||
|
||||
{{#include ../../tab_footer.md}}
|
||||
{{#include ../../../shared/tab_footer.md}}
|
||||
|
||||
If none of the metrics for the ping contain data the ping is not sent (unless `send_if_empty` is set to true in the definition file)
|
|
@ -28,7 +28,7 @@ Every ping has the following keys at the top-level:
|
|||
|
||||
- The `events` section contains the events recorded in the ping.
|
||||
|
||||
See the [payload documentation](../../dev/core/internal/payload.md) for more details for each metric type in the `metrics` and `events` section.
|
||||
See the [payload documentation](../../../dev/core/internal/payload.md) for more details for each metric type in the `metrics` and `events` section.
|
||||
|
||||
### The `ping_info` section
|
||||
The following fields are included in the `ping_info` section, for every ping.
|
||||
|
@ -128,7 +128,7 @@ A pre-defined set of headers is additionally sent along with the submitted ping:
|
|||
|
||||
These docs refer to application 'foreground' and 'background' state in several places.
|
||||
|
||||
{{#include ../../tab_header.md}}
|
||||
{{#include ../../../shared/tab_header.md}}
|
||||
|
||||
<div data-lang="Kotlin" class="tab">
|
||||
|
||||
|
@ -169,4 +169,4 @@ means.
|
|||
|
||||
</div>
|
||||
|
||||
{{#include ../../tab_footer.md}}
|
||||
{{#include ../../../shared/tab_footer.md}}
|
До Ширина: | Высота: | Размер: 86 KiB После Ширина: | Высота: | Размер: 86 KiB |
|
@ -53,7 +53,7 @@ custom_ping_data:
|
|||
|
||||
A potential usage of the Glean SDK generated API could be the following:
|
||||
|
||||
{{#include ../../tab_header.md}}
|
||||
{{#include ../../../shared/tab_header.md}}
|
||||
|
||||
<div data-lang="Kotlin" class="tab">
|
||||
|
||||
|
@ -303,4 +303,4 @@ TODO. To be implemented in [bug 1648446](https://bugzilla.mozilla.org/show_bug.c
|
|||
|
||||
</div>
|
||||
|
||||
{{#include ../../tab_footer.md}}
|
||||
{{#include ../../../shared/tab_footer.md}}
|
|
@ -8,7 +8,7 @@ These functions expose a way to inspect and validate recorded metric values with
|
|||
|
||||
## General test API method semantics
|
||||
|
||||
{{#include ../tab_header.md}}
|
||||
{{#include ../../shared/tab_header.md}}
|
||||
|
||||
<div data-lang="Kotlin" class="tab">
|
||||
|
||||
|
@ -159,7 +159,7 @@ TODO. To be implemented in [bug 1648448](https://bugzilla.mozilla.org/show_bug.c
|
|||
|
||||
</div>
|
||||
|
||||
{{#include ../tab_footer.md}}
|
||||
{{#include ../../shared/tab_footer.md}}
|
||||
|
||||
## Testing metrics for custom pings
|
||||
|
||||
|
@ -179,7 +179,7 @@ GleanMetrics.Foo.uriCount.testGetValue("customPing")
|
|||
|
||||
## Example of using the test API
|
||||
|
||||
{{#include ../tab_header.md}}
|
||||
{{#include ../../shared/tab_header.md}}
|
||||
|
||||
<div data-lang="Kotlin" class="tab">
|
||||
|
||||
|
@ -265,4 +265,4 @@ TODO. To be implemented in [bug 1648448](https://bugzilla.mozilla.org/show_bug.c
|
|||
|
||||
</div>
|
||||
|
||||
{{#include ../tab_footer.md}}
|
||||
{{#include ../../shared/tab_footer.md}}
|
|
@ -252,7 +252,7 @@ tasks.register("docs", org.jetbrains.dokka.gradle.DokkaAndroidTask) {
|
|||
|
||||
// Generate markdown docs for the collected metrics.
|
||||
ext.gleanGenerateMarkdownDocs = true
|
||||
ext.gleanDocsDirectory = "$rootDir/docs/user/collected-metrics"
|
||||
ext.gleanDocsDirectory = "$rootDir/docs/user/user/collected-metrics"
|
||||
ext.gleanYamlFiles = [
|
||||
"$rootDir/glean-core/metrics.yaml",
|
||||
"$rootDir/glean-core/pings.yaml",
|
||||
|
|