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 | |
| 17 | // KPI Events format |
| 18 | |
| 19 | type Metrics struct { |
| 20 | TxBytes float64 `json:"tx_bytes"` |
| 21 | TxPackets float64 `json:"tx_packets"` |
| 22 | TxErrorPackets float64 `json:"tx_error_packets"` |
| 23 | TxBcastPackets float64 `json:"tx_bcast_packets"` |
| 24 | TxUnicastPackets float64 `json:"tx_ucast_packets"` |
| 25 | TxMulticastPackets float64 `json:"tx_mcast_packets"` |
| 26 | RxBytes float64 `json:"rx_bytes"` |
| 27 | RxPackets float64 `json:"rx_packets"` |
| 28 | RxErrorPackets float64 `json:"rx_error_packets"` |
| 29 | RxBcastPackets float64 `json:"rx_bcast_packets"` |
| 30 | RxMulticastPackets float64 `json:"rx_mcast_packets"` |
Scott Baker | e8537af | 2018-10-22 14:53:44 -0700 | [diff] [blame] | 31 | |
| 32 | // ONU Ethernet_Bridge_Port_history |
| 33 | Packets float64 `json:"packets"` |
| 34 | Octets float64 `json:"octets"` |
Matteo Scandolo | a8bd93e | 2018-09-13 13:36:50 -0700 | [diff] [blame] | 35 | } |
| 36 | |
| 37 | type Context struct { |
| 38 | InterfaceID string `json:"intf_id"` |
| 39 | PonID string `json:"pon_id"` |
| 40 | PortNumber string `json:"port_no"` |
Scott Baker | e8537af | 2018-10-22 14:53:44 -0700 | [diff] [blame] | 41 | |
| 42 | // ONU Performance Metrics |
| 43 | ParentClassId string `json:"parent_class_id"` |
| 44 | ParentEntityId string `json:"parent_entity_id"` |
| 45 | Upstream string `json:"upstream"` |
Matteo Scandolo | a8bd93e | 2018-09-13 13:36:50 -0700 | [diff] [blame] | 46 | } |
| 47 | |
| 48 | type Metadata struct { |
| 49 | LogicalDeviceID string `json:"logical_device_id"` |
| 50 | Title string `json:"title"` |
| 51 | SerialNumber string `json:"serial_no"` |
| 52 | Timestamp float64 `json:"ts"` |
| 53 | DeviceID string `json:"device_id"` |
| 54 | Context *Context `json:"context"` |
| 55 | } |
| 56 | |
| 57 | type SliceData struct { |
| 58 | Metrics *Metrics `json:"metrics"` |
| 59 | Metadata *Metadata `json:"metadata"` |
| 60 | } |
| 61 | |
Matteo Scandolo | aab36db | 2018-10-09 19:54:11 -0700 | [diff] [blame^] | 62 | type VolthaKPI struct { |
Matteo Scandolo | a8bd93e | 2018-09-13 13:36:50 -0700 | [diff] [blame] | 63 | Type string `json:"type"` |
| 64 | Timestamp float64 `json:"ts"` |
| 65 | SliceDatas []*SliceData `json:"slice_data"` |
| 66 | } |
Matteo Scandolo | aab36db | 2018-10-09 19:54:11 -0700 | [diff] [blame^] | 67 | |
| 68 | type OnosPort struct { |
| 69 | PortID string `json:"portId"` |
| 70 | RxPackets float64 `json:"pktRx"` |
| 71 | TxPackets float64 `json:"pktTx"` |
| 72 | RxBytes float64 `json:"bytesRx"` |
| 73 | TxBytes float64 `json:"bytesTx"` |
| 74 | RxPacketsDrop float64 `json:"pktRxDrp"` |
| 75 | TxPacketsDrop float64 `json:"pktTxDrp"` |
| 76 | } |
| 77 | |
| 78 | type OnosKPI struct { |
| 79 | DeviceID string `json:"deviceId"` |
| 80 | Ports []*OnosPort `json:"ports"` |
| 81 | } |