grafana-kafka-datasource icon indicating copy to clipboard operation
grafana-kafka-datasource copied to clipboard

consumer: Use make() instead of append()

Open OneCricketeer opened this issue 1 year ago • 0 comments

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.

OneCricketeer avatar Dec 06 '22 23:12 OneCricketeer