go-ipfix icon indicating copy to clipboard operation
go-ipfix copied to clipboard

Support size check when adding multiple records into set

Open zyiou opened this issue 5 years ago • 3 comments

Is your feature request related to a problem? Please describe. Currently we only support size check before sending the message, but adding multiple records to set will also cause size excess. We should make sure the set size is under size limit when adding records.

Describe the solution you'd like Solution 1:

  • add record to set, check current length and length difference
  • if current length exceeds limit, revert set buffer by length difference

Solution 2:

  • build the record from element list
  • provide method to add record directly to set and check the size
  • if total length exceeds limit, return error

zyiou avatar Dec 17 '20 20:12 zyiou

Prefer Solution 2. This will make it easier for user to consume the library.

I think we should essentially provide an interface that takes in element list with values, and inside the interface, we should create/build the record, maintain the set and send the set when appropriate. In addition, we should also add the capability to send the set immediately with a boolean.

Maintaining sets may not be straightforward. We need to maintain sets for different template IDs, and both for template and data sets.

And better to design this in such a way that it will be easy to extend support for multiple sets.

Considering the above may be a short description of design consideration is better, so that we will not miss some essential things.

srikartati avatar Dec 18 '20 07:12 srikartati

@yiou: Is Issue #55 a duplicate of this issue? If so, please close that one.

srikartati avatar Feb 18 '21 20:02 srikartati

@yiou: Is Issue #55 a duplicate of this issue? If so, please close that one.

Yes, they are duplications. Closing that.

zyiou avatar Feb 18 '21 21:02 zyiou