blob: 1e29fbe8ead0d3b86e9410beb813305302c2ec4d [file] [log] [blame]
Matteo Scandoloa8bd93e2018-09-13 13:36:50 -07001// 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
15package main
16
17// KPI Events format
18
19type 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 Bakere8537af2018-10-22 14:53:44 -070031
32 // ONU Ethernet_Bridge_Port_history
33 Packets float64 `json:"packets"`
34 Octets float64 `json:"octets"`
Matteo Scandoloa8bd93e2018-09-13 13:36:50 -070035}
36
37type Context struct {
38 InterfaceID string `json:"intf_id"`
39 PonID string `json:"pon_id"`
40 PortNumber string `json:"port_no"`
Scott Bakere8537af2018-10-22 14:53:44 -070041
42 // ONU Performance Metrics
43 ParentClassId string `json:"parent_class_id"`
44 ParentEntityId string `json:"parent_entity_id"`
45 Upstream string `json:"upstream"`
Matteo Scandoloa8bd93e2018-09-13 13:36:50 -070046}
47
48type 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
57type SliceData struct {
58 Metrics *Metrics `json:"metrics"`
59 Metadata *Metadata `json:"metadata"`
60}
61
62type KPI struct {
63 Type string `json:"type"`
64 Timestamp float64 `json:"ts"`
65 SliceDatas []*SliceData `json:"slice_data"`
66}