Matteo Scandolo | a8bd93e | 2018-09-13 13:36:50 -0700 | [diff] [blame] | 1 | // Copyright 2018 Open Networking Foundation |
| 2 | // |
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | // you may not use this file except in compliance with the License. |
| 5 | // 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 |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | // See the License for the specific language governing permissions and |
| 13 | // limitations under the License. |
| 14 | |
| 15 | package main |
| 16 | |
Ganesh Bhure | 8d0c994 | 2019-05-24 11:42:09 +0530 | [diff] [blame] | 17 | // configuration |
| 18 | type BrokerInfo struct { |
| 19 | Name string `yaml: name` |
| 20 | Host string `yaml: host` |
| 21 | Description string `yaml: description` |
| 22 | Topics []string `yaml: topics` |
| 23 | } |
Matteo Scandolo | a8bd93e | 2018-09-13 13:36:50 -0700 | [diff] [blame] | 24 | |
Ganesh Bhure | 8d0c994 | 2019-05-24 11:42:09 +0530 | [diff] [blame] | 25 | type LoggerInfo struct { |
| 26 | LogLevel string `yaml: loglevel` |
| 27 | Host string `yaml: host` |
| 28 | } |
| 29 | |
| 30 | type TargetInfo struct { |
| 31 | Type string `yaml: type` |
| 32 | Name string `yaml: name` |
| 33 | Port int `yaml: port` |
| 34 | Description string `yaml: description` |
| 35 | } |
| 36 | |
| 37 | type Config struct { |
| 38 | Broker BrokerInfo `yaml: broker` |
| 39 | Logger LoggerInfo `yaml: logger` |
| 40 | Target TargetInfo `yaml: "target"` |
| 41 | } |
| 42 | |
| 43 | // KPI Events format |
Matteo Scandolo | a8bd93e | 2018-09-13 13:36:50 -0700 | [diff] [blame] | 44 | type Metrics struct { |
| 45 | TxBytes float64 `json:"tx_bytes"` |
| 46 | TxPackets float64 `json:"tx_packets"` |
| 47 | TxErrorPackets float64 `json:"tx_error_packets"` |
| 48 | TxBcastPackets float64 `json:"tx_bcast_packets"` |
| 49 | TxUnicastPackets float64 `json:"tx_ucast_packets"` |
| 50 | TxMulticastPackets float64 `json:"tx_mcast_packets"` |
| 51 | RxBytes float64 `json:"rx_bytes"` |
| 52 | RxPackets float64 `json:"rx_packets"` |
| 53 | RxErrorPackets float64 `json:"rx_error_packets"` |
| 54 | RxBcastPackets float64 `json:"rx_bcast_packets"` |
| 55 | RxMulticastPackets float64 `json:"rx_mcast_packets"` |
Scott Baker | e8537af | 2018-10-22 14:53:44 -0700 | [diff] [blame] | 56 | |
| 57 | // ONU Ethernet_Bridge_Port_history |
| 58 | Packets float64 `json:"packets"` |
| 59 | Octets float64 `json:"octets"` |
Matteo Scandolo | a8bd93e | 2018-09-13 13:36:50 -0700 | [diff] [blame] | 60 | } |
| 61 | |
| 62 | type Context struct { |
| 63 | InterfaceID string `json:"intf_id"` |
| 64 | PonID string `json:"pon_id"` |
| 65 | PortNumber string `json:"port_no"` |
Scott Baker | e8537af | 2018-10-22 14:53:44 -0700 | [diff] [blame] | 66 | |
| 67 | // ONU Performance Metrics |
| 68 | ParentClassId string `json:"parent_class_id"` |
| 69 | ParentEntityId string `json:"parent_entity_id"` |
| 70 | Upstream string `json:"upstream"` |
Matteo Scandolo | a8bd93e | 2018-09-13 13:36:50 -0700 | [diff] [blame] | 71 | } |
| 72 | |
| 73 | type Metadata struct { |
| 74 | LogicalDeviceID string `json:"logical_device_id"` |
| 75 | Title string `json:"title"` |
| 76 | SerialNumber string `json:"serial_no"` |
| 77 | Timestamp float64 `json:"ts"` |
| 78 | DeviceID string `json:"device_id"` |
| 79 | Context *Context `json:"context"` |
| 80 | } |
| 81 | |
| 82 | type SliceData struct { |
| 83 | Metrics *Metrics `json:"metrics"` |
| 84 | Metadata *Metadata `json:"metadata"` |
| 85 | } |
| 86 | |
Matteo Scandolo | aab36db | 2018-10-09 19:54:11 -0700 | [diff] [blame] | 87 | type VolthaKPI struct { |
Matteo Scandolo | a8bd93e | 2018-09-13 13:36:50 -0700 | [diff] [blame] | 88 | Type string `json:"type"` |
| 89 | Timestamp float64 `json:"ts"` |
| 90 | SliceDatas []*SliceData `json:"slice_data"` |
| 91 | } |
Matteo Scandolo | aab36db | 2018-10-09 19:54:11 -0700 | [diff] [blame] | 92 | |
| 93 | type OnosPort struct { |
| 94 | PortID string `json:"portId"` |
| 95 | RxPackets float64 `json:"pktRx"` |
| 96 | TxPackets float64 `json:"pktTx"` |
| 97 | RxBytes float64 `json:"bytesRx"` |
| 98 | TxBytes float64 `json:"bytesTx"` |
| 99 | RxPacketsDrop float64 `json:"pktRxDrp"` |
| 100 | TxPacketsDrop float64 `json:"pktTxDrp"` |
| 101 | } |
| 102 | |
| 103 | type OnosKPI struct { |
| 104 | DeviceID string `json:"deviceId"` |
| 105 | Ports []*OnosPort `json:"ports"` |
| 106 | } |
Ganesh Bhure | 8d0c994 | 2019-05-24 11:42:09 +0530 | [diff] [blame] | 107 | |
| 108 | type ImporterKPI struct { |
| 109 | DeviceID string `json: "deviceId"` |
| 110 | // TODO: add metrics data |
kartikey dubey | 72ef3b8 | 2019-05-27 06:50:04 +0000 | [diff] [blame^] | 111 | } |
| 112 | |
| 113 | type OnosAaaKPI struct { |
| 114 | RxAcceptResponses float64 `json:"acceptResponsesRx"` |
| 115 | RxRejectResponses float64 `json:"rejectResponsesRx"` |
| 116 | RxChallengeResponses float64 `json:"challengeResponsesRx"` |
| 117 | TxAccessRequests float64 `json:"accessRequestsTx"` |
| 118 | RxInvalidValidators float64 `json:"invalidValidatorsRx"` |
| 119 | RxUnknownType float64 `json:"unknownTypeRx"` |
| 120 | PendingRequests float64 `json:"pendingRequests"` |
| 121 | RxDroppedResponses float64 `json:"droppedResponsesRx"` |
| 122 | RxMalformedResponses float64 `json:"malformedResponsesRx"` |
| 123 | RxUnknownserver float64 `json:"unknownServerRx"` |
| 124 | RequestRttMillis float64 `json:"requestRttMillis"` |
| 125 | RequestReTx float64 `json:"requestReTx"` |
| 126 | } |