StatusType

Response Length Calculation

Wire format

Each server response is sent as:

4-byte big-endian length prefix + UTF-8 JSON payload

So:

total_bytes = 4 + json_payload_bytes

The response JSON shape is:

{
  "meta": ...,
  "uuid": ...,
  "hits": [...]
}

Important behavior for return_empty

  • If hits = 0 and return_empty is false or omitted, the server sends no response
  • If hits = 0 and return_empty = true, the server sends an empty response payload

Assumptions Used For The Table

  • uuid example: "generated-uuid"
  • meta example:
{"source":"python-client","mode":"live"}
  • Each returned ID is a 36-byte UUID-like string:
"123e4567-e89b-12d3-a456-426614174000"

Calculation Process

Base payload sizes

1. No uuid, no meta, empty hits

{"meta":null,"uuid":null,"hits":[]}
  • JSON bytes: 35
  • Framed bytes: 35 + 4 = 39

2. uuid only, empty hits

{"meta":null,"uuid":"generated-uuid","hits":[]}
  • JSON bytes: 47
  • Framed bytes: 47 + 4 = 51

3. meta only, empty hits

{"meta":{"source":"python-client","mode":"live"},"uuid":null,"hits":[]}
  • JSON bytes: 71
  • Framed bytes: 71 + 4 = 75

4. uuid + meta, empty hits

{"meta":{"source":"python-client","mode":"live"},"uuid":"generated-uuid","hits":[]}
  • JSON bytes: 83
  • Framed bytes: 83 + 4 = 87

Per-returned-ID growth

For a 36-byte returned ID:

  • First ID adds 38 bytes to the JSON payload
  • Each additional ID adds 39 bytes

Reason:

  • first item: " + 36 chars + " = 38
  • next items: , + " + 36 chars + " = 39

So for n > 0:

hits_bytes(n) = 38 + (n - 1) * 39

Equivalent:

hits_bytes(n) = 39n - 1

Final Formulas

Let n be the number of returned IDs.

No uuid, no meta

total_bytes = 39 + (39n - 1), for n > 0
total_bytes = 39, for n = 0

Simplified:

total_bytes = 38 + 39n, for n > 0
total_bytes = 39, for n = 0

uuid only

total_bytes = 51, for n = 0
total_bytes = 50 + 39n, for n > 0

meta only

total_bytes = 75, for n = 0
total_bytes = 74 + 39n, for n > 0

uuid + meta

total_bytes = 87, for n = 0
total_bytes = 86 + 39n, for n > 0

Results Table

Returned IDsNo uuid, No metauuid onlymeta onlyuuid + meta
039517587
17789113125
2116128152164
3155167191203
4194206230242
5233245269281
6272284308320
7311323347359
8350362386398
9389401425437
10428440464476
11467479503515
12506518542554
13545557581593
14584596620632
15623635659671

Notes

  • These values are for the PBS application payload only
  • They do not include TCP, IP, or TLS overhead
  • If return_empty=false and there are 0 hits, response size is 0 bytes