grafana-kafka-datasource
grafana-kafka-datasource copied to clipboard
consumer: Use make() instead of append()
Is your feature request related to a problem? Please describe.
append()
is used when creating the frame, constantly pushing new data and returning a new slice
Describe the solution you'd like
Use make()
to pre-allocate a frame based on msg.Value
key entry size. This would be more efficient
ref. https://github.com/hoptical/grafana-kafka-datasource/blob/main/pkg/plugin/plugin.go#L179-L190
Which sides should be considered to develop?
- [ ] Frontend(React)
- [x] Backend(Golang) Additional context Add any other context or screenshots about the feature request here.