Skip to main content

MetricType

The type of Metric
Defines the MetricValueType and the applicable Units

Properties

PropertyTypeDescription
IdstringThe id
LabelstringThe textual label
Descriptionstring?An optional textual description
Iconstring?An optional icon id (registered Icon)
ValueTypeMetricValueTypeThe MetricValueType a value of this type must conform to
BaseUnitUnit?The optional base Unit in which values of this type must be returned in
UnitsIEnumerable<Unit>?A list of Units the BaseUnit can be converted to

MetricValueType

A MetricType must always specify a MetricValueType.
This value type imposes certain restrictions on the acceptable values a Metric of this type will accept.

TypeAccepted value
CustomA custom value
(currently not supported!)
Stringstring
Numericnumber
DurationISO 8601 duration string or C# TimeSpan object
DateTimeISO 8601 date + time string or C# DateTime/DateTimeOffset object
DateOnlyISO 8601 date string or C# DateOnly object
TimeOnlyISO 8601 time string or C# TimeOnly object
ResourceId of a registered external resource (icon, image..)
Currencynumber
note

When updating a numerical MetricValue, the value must be provided in the base unit as defined by the metrics MetricType to ensure correct unit conversions

CoreMetricType

Certain common metric types are already provided by the SDK and automatically registered by the MoBro data service.
These types already include the most commonly used units, according conversion formulas and translations for all languages currently supported by MoBro.

tip

Prefer using core metric types over custom types wherever applicable. You will automatically benefit whenever additional units or supported languages are added in the future, without having to change any code yourself or the need to publish a new plugin version

TypeBase unitMetricValueTypeDescription
ElectricCurrentAmpereNumericElectric current
ElectricPotentialVoltNumericElectric potential difference
ElectricResistanceOhmNumericElectric resistance
DataFlowBit per secondNumericBitrate
DataBytesNumericCapacity of data
DurationSecondsDurationThe amount of time elapsed between two events
FrequencyHertzNumericNumber of occurrences of a repeating event per unit of time
MultiplierxNumericA multiplier
Numeric-NumericA simple numeric value
PowerWattNumericElectric power
RotationRotations per minuteNumericRotational Speed
Temperaturedegree CelsiusNumericTemperature
Text-StringA simple text value
UsagePercentageNumericUtilization indication
PressurePascalNumericApplied force on a surface
VolumeCubic metreNumericA measure of occupied space in 3D
VolumeFlowCubic metre per secondNumericVolume which passes per unit of time
DateTime-DateTimeA date and time
LengthMetresNumericA measure of distance
SpeedMetres per secondNumericDistance travelled per unit of time
MassKilogramNumericThe quantity of matter of a physical body
AreaSquare meterNumericQuantity to express the extent of a region
Date-DateOnlyA date without the time component
Time-TimeOnlyA time without the date component
Icon-ResourceAn icon
Image-ResourceAn image
AngledegreesNumericAn angle

CoreMetricTypeCurrency

There are also dedicated core types for the Currency MetricValueType provided by the SDK and automatically registered by the MoBro data service.
These currency types are already well-defined with the appropriate label, description, currency symbol and translations for all currently supported languages by MoBro.

CoreTypeCurrency
AUDAustralian dollar
AZNAzerbaijani manat
BAMBosnia and Herzegovina convertible mark
BGNBulgarian lev
CADCanadian dollar
CHFSwiss franc
CNYRenminbi
CZKCzech koruna
DKKDanish krone
EUREuro
GBPPound sterling
GELGeorgian lari
HUFHungarian forint
INRIndian rupee
ISKIcelandic króna
JPYJapanese yen
MDLMoldovan leu
MKDMacedonian denar
NOKNorwegian krone
PLNPolish złoty
RONRomanian leu
RSDSerbian dinar
SEKSwedish krona
TRYTurkish lira
UAHUkrainian hryvnia
USDUnited States dollar

Custom types

In case there's no fitting core type for a metric, a custom MetricType can be created by the plugin and registered like any other IMoBroItems.

note

When registering a custom MetricType of MetricValueType Currency, the label must be a 3 character currency code according to ISO 4217

Unit

A unit to present the value of a Metric in (e.g. degrees Celsius for temperature)
A unit always belongs to a specific MetricType

Properties

PropertyTypeDescription
LabelstringThe name of the unit
AbbreviationstringThe units abbreviation
Descriptionstring?An optional textual description
FromBaseFormulastringThe formula to apply to derive this unit from the base unit of its MetricType (e.g. x*10)
ToBaseFormulastringThe formula to apply to convert this unit into the base unit of its MetricType (e.g.: x/10)