|
27 | 27 |
|
28 | 28 |
|
29 | 29 | class View:
|
30 |
| - def __init__( |
31 |
| - self, |
32 |
| - instrument_type: Optional[Type[Instrument]] = None, |
33 |
| - instrument_name: Optional[str] = None, |
34 |
| - meter_name: Optional[str] = None, |
35 |
| - meter_version: Optional[str] = None, |
36 |
| - meter_schema_url: Optional[str] = None, |
37 |
| - name: Optional[str] = None, |
38 |
| - description: Optional[str] = None, |
39 |
| - attribute_keys: Optional[Set[str]] = None, |
40 |
| - aggregation: Optional[_AggregationFactory] = None, |
41 |
| - ): |
42 |
| - """ |
43 |
| - A `View` configuration parameters can be used for the following |
44 |
| - purposes: |
| 30 | + """ |
| 31 | + A `View` configuration parameters can be used for the following |
| 32 | + purposes: |
45 | 33 |
|
46 |
| - 1. Match instruments: When an instrument matches a view, measurements |
47 |
| - received by that instrument will be processed. |
48 |
| - 2. Customize metric streams: A metric stream is identified by a match |
49 |
| - between a view and an instrument and a set of attributes. The metric |
50 |
| - stream can be customized by certain attributes of the corresponding |
51 |
| - view. |
| 34 | + 1. Match instruments: When an instrument matches a view, measurements |
| 35 | + received by that instrument will be processed. |
| 36 | + 2. Customize metric streams: A metric stream is identified by a match |
| 37 | + between a view and an instrument and a set of attributes. The metric |
| 38 | + stream can be customized by certain attributes of the corresponding view. |
52 | 39 |
|
53 |
| - The attributes documented next serve one of the previous two purposes. |
| 40 | + The attributes documented next serve one of the previous two purposes. |
54 | 41 |
|
55 |
| - Args: |
56 |
| - instrument_type: This is an instrument matching attribute: the |
57 |
| - class the instrument must be to match the view. |
| 42 | + Args: |
| 43 | + instrument_type: This is an instrument matching attribute: the class the |
| 44 | + instrument must be to match the view. |
58 | 45 |
|
59 |
| - instrument_name: This is an instrument matching attribute: the name |
60 |
| - the instrument must have to match the view. Wild card |
61 |
| - characters are supported. Wild card characters should not be |
62 |
| - used with this attribute if the view has also a |
63 |
| - ``name`` defined. |
| 46 | + instrument_name: This is an instrument matching attribute: the name the |
| 47 | + instrument must have to match the view. Wild card characters are |
| 48 | + supported. Wild card characters should not be used with this |
| 49 | + attribute if the view has also a ``name`` defined. |
64 | 50 |
|
65 |
| - meter_name: This is an instrument matching attribute: the name |
66 |
| - the instrument meter must have to match the view. |
| 51 | + meter_name: This is an instrument matching attribute: the name the |
| 52 | + instrument meter must have to match the view. |
67 | 53 |
|
68 |
| - meter_version : This is an instrument matching attribute: the |
69 |
| - version the instrument meter must have to match the view. |
| 54 | + meter_version : This is an instrument matching attribute: the version |
| 55 | + the instrument meter must have to match the view. |
70 | 56 |
|
71 |
| - meter_schema URL : This is an instrument matching attribute: the |
72 |
| - schema URL the instrument meter must have to match the view. |
| 57 | + meter_schema URL : This is an instrument matching attribute: the schema |
| 58 | + URL the instrument meter must have to match the view. |
73 | 59 |
|
74 |
| - name: This is a metric stream customizing attribute: the name of |
75 |
| - the metric stream. If `None`, the name of the instrument will |
76 |
| - be used. |
| 60 | + name: This is a metric stream customizing attribute: the name of the |
| 61 | + metric stream. If `None`, the name of the instrument will be used. |
77 | 62 |
|
78 |
| - description: This is a metric stream customizing attribute: the |
79 |
| - description of the metric stream. If `None`, the description of |
80 |
| - the instrument will be used. |
| 63 | + description: This is a metric stream customizing attribute: the |
| 64 | + description of the metric stream. If `None`, the description of the |
| 65 | + instrument will be used. |
81 | 66 |
|
82 |
| - attribute_keys: This is a metric stream customizing attribute: this |
83 |
| - is a set of attribute keys. If not `None` then only the |
84 |
| - measurement attributes that are in `attribute_keys` will be |
85 |
| - used to identify the metric stream. |
| 67 | + attribute_keys: This is a metric stream customizing attribute: this is |
| 68 | + a set of attribute keys. If not `None` then only the measurement |
| 69 | + attributes that are in `attribute_keys` will be used to identify the |
| 70 | + metric stream. |
86 | 71 |
|
87 |
| - aggregation: This is a metric stream customizing attribute: the |
88 |
| - aggregatation instance to use when data is aggregated for the |
89 |
| - corresponding metrics stream. If `None` the default aggregation |
90 |
| - of the instrument will be used. |
| 72 | + aggregation: This is a metric stream customizing attribute: the |
| 73 | + aggregatation instance to use when data is aggregated for the |
| 74 | + corresponding metrics stream. If `None` the default aggregation of |
| 75 | + the instrument will be used. |
91 | 76 |
|
92 |
| - This class is not intended to be subclassed by the user. |
93 |
| - """ |
| 77 | + This class is not intended to be subclassed by the user. |
| 78 | + """ |
94 | 79 |
|
| 80 | + def __init__( |
| 81 | + self, |
| 82 | + instrument_type: Optional[Type[Instrument]] = None, |
| 83 | + instrument_name: Optional[str] = None, |
| 84 | + meter_name: Optional[str] = None, |
| 85 | + meter_version: Optional[str] = None, |
| 86 | + meter_schema_url: Optional[str] = None, |
| 87 | + name: Optional[str] = None, |
| 88 | + description: Optional[str] = None, |
| 89 | + attribute_keys: Optional[Set[str]] = None, |
| 90 | + aggregation: Optional[_AggregationFactory] = None, |
| 91 | + ): |
95 | 92 | if (
|
96 | 93 | instrument_type
|
97 | 94 | is instrument_name
|
|
0 commit comments