-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add metrics to the context of non-scoped codegen (#270)
- Loading branch information
Showing
6 changed files
with
86 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
semantic-conventions/src/tests/data/jinja/metrics/expected_metrics.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
class AllMetrics { | ||
/** | ||
* first metric description | ||
* Unit: {one} | ||
* Instrument: counter | ||
* Experimental: False | ||
*/ | ||
public static final String FIRST_METRIC = "first.metric"; | ||
/** | ||
* second metric description | ||
* Unit: s | ||
* Instrument: histogram | ||
* Experimental: True | ||
*/ | ||
public static final String SECOND_GROUP_METRIC = "second_group.metric"; | ||
} |
11 changes: 11 additions & 0 deletions
11
semantic-conventions/src/tests/data/jinja/metrics/metrics_template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
class AllMetrics { | ||
{%- for metric in metrics %} | ||
/** | ||
* {{metric.brief | to_doc_brief}} | ||
* Unit: {{ metric.unit }} | ||
* Instrument: {{ metric.instrument }} | ||
* Experimental: {{ metric | is_experimental }} | ||
*/ | ||
public static final String {{ metric.metric_name | to_const_name }} = "{{metric.metric_name}}"; | ||
{%- endfor %} | ||
} |
30 changes: 30 additions & 0 deletions
30
semantic-conventions/src/tests/data/yaml/metrics/metrics.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
groups: | ||
- id: first_group_id | ||
type: attribute_group | ||
brief: first description | ||
prefix: first | ||
attributes: | ||
- id: attr_one | ||
type: boolean | ||
brief: short description of attr_one | ||
|
||
- id: first_metric_id | ||
brief: first metric description | ||
metric_name: first.metric | ||
instrument: counter | ||
type: metric | ||
unit: "{one}" | ||
stability: stable | ||
extends: first_group_id | ||
|
||
- id: second_group_id | ||
brief: second metric description | ||
metric_name: second_group.metric | ||
type: metric | ||
instrument: histogram | ||
unit: "s" | ||
prefix: second_group | ||
attributes: | ||
- id: attr_two | ||
type: int | ||
brief: short description of attr_two |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters