dev.azure.com/aidainnovazione0090/DeviceManager/_git/go-mod-core-contracts@v1.0.2/dtos/telemetry.go (about) 1 /******************************************************************************* 2 * Copyright 2022 Intel Corp. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 * in compliance with the License. You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software distributed under the License 10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 * or implied. See the License for the specific language governing permissions and limitations under 12 * the License. 13 *******************************************************************************/ 14 package dtos 15 16 import ( 17 "dev.azure.com/aidainnovazione0090/DeviceManager/_git/go-mod-core-contracts/dtos/common" 18 ) 19 20 // Metric defines the metric data for a specific named metric 21 type Telemetry struct { 22 MessageId string `json:"messageId,omitempty"` 23 Code string `json:"code,omitempty"` 24 // Timestamp is the time and date the metric was collected. 25 Timestamp int64 `json:"timestamp" validate:"required"` 26 HeartRate int `json:"heartRate,omitempty"` 27 common.Versionable `json:",inline"` 28 // Name is the identifier of the collected Metric 29 Name string `json:"name" validate:"edgex-dto-none-empty-string"` 30 Source string `json:"source,omitempty"` 31 // Fields are the Key/Value measurements associated with the metric 32 Fields []MetricField `json:"fields,omitempty" validate:"required"` 33 // Tags and the Key/Value tags associated with the metric 34 Tags []MetricTag `json:"tags,omitempty"` 35 }