fixes client dpi strings on influx and prom
This commit is contained in:
		
							parent
							
								
									9569befda4
								
							
						
					
					
						commit
						27bab9a01c
					
				|  | @ -100,10 +100,10 @@ func (u *InfluxUnifi) batchClientDPI(r report, v any, appTotal, catTotal totalsD | ||||||
| 				"source":      s.SourceName, | 				"source":      s.SourceName, | ||||||
| 			}, | 			}, | ||||||
| 			Fields: map[string]any{ | 			Fields: map[string]any{ | ||||||
| 				"tx_packets": dpi.TxPackets, | 				"tx_packets": dpi.TxPackets.Val, | ||||||
| 				"rx_packets": dpi.RxPackets, | 				"rx_packets": dpi.RxPackets.Val, | ||||||
| 				"tx_bytes":   dpi.TxBytes, | 				"tx_bytes":   dpi.TxBytes.Val, | ||||||
| 				"rx_bytes":   dpi.RxBytes, | 				"rx_bytes":   dpi.RxBytes.Val, | ||||||
| 			}, | 			}, | ||||||
| 		}) | 		}) | ||||||
| 	} | 	} | ||||||
|  | @ -167,10 +167,10 @@ func reportClientDPItotals(r report, appTotal, catTotal totalsDPImap) { | ||||||
| 							"source":      controller, | 							"source":      controller, | ||||||
| 						}, | 						}, | ||||||
| 						Fields: map[string]any{ | 						Fields: map[string]any{ | ||||||
| 							"tx_packets": m.TxPackets, | 							"tx_packets": m.TxPackets.Val, | ||||||
| 							"rx_packets": m.RxPackets, | 							"rx_packets": m.RxPackets.Val, | ||||||
| 							"tx_bytes":   m.TxBytes, | 							"tx_bytes":   m.TxBytes.Val, | ||||||
| 							"rx_bytes":   m.RxBytes, | 							"rx_bytes":   m.RxBytes.Val, | ||||||
| 						}, | 						}, | ||||||
| 					} | 					} | ||||||
| 					newMetric.Tags[k.kind] = name | 					newMetric.Tags[k.kind] = name | ||||||
|  |  | ||||||
|  | @ -91,10 +91,10 @@ func (u *promUnifi) exportClientDPI(r report, v any, appTotal, catTotal totalsDP | ||||||
| 		fillDPIMapTotals(catTotal, labelDPI[4], s.SourceName, s.SiteName, dpi) | 		fillDPIMapTotals(catTotal, labelDPI[4], s.SourceName, s.SiteName, dpi) | ||||||
| 		// log.Println(labelDPI, dpi.Cat, dpi.App, dpi.TxBytes, dpi.RxBytes, dpi.TxPackets, dpi.RxPackets)
 | 		// log.Println(labelDPI, dpi.Cat, dpi.App, dpi.TxBytes, dpi.RxBytes, dpi.TxPackets, dpi.RxPackets)
 | ||||||
| 		r.send([]*metric{ | 		r.send([]*metric{ | ||||||
| 			{u.Client.DPITxPackets, counter, dpi.TxPackets, labelDPI}, | 			{u.Client.DPITxPackets, counter, dpi.TxPackets.Val, labelDPI}, | ||||||
| 			{u.Client.DPIRxPackets, counter, dpi.RxPackets, labelDPI}, | 			{u.Client.DPIRxPackets, counter, dpi.RxPackets.Val, labelDPI}, | ||||||
| 			{u.Client.DPITxBytes, counter, dpi.TxBytes, labelDPI}, | 			{u.Client.DPITxBytes, counter, dpi.TxBytes.Val, labelDPI}, | ||||||
| 			{u.Client.DPIRxBytes, counter, dpi.RxBytes, labelDPI}, | 			{u.Client.DPIRxBytes, counter, dpi.RxBytes.Val, labelDPI}, | ||||||
| 		}) | 		}) | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
|  | @ -218,10 +218,10 @@ func (u *promUnifi) exportClientDPItotals(r report, appTotal, catTotal totalsDPI | ||||||
| 					} | 					} | ||||||
| 
 | 
 | ||||||
| 					m := []*metric{ | 					m := []*metric{ | ||||||
| 						{u.Client.DPITxPackets, counter, m.TxPackets, labelDPI}, | 						{u.Client.DPITxPackets, counter, m.TxPackets.Val, labelDPI}, | ||||||
| 						{u.Client.DPIRxPackets, counter, m.RxPackets, labelDPI}, | 						{u.Client.DPIRxPackets, counter, m.RxPackets.Val, labelDPI}, | ||||||
| 						{u.Client.DPITxBytes, counter, m.TxBytes, labelDPI}, | 						{u.Client.DPITxBytes, counter, m.TxBytes.Val, labelDPI}, | ||||||
| 						{u.Client.DPIRxBytes, counter, m.RxBytes, labelDPI}, | 						{u.Client.DPIRxBytes, counter, m.RxBytes.Val, labelDPI}, | ||||||
| 					} | 					} | ||||||
| 
 | 
 | ||||||
| 					r.send(m) | 					r.send(m) | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue