Skip to content

Commit

Permalink
Merge pull request #110 from Dexterp37/memory_dist_fixup
Browse files Browse the repository at this point in the history
Pass `memory_unit` to the MemoryDistributionMetricType in Kotlin
  • Loading branch information
mdboom authored Sep 27, 2019
2 parents 3c80345 + fc0a4fc commit a5160c4
Show file tree
Hide file tree
Showing 14 changed files with 41 additions and 0 deletions.
2 changes: 2 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ History
Unreleased
----------

* BUGFIX: `memory_unit` is now passed to the Kotlin generator.

1.8.0 (2019-09-26)
------------------

Expand Down
1 change: 1 addition & 0 deletions glean_parser/kotlin.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ def output_kotlin(objs, output_dir, options={}):
"histogram_type",
"include_client_id",
"lifetime",
"memory_unit",
"name",
"range_max",
"range_min",
Expand Down
4 changes: 4 additions & 0 deletions glean_parser/parser.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# -*- coding: utf-8 -*-

# 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/.

"""
Code for parsing metrics.yaml files.
"""
Expand Down
4 changes: 4 additions & 0 deletions glean_parser/schemas/metrics.1-0-0.schema.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 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/.

$schema: http://json-schema.org/draft-07/schema#
title: Metrics
description: |
Expand Down
4 changes: 4 additions & 0 deletions glean_parser/schemas/pings.1-0-0.schema.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 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/.

$schema: http://json-schema.org/draft-07/schema#
title: Pings
description: |
Expand Down
3 changes: 3 additions & 0 deletions tests/data/core.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Any copyright is dedicated to the Public Domain.
# https://creativecommons.org/publicdomain/zero/1.0/

$schema: moz://mozilla.org/schemas/glean/metrics/1-0-0

telemetry:
Expand Down
3 changes: 3 additions & 0 deletions tests/data/duplicate_labeled.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Any copyright is dedicated to the Public Domain.
# https://creativecommons.org/publicdomain/zero/1.0/

$schema: moz://mozilla.org/schemas/glean/metrics/1-0-0

category:
Expand Down
3 changes: 3 additions & 0 deletions tests/data/duplicate_send_in_ping.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Any copyright is dedicated to the Public Domain.
# https://creativecommons.org/publicdomain/zero/1.0/

$schema: moz://mozilla.org/schemas/glean/metrics/1-0-0

telemetry:
Expand Down
2 changes: 2 additions & 0 deletions tests/data/empty.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Any copyright is dedicated to the Public Domain.
# https://creativecommons.org/publicdomain/zero/1.0/
3 changes: 3 additions & 0 deletions tests/data/gecko.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Any copyright is dedicated to the Public Domain.
# https://creativecommons.org/publicdomain/zero/1.0/

$schema: moz://mozilla.org/schemas/glean/metrics/1-0-0

page.perf:
Expand Down
3 changes: 3 additions & 0 deletions tests/data/invalid.yaml
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
# Any copyright is dedicated to the Public Domain.
# https://creativecommons.org/publicdomain/zero/1.0/

!!! THIS ISN'T YAML !!!
3 changes: 3 additions & 0 deletions tests/data/pings.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Any copyright is dedicated to the Public Domain.
# https://creativecommons.org/publicdomain/zero/1.0/

$schema: moz://mozilla.org/schemas/glean/pings/1-0-0

custom_ping:
Expand Down
3 changes: 3 additions & 0 deletions tests/data/schema-violation.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Any copyright is dedicated to the Public Domain.
# https://creativecommons.org/publicdomain/zero/1.0/

$schema: moz://mozilla.org/schemas/glean/metrics/1-0-0
gleantest.foo:
a: b
Expand Down
3 changes: 3 additions & 0 deletions tests/data/smaller.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Any copyright is dedicated to the Public Domain.
# https://creativecommons.org/publicdomain/zero/1.0/

$schema: moz://mozilla.org/schemas/glean/metrics/1-0-0

telemetry:
Expand Down

0 comments on commit a5160c4

Please sign in to comment.