2323 methods
2424 function obj = View(options )
2525 arguments
26- options.name = " "
27- options.description = " "
28- options.unit = " "
29- options.instrumentName = " "
30- options.instrumentType = " "
31- options.meterName = " "
32- options.meterVersion = " "
33- options.meterSchemaURL = " "
34- options.attributeKeys = " "
35- options.aggregation = " "
36- options.histogramBinEdges = []
26+ options.Name = " "
27+ options.Description = " "
28+ options.Unit = " "
29+ options.InstrumentName = " "
30+ options.InstrumentType = " "
31+ options.MeterName = " "
32+ options.MeterVersion = " "
33+ options.MeterSchemaURL = " "
34+ options.AttributeKeys = " "
35+ options.Aggregation = " "
36+ options.HistogramBinEdges = []
3737 end
3838
39- instrumentTypeCategory = int32(find(options .instrumentType ==[" kCounter" , " kHistogram" , " kUpDownCounter" , " kObservableCounter" , " kObservableGauge" , " kObservableUpDownCounter" ])-1 );
39+ instrument_types = [" Counter" , " Histogram" , " UpDownCounter" , " ObservableCounter" , " ObservableGauge" , " ObservableUpDownCounter" ];
40+ instrument_type = validatestring(options .InstrumentType , instrument_types );
41+ instrumentTypeCategory = find(instrument_type == instrument_types )-1 ;
4042
41- aggregationCategory = int32(find(options .aggregation ==[" kDrop" , " kHistogram" , " kLastValue" , " kSum" , " kDefault" ])-1 );
42-
43- if (numel(instrumentTypeCategory )==0 )
44- instrumentTypeCategory = int32(-1 );
45- end
46- if (numel(aggregationCategory )==0 )
47- aggregationCategory = int32(-1 );
48- end
43+ aggregation_types = [" Drop" , " Histogram" , " LastValue" , " Sum" , " Default" ];
44+ aggregation_type = validatestring(options .Aggregation , aggregation_types );
45+ aggregationCategory = find(aggregation_type == aggregation_types )-1 ;
4946
5047 obj.Proxy = libmexclass .proxy .Proxy(" Name" , " libmexclass.opentelemetry.sdk.ViewProxy" , ...
51- " ConstructorArguments" , {options .name , options .description , options .unit , options .instrumentName , ...
52- instrumentTypeCategory , options .meterName , options .meterVersion , options .meterSchemaURL , ...
53- options .attributeKeys , aggregationCategory , options .histogramBinEdges });
48+ " ConstructorArguments" , {options .Name , options .Description , options .Unit , options .InstrumentName , ...
49+ instrumentTypeCategory , options .MeterName , options .MeterVersion , options .MeterSchemaURL , ...
50+ options .AttributeKeys , aggregationCategory , options .HistogramBinEdges });
5451
55- obj.Name = options .name ;
56- obj.Description = options .description ;
57- obj.Unit = options .unit ;
58- obj.InstrumentName = options .instrumentName ;
59- obj.InstrumentType = options .instrumentType ;
60- obj.MeterName = options .meterName ;
61- obj.MeterVersion = options .meterVersion ;
62- obj.MeterSchemaURL = options .meterSchemaURL ;
63- obj.AttributeKeys = options .attributeKeys ;
64- obj.Aggregation = options .aggregation ;
65- obj.HistogramBinEdges = options .histogramBinEdges ;
52+ obj.Name = options .Name ;
53+ obj.Description = options .Description ;
54+ obj.Unit = options .Unit ;
55+ obj.InstrumentName = options .InstrumentName ;
56+ obj.InstrumentType = options .InstrumentType ;
57+ obj.MeterName = options .MeterName ;
58+ obj.MeterVersion = options .MeterVersion ;
59+ obj.MeterSchemaURL = options .MeterSchemaURL ;
60+ obj.AttributeKeys = options .AttributeKeys ;
61+ obj.Aggregation = options .Aggregation ;
62+ obj.HistogramBinEdges = options .HistogramBinEdges ;
6663 end
6764 end
6865end
0 commit comments