You can just call the ByteSize() method to get the serialized size without having to serialize the message first.
On Sun, Dec 10, 2017 at 9:47 PM, Brian Palmer <[email protected]> wrote: > The simplest way would be to serialize your messages into bytes and then > measure the size directly, right? > > On Sun, Dec 10, 2017 at 11:26 AM, Tomer Praizler <[email protected] > > wrote: > >> Couldn't find a nice and easy way to calculate my protobuf sizes using >> python. Is there a recommended way? >> >> I am sending my protobufs into rabbitmq, and huge messages causing my >> connection to break. I want to be able to validate the size before sending >> a message. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Protocol Buffers" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To post to this group, send email to [email protected]. >> Visit this group at https://groups.google.com/group/protobuf. >> For more options, visit https://groups.google.com/d/optout. >> > > -- > You received this message because you are subscribed to the Google Groups > "Protocol Buffers" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/protobuf. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/protobuf. For more options, visit https://groups.google.com/d/optout.
