internal/chat/quota.go budgets liveBroadcasts.list at 1 unit:
QuotaCostListMessages = 5
QuotaCostListBroadcasts = 1
That figure could not be confirmed against Google's documentation, and a second
opinion put it at 50.
Why it is not resolvable from the docs
Google's Quota Calculator
says the Live Streaming API "will incur the same quota costs as other methods"
and then its table does not list the Live Streaming endpoints at all —
no liveBroadcasts, no liveChatMessages, no liveChatBans rows. The
liveChatMessages.list reference page carries the 5 that this file already
uses; the liveBroadcasts.list page does not carry a comparable figure.
Asked independently, agy answered 50 for liveBroadcasts.list, flagging
its own uncertainty and noting the same omission in Google's table. The generic
rule it cited — reads cost 1, writes cost 50 — would give 1, and
liveChatMessages.list is already a documented exception to that rule at 5.
So the generic rule is known not to hold for this API family, which is exactly
why the specific number matters and why a guess in either direction is unsafe.
What it would cost to be wrong
youtube.go polls for a broadcast to attach to every 30 seconds when there is
none, backing off to 5 minutes, with the comment:
Each look costs a unit, so a machine left connected overnight must not spend
the morning's quota discovering that nobody is live.
At 1 unit that reasoning holds. At 50 it does not: 30-second discovery is
120 looks an hour, which at 50 units is 6,000 an hour — the whole daily
allowance gone in under two hours of an idle box doing nothing but asking
whether anybody is live. The backoff to 5 minutes softens it to 600/hour, still
an order of magnitude past what the comment assumes.
Not a claim that it is wrong
The 403 remains the authority — quota.go says so, and deliberately: "a budget
that refused to poll because its arithmetic said so would be a check wrong in
the restrictive direction." Nothing here breaks if the estimate is low; the
budget simply runs out earlier than the panel predicted, which is the failure
mode that file already accepts.
What is worth having is the number MEASURED rather than assumed, because it is
the one cost in the file that could be wrong by 50x and the one paid while
nothing is happening.
How to settle it
One live project, one liveBroadcasts.list call, and the Quotas page in the
Cloud Console before and after. That is the only authority available, since
Google does not publish the figure. Whatever it turns out to be, the constant
should carry the date it was measured and how — the same treatment
platforms.go gives every researched figure it holds.
internal/chat/quota.gobudgetsliveBroadcasts.listat 1 unit:That figure could not be confirmed against Google's documentation, and a second
opinion put it at 50.
Why it is not resolvable from the docs
Google's Quota Calculator
says the Live Streaming API "will incur the same quota costs as other methods"
and then its table does not list the Live Streaming endpoints at all —
no
liveBroadcasts, noliveChatMessages, noliveChatBansrows. TheliveChatMessages.listreference page carries the 5 that this file alreadyuses; the
liveBroadcasts.listpage does not carry a comparable figure.Asked independently,
agyanswered 50 forliveBroadcasts.list, flaggingits own uncertainty and noting the same omission in Google's table. The generic
rule it cited — reads cost 1, writes cost 50 — would give 1, and
liveChatMessages.listis already a documented exception to that rule at 5.So the generic rule is known not to hold for this API family, which is exactly
why the specific number matters and why a guess in either direction is unsafe.
What it would cost to be wrong
youtube.gopolls for a broadcast to attach to every 30 seconds when there isnone, backing off to 5 minutes, with the comment:
At 1 unit that reasoning holds. At 50 it does not: 30-second discovery is
120 looks an hour, which at 50 units is 6,000 an hour — the whole daily
allowance gone in under two hours of an idle box doing nothing but asking
whether anybody is live. The backoff to 5 minutes softens it to 600/hour, still
an order of magnitude past what the comment assumes.
Not a claim that it is wrong
The 403 remains the authority — quota.go says so, and deliberately: "a budget
that refused to poll because its arithmetic said so would be a check wrong in
the restrictive direction." Nothing here breaks if the estimate is low; the
budget simply runs out earlier than the panel predicted, which is the failure
mode that file already accepts.
What is worth having is the number MEASURED rather than assumed, because it is
the one cost in the file that could be wrong by 50x and the one paid while
nothing is happening.
How to settle it
One live project, one
liveBroadcasts.listcall, and the Quotas page in theCloud Console before and after. That is the only authority available, since
Google does not publish the figure. Whatever it turns out to be, the constant
should carry the date it was measured and how — the same treatment
platforms.gogives every researched figure it holds.