@@ -145,7 +145,10 @@ export function formatReservedWithUnits(
145
145
if ( isReservedBudget ) {
146
146
return displayPriceWithCents ( { cents : reservedQuantity ?? 0 } ) ;
147
147
}
148
- if ( dataCategory !== DataCategory . ATTACHMENTS ) {
148
+ if (
149
+ dataCategory !== DataCategory . ATTACHMENTS &&
150
+ dataCategory !== DataCategory . LOG_BYTE
151
+ ) {
149
152
return formatReservedNumberToString ( reservedQuantity , options ) ;
150
153
}
151
154
// convert reservedQuantity to BYTES to check for unlimited
@@ -158,23 +161,26 @@ export function formatReservedWithUnits(
158
161
return `${ formatted } GB` ;
159
162
}
160
163
161
- return formatAttachmentUnits ( reservedQuantity || 0 , 3 ) ;
164
+ return formatByteUnits ( reservedQuantity || 0 , 3 ) ;
162
165
}
163
166
164
167
/**
165
168
* This expects values from CustomerUsageEndpoint, which contains usage
166
169
* quantities for the data categories that we sell.
167
170
*
168
- * Note: usageQuantity for Attachments should be in BYTES
171
+ * Note: usageQuantity for Attachments and Logs should be in BYTES
169
172
*/
170
173
export function formatUsageWithUnits (
171
174
usageQuantity = 0 ,
172
175
dataCategory : DataCategory ,
173
176
options : FormatOptions = { isAbbreviated : false , useUnitScaling : false }
174
177
) {
175
- if ( dataCategory === DataCategory . ATTACHMENTS ) {
178
+ if (
179
+ dataCategory === DataCategory . ATTACHMENTS ||
180
+ dataCategory === DataCategory . LOG_BYTE
181
+ ) {
176
182
if ( options . useUnitScaling ) {
177
- return formatAttachmentUnits ( usageQuantity ) ;
183
+ return formatByteUnits ( usageQuantity ) ;
178
184
}
179
185
180
186
const usageGb = usageQuantity / GIGABYTE ;
@@ -242,7 +248,7 @@ function formatReservedNumberToString(
242
248
* For storage/memory/file sizes, please take a look at the function in
243
249
* sentry/utils/formatBytes.
244
250
*/
245
- function formatAttachmentUnits ( bytes : number , u = 0 ) {
251
+ function formatByteUnits ( bytes : number , u = 0 ) {
246
252
const units = [ 'B' , 'KB' , 'MB' , 'GB' , 'TB' , 'PB' , 'EB' , 'ZB' , 'YB' ] ;
247
253
const threshold = 1000 ;
248
254
0 commit comments