|
2 | 2 | % A Meter creates metric instruments, capturing measurements about a service at runtime. |
3 | 3 | % Meters are created from Meter Providers. |
4 | 4 |
|
5 | | - % Copyright 2023-2024 The MathWorks, Inc. |
| 5 | + % Copyright 2023-2025 The MathWorks, Inc. |
6 | 6 |
|
7 | 7 | properties (SetAccess=immutable) |
8 | 8 | Name (1,1) string % Meter name |
|
38 | 38 | % C = CREATECOUNTER(M, NAME, DESCRIPTION, UNIT) also |
39 | 39 | % specifies a description and a unit. |
40 | 40 | % |
41 | | - % See also CREATEUPDOWNCOUNTER, CREATEHISTOGRAM, |
| 41 | + % See also CREATEUPDOWNCOUNTER, CREATEHISTOGRAM, CREATEGAUGE, |
42 | 42 | % CREATEOBSERVABLECOUNTER |
43 | 43 | arguments |
44 | 44 | obj |
|
64 | 64 | % C = CREATEUPDOWNCOUNTER(M, NAME, DESCRIPTION, UNIT) also |
65 | 65 | % specifies a description and a unit. |
66 | 66 | % |
67 | | - % See also CREATECOUNTER, CREATEHISTOGRAM, |
| 67 | + % See also CREATECOUNTER, CREATEHISTOGRAM, CREATEGAUGE, |
68 | 68 | % CREATEOBSERVABLEUPDOWNCOUNTER |
69 | 69 | arguments |
70 | 70 | obj |
|
91 | 91 | % H = CREATEHISTOGRAM(M, NAME, DESCRIPTION, UNIT) also |
92 | 92 | % specifies a description and a unit. |
93 | 93 | % |
94 | | - % See also CREATECOUNTER, CREATEUPDOWNCOUNTER, |
| 94 | + % See also CREATECOUNTER, CREATEUPDOWNCOUNTER, CREATEGAUGE, |
95 | 95 | % OPENTELEMETRY.SDK.METRICS.VIEW |
96 | 96 | arguments |
97 | 97 | obj |
98 | 98 | name |
99 | 99 | description = "" |
100 | 100 | unit = "" |
101 | | - end |
| 101 | + end |
102 | 102 |
|
103 | 103 | [name, description, unit] = processSynchronousInputs(name, ... |
104 | 104 | description, unit); |
|
108 | 108 | histogram = opentelemetry.metrics.Histogram(HistogramProxy, name, description, unit); |
109 | 109 | end |
110 | 110 |
|
| 111 | + function gauge = createGauge(obj, name, description, unit) |
| 112 | + % CREATEGAUGE Create a gauge |
| 113 | + % G = CREATEGAUGE(M, NAME) creates a gauge |
| 114 | + % with the specified name. A gauge's value can increase or |
| 115 | + % decrease but it should never be summed in aggregation. |
| 116 | + % |
| 117 | + % G = CREATEGAUGE(M, NAME, DESCRIPTION, UNIT) also |
| 118 | + % specifies a description and a unit. |
| 119 | + % |
| 120 | + % See also CREATECOUNTER, CREATEUPDOWNCOUNTER, CREATEHISTOGRAM, |
| 121 | + % CREATEOBSERVABLEGAUGE |
| 122 | + arguments |
| 123 | + obj |
| 124 | + name |
| 125 | + description = "" |
| 126 | + unit = "" |
| 127 | + end |
| 128 | + |
| 129 | + [name, description, unit] = processSynchronousInputs(name, ... |
| 130 | + description, unit); |
| 131 | + id = obj.Proxy.createGauge(name, description, unit); |
| 132 | + GaugeProxy = libmexclass.proxy.Proxy("Name", ... |
| 133 | + "libmexclass.opentelemetry.GaugeProxy", "ID", id); |
| 134 | + gauge = opentelemetry.metrics.Gauge(GaugeProxy, name, description, unit); |
| 135 | + end |
| 136 | + |
111 | 137 | function obscounter = createObservableCounter(obj, callback, name, ... |
112 | 138 | description, unit, timeout) |
113 | 139 | % CREATEOBSERVABLECOUNTER Create an observable counter |
|
205 | 231 | % positive duration scalar. |
206 | 232 | % |
207 | 233 | % See also OPENTELEMETRY.METRICS.OBSERVABLERESULT, |
208 | | - % CREATEOBSERVABLECOUNTER, CREATEOBSERVABLEUPDOWNCOUNTER |
| 234 | + % CREATEGAUGE, CREATEOBSERVABLECOUNTER, CREATEOBSERVABLEUPDOWNCOUNTER |
209 | 235 | arguments |
210 | 236 | obj |
211 | 237 | callback |
|
0 commit comments