glean-parser 14.2.0__tar.gz → 14.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- glean_parser-14.3.0/.github/CODEOWNERS +12 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/CHANGELOG.md +6 -0
- {glean_parser-14.2.0/glean_parser.egg-info → glean_parser-14.3.0}/PKG-INFO +7 -1
- {glean_parser-14.2.0 → glean_parser-14.3.0}/docs/history.md +6 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/glean_parser/javascript_server.py +18 -2
- {glean_parser-14.2.0 → glean_parser-14.3.0}/glean_parser/templates/javascript_server.jinja2 +9 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/glean_parser/templates/kotlin.jinja2 +26 -6
- {glean_parser-14.2.0 → glean_parser-14.3.0}/glean_parser/templates/rust.jinja2 +47 -15
- {glean_parser-14.2.0 → glean_parser-14.3.0}/glean_parser/templates/swift.jinja2 +4 -4
- {glean_parser-14.2.0 → glean_parser-14.3.0/glean_parser.egg-info}/PKG-INFO +7 -1
- {glean_parser-14.2.0 → glean_parser-14.3.0}/glean_parser.egg-info/SOURCES.txt +1 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/tests/test_kotlin.py +2 -2
- {glean_parser-14.2.0 → glean_parser-14.3.0}/tests/test_rust.py +4 -4
- {glean_parser-14.2.0 → glean_parser-14.3.0}/tests/test_swift.py +2 -2
- {glean_parser-14.2.0 → glean_parser-14.3.0}/.circleci/config.yml +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/.editorconfig +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/.github/ISSUE_TEMPLATE.md +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/.github/dependabot.yml +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/.github/pull_request_template.md +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/.gitignore +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/.swiftlint.yml +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/AUTHORS.md +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/CODE_OF_CONDUCT.md +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/CONTRIBUTING.md +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/LICENSE +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/MANIFEST.in +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/Makefile +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/README.md +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/docs/Makefile +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/docs/_static/glean.jpeg +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/docs/authors.md +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/docs/conf.py +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/docs/contributing.md +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/docs/index.rst +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/docs/installation.md +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/docs/make.bat +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/docs/metrics-yaml.rst +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/docs/pings-yaml.rst +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/docs/readme.md +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/docs/tags-yaml.rst +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/glean_parser/__init__.py +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/glean_parser/__main__.py +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/glean_parser/coverage.py +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/glean_parser/data_review.py +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/glean_parser/go_server.py +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/glean_parser/javascript.py +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/glean_parser/kotlin.py +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/glean_parser/lint.py +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/glean_parser/markdown.py +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/glean_parser/metrics.py +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/glean_parser/parser.py +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/glean_parser/pings.py +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/glean_parser/python_server.py +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/glean_parser/ruby_server.py +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/glean_parser/rust.py +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/glean_parser/schemas/metrics.1-0-0.schema.yaml +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/glean_parser/schemas/metrics.2-0-0.schema.yaml +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/glean_parser/schemas/pings.1-0-0.schema.yaml +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/glean_parser/schemas/pings.2-0-0.schema.yaml +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/glean_parser/schemas/tags.1-0-0.schema.yaml +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/glean_parser/swift.py +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/glean_parser/tags.py +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/glean_parser/templates/data_review.jinja2 +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/glean_parser/templates/go_server.jinja2 +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/glean_parser/templates/javascript.buildinfo.jinja2 +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/glean_parser/templates/javascript.jinja2 +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/glean_parser/templates/kotlin.buildinfo.jinja2 +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/glean_parser/templates/kotlin.geckoview.jinja2 +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/glean_parser/templates/markdown.jinja2 +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/glean_parser/templates/python_server.jinja2 +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/glean_parser/templates/qmldir.jinja2 +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/glean_parser/templates/ruby_server.jinja2 +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/glean_parser/translate.py +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/glean_parser/translation_options.py +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/glean_parser/util.py +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/glean_parser/validate_ping.py +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/glean_parser.egg-info/dependency_links.txt +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/glean_parser.egg-info/entry_points.txt +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/glean_parser.egg-info/not-zip-safe +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/glean_parser.egg-info/requires.txt +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/glean_parser.egg-info/top_level.txt +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/pytest.ini +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/requirements_dev.txt +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/server_telemetry/sdk-metrics-compat.yaml +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/server_telemetry/server-side-pings.yaml +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/setup.cfg +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/setup.py +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/tests/conftest.py +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/tests/data/all_metrics.yaml +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/tests/data/all_pings.yaml +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/tests/data/bad_ping.yamlx +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/tests/data/core.yaml +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/tests/data/duplicate_labeled.yaml +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/tests/data/duplicate_send_in_ping.yaml +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/tests/data/empty.yaml +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/tests/data/event_key_ordering.yaml +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/tests/data/events_with_types.yaml +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/tests/data/fxa-server-metrics.yaml +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/tests/data/fxa-server-pings.yaml +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/tests/data/gecko.yaml +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/tests/data/go_server_metrics.yaml +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/tests/data/go_server_metrics_unsupported.yaml +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/tests/data/invalid-ping-names.yaml +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/tests/data/invalid.yamlx +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/tests/data/jwe.yaml +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/tests/data/metric-with-tags.yaml +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/tests/data/mixed-expirations.yaml +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/tests/data/object.yaml +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/tests/data/old_event_api.yamlx +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/tests/data/ordering.yaml +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/tests/data/pings.yaml +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/tests/data/rate.yaml +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/tests/data/ruby_server_metrics_unsupported.yaml +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/tests/data/ruby_server_pings_unsupported.yaml +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/tests/data/schema-violation.yaml +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/tests/data/send_if_empty_with_metrics.yaml +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/tests/data/server_events_compare.go +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/tests/data/server_events_compare.rb +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/tests/data/server_metrics_no_events_no_pings.yaml +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/tests/data/server_metrics_with_event.yaml +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/tests/data/server_pings.yaml +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/tests/data/single_labeled.yaml +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/tests/data/smaller.yaml +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/tests/data/tags.yaml +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/tests/data/telemetry_mirror.yaml +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/tests/data/text.yaml +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/tests/data/text_invalid.yaml +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/tests/data/unknown_ping_used.yaml +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/tests/data/wrong_key.yamlx +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/tests/data/yaml_nits.yamlx +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/tests/detekt.yml +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/tests/test-go/test.go.tmpl +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/tests/test-js/package.json +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/tests/test-js/test.js.tmpl +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/tests/test-py/test.py +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/tests/test-rb/test.rb.tmpl +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/tests/test_cli.py +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/tests/test_go_server.py +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/tests/test_javascript.py +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/tests/test_javascript_server.py +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/tests/test_lint.py +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/tests/test_markdown.py +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/tests/test_metrics.py +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/tests/test_parser.py +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/tests/test_pings.py +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/tests/test_python_server.py +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/tests/test_ruby_server.py +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/tests/test_tags.py +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/tests/test_translate.py +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/tests/test_utils.py +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/tests/test_validate_ping.py +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/tests/util.py +0 -0
- {glean_parser-14.2.0 → glean_parser-14.3.0}/tools/extract_data_categories.py +0 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
2
|
+
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3
|
+
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
4
|
+
|
|
5
|
+
# This CODEOWNERS file defines individuals or teams that are responsible
|
|
6
|
+
# for code in this repository.
|
|
7
|
+
# See https://help.github.com/articles/about-codeowners/ for details.
|
|
8
|
+
|
|
9
|
+
* @mozilla/glean
|
|
10
|
+
glean_parser/*_server.py @akkomar
|
|
11
|
+
tests/*_server.py @akkomar
|
|
12
|
+
server_telemetry/* @akkomar
|
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 14.3.0
|
|
6
|
+
|
|
7
|
+
- Add the `module_spec` option to the javascript_server outputter ([#726](https://github.com/mozilla/glean_parser/pull/726))
|
|
8
|
+
- BUGFIX: Fix the Rust codegen for changes to how `labeled_*` metrics are constructed ([bug 1909244](https://bugzilla.mozilla.org/show_bug.cgi?id=1909244))
|
|
9
|
+
- Generate a serializer for array wrappers ([bug 1908157](https://bugzilla.mozilla.org/show_bug.cgi?id=1908157))
|
|
10
|
+
|
|
5
11
|
## 14.2.0
|
|
6
12
|
|
|
7
13
|
- New Metric Types: `labeled_{custom|memory|timing}_distribution` ([bug 1657947](https://bugzilla.mozilla.org/show_bug.cgi?id=1657947))
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: glean_parser
|
|
3
|
-
Version: 14.
|
|
3
|
+
Version: 14.3.0
|
|
4
4
|
Summary: Parser tools for Mozilla's Glean telemetry
|
|
5
5
|
Home-page: https://github.com/mozilla/glean_parser
|
|
6
6
|
Author: The Glean Team
|
|
@@ -79,6 +79,12 @@ $ glean_parser check < ping.json
|
|
|
79
79
|
|
|
80
80
|
## Unreleased
|
|
81
81
|
|
|
82
|
+
## 14.3.0
|
|
83
|
+
|
|
84
|
+
- Add the `module_spec` option to the javascript_server outputter ([#726](https://github.com/mozilla/glean_parser/pull/726))
|
|
85
|
+
- BUGFIX: Fix the Rust codegen for changes to how `labeled_*` metrics are constructed ([bug 1909244](https://bugzilla.mozilla.org/show_bug.cgi?id=1909244))
|
|
86
|
+
- Generate a serializer for array wrappers ([bug 1908157](https://bugzilla.mozilla.org/show_bug.cgi?id=1908157))
|
|
87
|
+
|
|
82
88
|
## 14.2.0
|
|
83
89
|
|
|
84
90
|
- New Metric Types: `labeled_{custom|memory|timing}_distribution` ([bug 1657947](https://bugzilla.mozilla.org/show_bug.cgi?id=1657947))
|
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 14.3.0
|
|
6
|
+
|
|
7
|
+
- Add the `module_spec` option to the javascript_server outputter ([#726](https://github.com/mozilla/glean_parser/pull/726))
|
|
8
|
+
- BUGFIX: Fix the Rust codegen for changes to how `labeled_*` metrics are constructed ([bug 1909244](https://bugzilla.mozilla.org/show_bug.cgi?id=1909244))
|
|
9
|
+
- Generate a serializer for array wrappers ([bug 1908157](https://bugzilla.mozilla.org/show_bug.cgi?id=1908157))
|
|
10
|
+
|
|
5
11
|
## 14.2.0
|
|
6
12
|
|
|
7
13
|
- New Metric Types: `labeled_{custom|memory|timing}_distribution` ([bug 1657947](https://bugzilla.mozilla.org/show_bug.cgi?id=1657947))
|
|
@@ -87,6 +87,7 @@ def output(
|
|
|
87
87
|
lang: str,
|
|
88
88
|
objs: metrics.ObjectTree,
|
|
89
89
|
output_dir: Path,
|
|
90
|
+
options: Optional[Dict[str, Any]] = None,
|
|
90
91
|
) -> None:
|
|
91
92
|
"""
|
|
92
93
|
Given a tree of objects, output Javascript or Typescript code to `output_dir`.
|
|
@@ -100,6 +101,16 @@ def output(
|
|
|
100
101
|
:param output_dir: Path to an output directory to write to.
|
|
101
102
|
"""
|
|
102
103
|
|
|
104
|
+
if options is None:
|
|
105
|
+
options = {}
|
|
106
|
+
|
|
107
|
+
module_spec = options.get("module_spec", "es")
|
|
108
|
+
accepted_module_specs = ["es", "commonjs"]
|
|
109
|
+
if module_spec not in accepted_module_specs:
|
|
110
|
+
raise ValueError(
|
|
111
|
+
f"Unknown module_spec: {module_spec}. Accepted specs are: {accepted_module_specs}." # noqa
|
|
112
|
+
)
|
|
113
|
+
|
|
103
114
|
template = util.get_jinja2_template(
|
|
104
115
|
"javascript_server.jinja2",
|
|
105
116
|
filters=(
|
|
@@ -184,6 +195,7 @@ def output(
|
|
|
184
195
|
parser_version=__version__,
|
|
185
196
|
pings=ping_to_metrics,
|
|
186
197
|
event_metric_exists=event_metric_exists,
|
|
198
|
+
module_spec=module_spec,
|
|
187
199
|
lang=lang,
|
|
188
200
|
)
|
|
189
201
|
)
|
|
@@ -198,9 +210,13 @@ def output_javascript(
|
|
|
198
210
|
:param objects: A tree of objects (metrics and pings) as returned from
|
|
199
211
|
`parser.parse_objects`.
|
|
200
212
|
:param output_dir: Path to an output directory to write to.
|
|
213
|
+
:param options: options dictionary, with the following optional keys:
|
|
214
|
+
|
|
215
|
+
- `module_spec`: Module specification to use. Options are `es`, `commonjs`.
|
|
216
|
+
Default is `es`.
|
|
201
217
|
"""
|
|
202
218
|
|
|
203
|
-
output("javascript", objs, output_dir)
|
|
219
|
+
output("javascript", objs, output_dir, options)
|
|
204
220
|
|
|
205
221
|
|
|
206
222
|
def output_typescript(
|
|
@@ -214,4 +230,4 @@ def output_typescript(
|
|
|
214
230
|
:param output_dir: Path to an output directory to write to.
|
|
215
231
|
"""
|
|
216
232
|
|
|
217
|
-
output("typescript", objs, output_dir)
|
|
233
|
+
output("typescript", objs, output_dir, options)
|
|
@@ -11,8 +11,13 @@ Jinja2 template is not. Please file bugs! #}
|
|
|
11
11
|
// @types/uuid and mozlog types definitions are required in devDependencies
|
|
12
12
|
// for the latter see https://github.com/mozilla/fxa/blob/85bda71cda376c417b8c850ba82aa14252208c3c/types/mozlog/index.d.ts
|
|
13
13
|
{% endif %}
|
|
14
|
+
{% if module_spec == "commonjs" %}
|
|
15
|
+
const uuidv4 = require('uuid').v4;
|
|
16
|
+
const mozlog = require('mozlog');
|
|
17
|
+
{% else %}
|
|
14
18
|
import { v4 as uuidv4 } from 'uuid';
|
|
15
19
|
import mozlog{% if lang == "typescript" %}, { Logger }{% endif %} from 'mozlog';
|
|
20
|
+
{% endif %}
|
|
16
21
|
|
|
17
22
|
const GLEAN_EVENT_MOZLOG_TYPE = 'glean-server-event';
|
|
18
23
|
{% if lang == "typescript" %}
|
|
@@ -262,7 +267,11 @@ class {{ ping|event_class_name(metrics_by_type) }} {
|
|
|
262
267
|
* @param {Object} logger_options - The logger options.
|
|
263
268
|
* @returns {EventsServerEventLogger} An instance of EventsServerEventLogger.
|
|
264
269
|
*/
|
|
270
|
+
{% if module_spec == "commonjs" %}
|
|
271
|
+
module.exports.{{ ping|factory_method(metrics_by_type) }} = function ({
|
|
272
|
+
{% else %}
|
|
265
273
|
export const {{ ping|factory_method(metrics_by_type) }} = function ({
|
|
274
|
+
{% endif %}
|
|
266
275
|
applicationId,
|
|
267
276
|
appDisplayVersion,
|
|
268
277
|
channel,
|
|
@@ -68,7 +68,7 @@ data class {{ obj.name|Camelize }}{{ suffix }}(
|
|
|
68
68
|
|
|
69
69
|
{%- macro generate_structure(name, struct) %}
|
|
70
70
|
{%- if struct.type == "array" -%}
|
|
71
|
-
@Serializable
|
|
71
|
+
@Serializable(with = {{name}}.Serializer::class)
|
|
72
72
|
data class {{ name }}(var items: MutableList<{{ name }}Item> = mutableListOf()) : ObjectSerialize {
|
|
73
73
|
fun add(elem: {{ name }}Item) = items.add(elem)
|
|
74
74
|
|
|
@@ -85,6 +85,20 @@ data class {{ obj.name|Camelize }}{{ suffix }}(
|
|
|
85
85
|
override fun intoSerializedObject(): String {
|
|
86
86
|
return Json.encodeToString(items)
|
|
87
87
|
}
|
|
88
|
+
|
|
89
|
+
internal object Serializer : KSerializer<{{name}}> {
|
|
90
|
+
@OptIn(kotlinx.serialization.ExperimentalSerializationApi::class)
|
|
91
|
+
override val descriptor = listSerialDescriptor<String>()
|
|
92
|
+
|
|
93
|
+
override fun deserialize(decoder: Decoder): {{ name }} {
|
|
94
|
+
val list = decoder.decodeSerializableValue(ListSerializer(serializer<{{name}}Item>()))
|
|
95
|
+
return {{name}}(items = list.toMutableList())
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
override fun serialize(encoder: Encoder, value: {{name}}) {
|
|
99
|
+
encoder.encodeSerializableValue(ListSerializer(serializer<{{name}}Item>()), value.items)
|
|
100
|
+
}
|
|
101
|
+
}
|
|
88
102
|
}
|
|
89
103
|
|
|
90
104
|
{{ generate_structure(name ~ "Item", struct["items"]) }}
|
|
@@ -93,10 +107,10 @@ data class {{ obj.name|Camelize }}{{ suffix }}(
|
|
|
93
107
|
@Serializable
|
|
94
108
|
data class {{ name }}(
|
|
95
109
|
{% for itemname, val in struct.properties.items() %}
|
|
96
|
-
{% if val.type == "
|
|
110
|
+
{% if val.type == "array" %}
|
|
111
|
+
var {{itemname|camelize}}: {{ name ~ itemname|Camelize }} = {{ name ~ itemname|Camelize }}(),
|
|
112
|
+
{% elif val.type == "object" %}
|
|
97
113
|
var {{itemname|camelize}}: {{ name ~ "Item" ~ itemname|Camelize ~ "Object" }}? = null,
|
|
98
|
-
{% elif val.type == "array" %}
|
|
99
|
-
var {{itemname|camelize}}: {{ name ~ "Item" ~ itemname|Camelize }} = {{ name ~ "Item" ~ itemname|Camelize }}(),
|
|
100
114
|
{% else %}
|
|
101
115
|
var {{itemname|camelize}}: {{val.type|structure_type_name}}? = null,
|
|
102
116
|
{% endif %}
|
|
@@ -109,7 +123,7 @@ data class {{ obj.name|Camelize }}{{ suffix }}(
|
|
|
109
123
|
|
|
110
124
|
{% for itemname, val in struct.properties.items() %}
|
|
111
125
|
{% if val.type == "array" %}
|
|
112
|
-
{% set nested_name = name ~
|
|
126
|
+
{% set nested_name = name ~ itemname|Camelize %}
|
|
113
127
|
{{ generate_structure(nested_name, val) }}
|
|
114
128
|
{% elif val.type == "object" %}
|
|
115
129
|
{% set nested_name = name ~ "Item" ~ itemname|Camelize ~ "Object" %}
|
|
@@ -127,7 +141,7 @@ data class {{ obj.name|Camelize }}{{ suffix }}(
|
|
|
127
141
|
{%- elif struct.type == "object" -%}
|
|
128
142
|
{% for itemname, val in struct.properties.items() %}
|
|
129
143
|
{% if val.type == "array" %}
|
|
130
|
-
{% set nested_name = name ~
|
|
144
|
+
{% set nested_name = name ~ itemname|Camelize %}
|
|
131
145
|
{{ generate_structure_typealias(nested_name, val) }}
|
|
132
146
|
{% elif val.type == "object" %}
|
|
133
147
|
{% set nested_name = name ~ "Item" ~ itemname|Camelize ~ "Object" %}
|
|
@@ -160,9 +174,15 @@ import {{ glean_namespace }}.private.{{ obj_type }} // ktlint-disable import-ord
|
|
|
160
174
|
import {{ glean_namespace }}.private.LabeledMetricType // ktlint-disable import-ordering
|
|
161
175
|
{% endif %}
|
|
162
176
|
{% if has_object_metrics %}
|
|
177
|
+
import kotlinx.serialization.KSerializer
|
|
163
178
|
import kotlinx.serialization.Serializable
|
|
179
|
+
import kotlinx.serialization.builtins.ListSerializer
|
|
180
|
+
import kotlinx.serialization.descriptors.listSerialDescriptor
|
|
164
181
|
import kotlinx.serialization.encodeToString
|
|
182
|
+
import kotlinx.serialization.encoding.Decoder
|
|
183
|
+
import kotlinx.serialization.encoding.Encoder
|
|
165
184
|
import kotlinx.serialization.json.Json
|
|
185
|
+
import kotlinx.serialization.serializer
|
|
166
186
|
{% endif %}
|
|
167
187
|
|
|
168
188
|
{# HACK HACK HACK -- typealiases MUST BE top-level #}
|
|
@@ -20,12 +20,12 @@ Jinja2 template is not. Please file bugs! #}
|
|
|
20
20
|
#[serde(deny_unknown_fields)]
|
|
21
21
|
pub struct {{ name }} {
|
|
22
22
|
{% for itemname, val in struct.properties.items() %}
|
|
23
|
-
{% if val.type == "
|
|
23
|
+
{% if val.type == "array" %}
|
|
24
|
+
#[serde(skip_serializing_if = "Vec::is_empty", default = "Vec::new")]
|
|
25
|
+
pub {{itemname|snake_case}}: {{ name ~ itemname|Camelize }},
|
|
26
|
+
{% elif val.type == "object" %}
|
|
24
27
|
#[serde(skip_serializing_if = "Option::is_none")]
|
|
25
28
|
pub {{itemname|snake_case}}: Option<{{ name ~ "Item" ~ itemname|Camelize ~ "Object" }}>,
|
|
26
|
-
{% elif val.type == "array" %}
|
|
27
|
-
#[serde(skip_serializing_if = "Vec::is_empty", default = "Vec::new")]
|
|
28
|
-
pub {{itemname|snake_case}}: {{ name ~ "Item" ~ itemname|Camelize }},
|
|
29
29
|
{% else %}
|
|
30
30
|
#[serde(skip_serializing_if = "Option::is_none")]
|
|
31
31
|
pub {{itemname|snake_case}}: Option<{{val.type|structure_type_name}}>,
|
|
@@ -35,7 +35,7 @@ Jinja2 template is not. Please file bugs! #}
|
|
|
35
35
|
|
|
36
36
|
{% for itemname, val in struct.properties.items() %}
|
|
37
37
|
{% if val.type == "array" %}
|
|
38
|
-
{% set nested_name = name ~
|
|
38
|
+
{% set nested_name = name ~ itemname|Camelize %}
|
|
39
39
|
{{ generate_structure(nested_name, val) }}
|
|
40
40
|
{% elif val.type == "object" %}
|
|
41
41
|
{% set nested_name = name ~ "Item" ~ itemname|Camelize ~ "Object" %}
|
|
@@ -80,6 +80,16 @@ impl ExtraKeys for {{ obj.name|Camelize }}{{ suffix }} {
|
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
{% endmacro %}
|
|
83
|
+
{% macro common_metric_data(obj) %}
|
|
84
|
+
CommonMetricData {
|
|
85
|
+
category: {{ obj.category|rust }},
|
|
86
|
+
name: {{ obj.name|rust }},
|
|
87
|
+
send_in_pings: {{ obj.send_in_pings|rust }},
|
|
88
|
+
lifetime: {{ obj.lifetime|rust }},
|
|
89
|
+
disabled: {{ obj.is_disabled()|rust }},
|
|
90
|
+
..Default::default()
|
|
91
|
+
}
|
|
92
|
+
{% endmacro %}
|
|
83
93
|
{% for category in categories %}
|
|
84
94
|
{% if category.contains_pings %}
|
|
85
95
|
{% for obj in category.objs.values() %}
|
|
@@ -92,7 +102,7 @@ pub static {{ obj.name|snake_case }}: ::glean::private::__export::Lazy<::glean::
|
|
|
92
102
|
{% else %}
|
|
93
103
|
pub mod {{ category.name|snake_case }} {
|
|
94
104
|
#[allow(unused_imports)] // HistogramType might be unusued, let's avoid warnings
|
|
95
|
-
use glean::{private::*, traits::ExtraKeys, traits::NoExtraKeys, CommonMetricData, HistogramType, Lifetime, TimeUnit, MemoryUnit};
|
|
105
|
+
use glean::{private::*, traits::ExtraKeys, traits::NoExtraKeys, CommonMetricData, HistogramType, LabeledMetricData, Lifetime, TimeUnit, MemoryUnit};
|
|
96
106
|
{% for obj in category.objs.values() %}
|
|
97
107
|
|
|
98
108
|
{% if obj|attr("_generate_structure") %}
|
|
@@ -107,15 +117,37 @@ pub mod {{ category.name|snake_case }} {
|
|
|
107
117
|
///
|
|
108
118
|
/// {{ obj.description|wordwrap() | replace('\n', '\n /// ') }}
|
|
109
119
|
pub static {{ obj.name|snake_case }}: ::glean::private::__export::Lazy<{{ obj|type_name }}> = ::glean::private::__export::Lazy::new(|| {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
120
|
+
let meta =
|
|
121
|
+
{% if obj.type == "labeled_custom_distribution" %}
|
|
122
|
+
LabeledMetricData::CustomDistribution {
|
|
123
|
+
cmd: {{ common_metric_data(obj)|indent(16) }}
|
|
124
|
+
{%- for arg_name in extra_metric_args if obj[arg_name] is defined and arg_name != 'allowed_extra_keys' -%}
|
|
125
|
+
, {{ arg_name }}: {{ obj[arg_name]|rust }}
|
|
126
|
+
{%- endfor -%}
|
|
127
|
+
};
|
|
128
|
+
{% elif obj.type == "labeled_memory_distribution" %}
|
|
129
|
+
LabeledMetricData::MemoryDistribution {
|
|
130
|
+
cmd: {{ common_metric_data(obj)|indent(16) }}
|
|
131
|
+
{%- for arg_name in extra_metric_args if obj[arg_name] is defined and arg_name != 'allowed_extra_keys' -%}
|
|
132
|
+
, {{ "unit" if arg_name == "memory_unit" else arg_name }}: {{ obj[arg_name]|rust }}
|
|
133
|
+
{%- endfor -%}
|
|
134
|
+
};
|
|
135
|
+
{% elif obj.type == "labeled_timing_distribution" %}
|
|
136
|
+
LabeledMetricData::TimingDistribution {
|
|
137
|
+
cmd: {{ common_metric_data(obj)|indent(16) }}
|
|
138
|
+
{%- for arg_name in extra_metric_args if obj[arg_name] is defined and arg_name != 'allowed_extra_keys' -%}
|
|
139
|
+
, {{ "unit" if arg_name == "time_unit" else arg_name }}: {{ obj[arg_name]|rust }}
|
|
140
|
+
{%- endfor -%}
|
|
141
|
+
};
|
|
142
|
+
{% elif obj.labeled %}
|
|
143
|
+
LabeledMetricData::Common {
|
|
144
|
+
cmd: {{common_metric_data(obj)|indent(16) }},
|
|
145
|
+
};
|
|
146
|
+
{% else %}
|
|
147
|
+
{{ common_metric_data(obj)|indent(12) }};
|
|
148
|
+
{% endif %}
|
|
149
|
+
{{ obj|ctor }}(meta
|
|
150
|
+
{%- for arg_name in extra_metric_args if not obj.labeled and obj[arg_name] is defined and arg_name != 'allowed_extra_keys' -%}
|
|
119
151
|
, {{ obj[arg_name]|rust }}
|
|
120
152
|
{%- endfor -%}
|
|
121
153
|
{{ ", " if obj.labeled else ")\n" }}
|
|
@@ -53,10 +53,10 @@ struct {{ obj.name|Camelize }}{{ suffix }}: EventExtras {
|
|
|
53
53
|
{%- elif struct.type == "object" -%}
|
|
54
54
|
struct {{ name }}: Codable, Equatable, ObjectSerialize {
|
|
55
55
|
{% for itemname, val in struct.properties.items() %}
|
|
56
|
-
{% if val.type == "
|
|
56
|
+
{% if val.type == "array" %}
|
|
57
|
+
var {{itemname|camelize|variable_name}}: {{ name ~ itemname|Camelize }} = []
|
|
58
|
+
{% elif val.type == "object" %}
|
|
57
59
|
var {{itemname|camelize|variable_name}}: {{ name ~ "Item" ~ itemname|Camelize ~ "Object" }}?
|
|
58
|
-
{% elif val.type == "array" %}
|
|
59
|
-
var {{itemname|camelize|variable_name}}: {{ name ~ "Item" ~ itemname|Camelize }}
|
|
60
60
|
{% else %}
|
|
61
61
|
var {{itemname|camelize|variable_name}}: {{val.type|structure_type_name}}?
|
|
62
62
|
{% endif %}
|
|
@@ -72,7 +72,7 @@ struct {{ obj.name|Camelize }}{{ suffix }}: EventExtras {
|
|
|
72
72
|
|
|
73
73
|
{% for itemname, val in struct.properties.items() %}
|
|
74
74
|
{% if val.type == "array" %}
|
|
75
|
-
{% set nested_name = name ~
|
|
75
|
+
{% set nested_name = name ~ itemname|Camelize %}
|
|
76
76
|
{{ generate_structure(nested_name, val) }}
|
|
77
77
|
{% elif val.type == "object" %}
|
|
78
78
|
{% set nested_name = name ~ "Item" ~ itemname|Camelize ~ "Object" %}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: glean_parser
|
|
3
|
-
Version: 14.
|
|
3
|
+
Version: 14.3.0
|
|
4
4
|
Summary: Parser tools for Mozilla's Glean telemetry
|
|
5
5
|
Home-page: https://github.com/mozilla/glean_parser
|
|
6
6
|
Author: The Glean Team
|
|
@@ -79,6 +79,12 @@ $ glean_parser check < ping.json
|
|
|
79
79
|
|
|
80
80
|
## Unreleased
|
|
81
81
|
|
|
82
|
+
## 14.3.0
|
|
83
|
+
|
|
84
|
+
- Add the `module_spec` option to the javascript_server outputter ([#726](https://github.com/mozilla/glean_parser/pull/726))
|
|
85
|
+
- BUGFIX: Fix the Rust codegen for changes to how `labeled_*` metrics are constructed ([bug 1909244](https://bugzilla.mozilla.org/show_bug.cgi?id=1909244))
|
|
86
|
+
- Generate a serializer for array wrappers ([bug 1908157](https://bugzilla.mozilla.org/show_bug.cgi?id=1908157))
|
|
87
|
+
|
|
82
88
|
## 14.2.0
|
|
83
89
|
|
|
84
90
|
- New Metric Types: `labeled_{custom|memory|timing}_distribution` ([bug 1657947](https://bugzilla.mozilla.org/show_bug.cgi?id=1657947))
|
|
@@ -487,11 +487,11 @@ def test_object_metric(tmp_path):
|
|
|
487
487
|
assert "data class ThreadsObject(" in content
|
|
488
488
|
assert "data class ThreadsObjectItem(" in content
|
|
489
489
|
assert (
|
|
490
|
-
"var frames:
|
|
490
|
+
"var frames: ThreadsObjectItemFrames = ThreadsObjectItemFrames"
|
|
491
491
|
in content
|
|
492
492
|
)
|
|
493
493
|
|
|
494
|
-
assert "data class
|
|
494
|
+
assert "data class ThreadsObjectItemFramesItem(" in content
|
|
495
495
|
assert "var moduleIndex: Int? = null," in content
|
|
496
496
|
assert "var ip: String? = null," in content
|
|
497
497
|
assert "var trust: String? = null," in content
|
|
@@ -276,13 +276,13 @@ def test_object_metric(tmp_path):
|
|
|
276
276
|
|
|
277
277
|
assert "ObjectMetric<ThreadsObject>" in content
|
|
278
278
|
assert "pub struct ThreadsObjectItem { " in content
|
|
279
|
-
assert "frames:
|
|
279
|
+
assert "frames: ThreadsObjectItemFrames, }" in content
|
|
280
280
|
assert (
|
|
281
|
-
"pub type
|
|
282
|
-
"Vec<
|
|
281
|
+
"pub type ThreadsObjectItemFrames = "
|
|
282
|
+
"Vec<ThreadsObjectItemFramesItem>;" in content
|
|
283
283
|
)
|
|
284
284
|
|
|
285
|
-
assert "pub struct
|
|
285
|
+
assert "pub struct ThreadsObjectItemFramesItem { " in content
|
|
286
286
|
assert "module_index: Option<i64>, " in content
|
|
287
287
|
assert "ip: Option<String>, " in content
|
|
288
288
|
assert "trust: Option<String>, " in content
|
|
@@ -370,11 +370,11 @@ def test_object_metric(tmp_path):
|
|
|
370
370
|
assert "typealias ThreadsObject = [ThreadsObjectItem]" in content
|
|
371
371
|
assert "struct ThreadsObjectItem: Codable, Equatable, ObjectSerialize {" in content
|
|
372
372
|
assert (
|
|
373
|
-
"var frames:
|
|
373
|
+
"var frames: ThreadsObjectItemFrames"
|
|
374
374
|
in content
|
|
375
375
|
)
|
|
376
376
|
|
|
377
|
-
assert "struct
|
|
377
|
+
assert "struct ThreadsObjectItemFramesItem: Codable, Equatable, ObjectSerialize {" in content
|
|
378
378
|
assert "var moduleIndex: Int64?" in content
|
|
379
379
|
assert "var ip: String?" in content
|
|
380
380
|
assert "var trust: String?" in content
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{glean_parser-14.2.0 → glean_parser-14.3.0}/glean_parser/templates/javascript.buildinfo.jinja2
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{glean_parser-14.2.0 → glean_parser-14.3.0}/tests/data/server_metrics_no_events_no_pings.yaml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|