@@ -205,23 +205,6 @@ export const SIZE_UNIT_MULTIPLIERS: Record<SizeUnit, number> = {
205
205
exabyte : 1000 ** 6 ,
206
206
} ;
207
207
208
- export const SIZE_UNIT_LABELS : Record < SizeUnit , string > = {
209
- bit : 'b' ,
210
- byte : 'B' ,
211
- kibibyte : 'KiB' ,
212
- kilobyte : 'KB' ,
213
- mebibyte : 'MiB' ,
214
- megabyte : 'MB' ,
215
- gibibyte : 'GiB' ,
216
- gigabyte : 'GB' ,
217
- tebibyte : 'TiB' ,
218
- terabyte : 'TB' ,
219
- pebibyte : 'PiB' ,
220
- petabyte : 'PB' ,
221
- exbibyte : 'EiB' ,
222
- exabyte : 'EB' ,
223
- } ;
224
-
225
208
export enum RateUnit {
226
209
PER_SECOND = '1/second' ,
227
210
PER_MINUTE = '1/minute' ,
@@ -611,7 +594,7 @@ export const AGGREGATIONS = {
611
594
} as const ;
612
595
613
596
// TPM and TPS are aliases that are only used in Performance
614
- export const ALIASES = {
597
+ const ALIASES = {
615
598
tpm : AggregationKey . EPM ,
616
599
tps : AggregationKey . EPS ,
617
600
} ;
@@ -840,8 +823,8 @@ export const ERRORS_AGGREGATION_FUNCTIONS = [
840
823
// This list contains fields/functions that are available with profiling feature.
841
824
export const PROFILING_FIELDS : string [ ] = [ FieldKey . PROFILE_ID ] ;
842
825
843
- export const MEASUREMENT_PATTERN = / ^ m e a s u r e m e n t s \. ( [ a - z A - Z 0 - 9 - _ .] + ) $ / ;
844
- export const SPAN_OP_BREAKDOWN_PATTERN = / ^ s p a n s \. ( [ a - z A - Z 0 - 9 - _ .] + ) $ / ;
826
+ const MEASUREMENT_PATTERN = / ^ m e a s u r e m e n t s \. ( [ a - z A - Z 0 - 9 - _ .] + ) $ / ;
827
+ const SPAN_OP_BREAKDOWN_PATTERN = / ^ s p a n s \. ( [ a - z A - Z 0 - 9 - _ .] + ) $ / ;
845
828
846
829
export function isMeasurement ( field : string ) : boolean {
847
830
return MEASUREMENT_PATTERN . test ( field ) ;
@@ -899,7 +882,7 @@ function _lookback(columnText: string, j: number, str: string) {
899
882
return columnText . substring ( j - str . length , j ) === str ;
900
883
}
901
884
902
- export function parseArguments ( columnText : string ) : string [ ] {
885
+ function parseArguments ( columnText : string ) : string [ ] {
903
886
const args : string [ ] = [ ] ;
904
887
905
888
let quoted = false ;
@@ -961,7 +944,7 @@ export function parseArguments(columnText: string): string[] {
961
944
// `|` is an invalid field character, so it is used to determine whether a field is an equation or not
962
945
export const EQUATION_PREFIX = 'equation|' ;
963
946
const EQUATION_ALIAS_PATTERN = / ^ e q u a t i o n \[ ( \d + ) \] $ / ;
964
- export const CALCULATED_FIELD_PREFIX = 'calculated|' ;
947
+ const CALCULATED_FIELD_PREFIX = 'calculated|' ;
965
948
966
949
export function isEquation ( field : string ) : boolean {
967
950
return field . startsWith ( EQUATION_PREFIX ) ;
@@ -1041,7 +1024,7 @@ export function generateAggregateFields(
1041
1024
return fields . map ( field => ( { field} ) ) as Field [ ] ;
1042
1025
}
1043
1026
1044
- export function isDerivedMetric ( field : string ) : boolean {
1027
+ function isDerivedMetric ( field : string ) : boolean {
1045
1028
return field . startsWith ( CALCULATED_FIELD_PREFIX ) ;
1046
1029
}
1047
1030
@@ -1132,7 +1115,7 @@ export function isAggregateFieldOrEquation(field: string): boolean {
1132
1115
* Temporary hardcoded hack to enable testing derived metrics.
1133
1116
* Can be removed after we get rid of getAggregateFields
1134
1117
*/
1135
- export function isNumericMetrics ( field : string ) : boolean {
1118
+ function isNumericMetrics ( field : string ) : boolean {
1136
1119
return [
1137
1120
'session.crash_free_rate' ,
1138
1121
'session.crashed' ,
@@ -1142,7 +1125,7 @@ export function isNumericMetrics(field: string): boolean {
1142
1125
] . includes ( field ) ;
1143
1126
}
1144
1127
1145
- export function getAggregateFields ( fields : string [ ] ) : string [ ] {
1128
+ function getAggregateFields ( fields : string [ ] ) : string [ ] {
1146
1129
return fields . filter (
1147
1130
field =>
1148
1131
isAggregateField ( field ) || isAggregateEquation ( field ) || isNumericMetrics ( field )
@@ -1311,34 +1294,6 @@ export function errorsAndTransactionsAggregateFunctionOutputType(
1311
1294
return null ;
1312
1295
}
1313
1296
1314
- export function sessionsAggregateFunctionOutputType (
1315
- funcName : string ,
1316
- firstArg : string | undefined
1317
- ) : AggregationOutputType | null {
1318
- // @ts -expect-error TS(7053): Element implicitly has an 'any' type because expre... Remove this comment to see the full error message
1319
- const aggregate = SESSIONS_OPERATIONS [ funcName ] ;
1320
-
1321
- // Attempt to use the function's outputType.
1322
- if ( aggregate ?. outputType ) {
1323
- return aggregate . outputType ;
1324
- }
1325
-
1326
- // If the first argument is undefined and it is not required,
1327
- // then we attempt to get the default value.
1328
- if ( ! firstArg && aggregate ?. parameters ?. [ 0 ] ) {
1329
- if ( aggregate . parameters [ 0 ] . required === false ) {
1330
- firstArg = aggregate . parameters [ 0 ] . defaultValue ;
1331
- }
1332
- }
1333
-
1334
- if ( firstArg && SESSIONS_FIELDS . hasOwnProperty ( firstArg ) ) {
1335
- // @ts -expect-error TS(7053): Element implicitly has an 'any' type because expre... Remove this comment to see the full error message
1336
- return SESSIONS_FIELDS [ firstArg ] . type as AggregationOutputType ;
1337
- }
1338
-
1339
- return null ;
1340
- }
1341
-
1342
1297
/**
1343
1298
* Get the multi-series chart type for an aggregate function.
1344
1299
*/
@@ -1439,7 +1394,7 @@ export function getSpanOperationName(field: string): string | null {
1439
1394
return null ;
1440
1395
}
1441
1396
1442
- export function getColumnType ( column : Column ) : ColumnType {
1397
+ function getColumnType ( column : Column ) : ColumnType {
1443
1398
if ( column . kind === 'function' ) {
1444
1399
const outputType = aggregateFunctionOutputType (
1445
1400
column . function [ 0 ] ,
@@ -1474,7 +1429,7 @@ export function hasDuplicate(columnList: Column[], column: Column): boolean {
1474
1429
// Search categorizations for the new `SearchQueryBuilder` component.
1475
1430
// Each Insights module page will have different points of interest for searching, so use these on a case-by-case basis
1476
1431
1477
- export const TRANSACTION_FILTERS : FilterKeySection = {
1432
+ const TRANSACTION_FILTERS : FilterKeySection = {
1478
1433
value : 'transaction_event_filters' ,
1479
1434
label : 'Event' ,
1480
1435
children : [
@@ -1490,7 +1445,7 @@ export const TRANSACTION_FILTERS: FilterKeySection = {
1490
1445
] ,
1491
1446
} ;
1492
1447
1493
- export const USER_FILTERS : FilterKeySection = {
1448
+ const USER_FILTERS : FilterKeySection = {
1494
1449
value : 'user_filters' ,
1495
1450
label : 'User' ,
1496
1451
children : [
@@ -1503,7 +1458,7 @@ export const USER_FILTERS: FilterKeySection = {
1503
1458
] ,
1504
1459
} ;
1505
1460
1506
- export const GEO_FILTERS : FilterKeySection = {
1461
+ const GEO_FILTERS : FilterKeySection = {
1507
1462
value : 'geo_filters' ,
1508
1463
label : 'Geo' ,
1509
1464
children : [
@@ -1514,7 +1469,7 @@ export const GEO_FILTERS: FilterKeySection = {
1514
1469
] ,
1515
1470
} ;
1516
1471
1517
- export const HTTP_FILTERS : FilterKeySection = {
1472
+ const HTTP_FILTERS : FilterKeySection = {
1518
1473
value : 'http_filters' ,
1519
1474
label : 'HTTP' ,
1520
1475
children : [
@@ -1525,7 +1480,7 @@ export const HTTP_FILTERS: FilterKeySection = {
1525
1480
] ,
1526
1481
} ;
1527
1482
1528
- export const WEB_VITAL_FILTERS : FilterKeySection = {
1483
+ const WEB_VITAL_FILTERS : FilterKeySection = {
1529
1484
value : 'web_filters' ,
1530
1485
label : 'Web Vitals' ,
1531
1486
children : [
@@ -1539,7 +1494,7 @@ export const WEB_VITAL_FILTERS: FilterKeySection = {
1539
1494
] ,
1540
1495
} ;
1541
1496
1542
- export const MOBILE_VITAL_FILTERS : FilterKeySection = {
1497
+ const MOBILE_VITAL_FILTERS : FilterKeySection = {
1543
1498
value : 'mobile_vitals_filters' ,
1544
1499
label : 'Mobile Vitals' ,
1545
1500
children : [
@@ -1559,7 +1514,7 @@ export const MOBILE_VITAL_FILTERS: FilterKeySection = {
1559
1514
] ,
1560
1515
} ;
1561
1516
1562
- export const DEVICE_FILTERS : FilterKeySection = {
1517
+ const DEVICE_FILTERS : FilterKeySection = {
1563
1518
value : 'device_filters' ,
1564
1519
label : 'Device' ,
1565
1520
children : [
@@ -1583,7 +1538,7 @@ export const DEVICE_FILTERS: FilterKeySection = {
1583
1538
] ,
1584
1539
} ;
1585
1540
1586
- export const RELEASE_FILTERS : FilterKeySection = {
1541
+ const RELEASE_FILTERS : FilterKeySection = {
1587
1542
value : 'release_filters' ,
1588
1543
label : 'Release' ,
1589
1544
children : [
@@ -1595,23 +1550,7 @@ export const RELEASE_FILTERS: FilterKeySection = {
1595
1550
] ,
1596
1551
} ;
1597
1552
1598
- export const STACKTRACE_FILTERS : FilterKeySection = {
1599
- value : 'stacktrace_filters' ,
1600
- label : 'Stacktrace' ,
1601
- children : [
1602
- FieldKey . STACK_ABS_PATH ,
1603
- FieldKey . STACK_COLNO ,
1604
- FieldKey . STACK_FILENAME ,
1605
- FieldKey . STACK_FUNCTION ,
1606
- FieldKey . STACK_IN_APP ,
1607
- FieldKey . STACK_LINENO ,
1608
- FieldKey . STACK_MODULE ,
1609
- FieldKey . STACK_PACKAGE ,
1610
- FieldKey . STACK_STACK_LEVEL ,
1611
- ] ,
1612
- } ;
1613
-
1614
- export const ERROR_DETAIL_FILTERS : FilterKeySection = {
1553
+ const ERROR_DETAIL_FILTERS : FilterKeySection = {
1615
1554
value : 'error_detail_filters' ,
1616
1555
label : 'Error' ,
1617
1556
children : [
@@ -1627,23 +1566,7 @@ export const ERROR_DETAIL_FILTERS: FilterKeySection = {
1627
1566
] ,
1628
1567
} ;
1629
1568
1630
- export const MISC_FILTERS : FilterKeySection = {
1631
- value : 'misc_filters' ,
1632
- label : 'Misc' ,
1633
- children : [ FieldKey . HAS , FieldKey . DIST ] ,
1634
- } ;
1635
-
1636
- export const TRANSACTION_EVENT_FILTERS : FilterKeySection = {
1637
- value : 'transaction_event_filters' ,
1638
- label : 'Event' ,
1639
- children : [
1640
- ...TRANSACTION_FILTERS . children ,
1641
- ...HTTP_FILTERS . children ,
1642
- ...RELEASE_FILTERS . children ,
1643
- ] ,
1644
- } ;
1645
-
1646
- export const ERROR_EVENT_FILTERS : FilterKeySection = {
1569
+ const ERROR_EVENT_FILTERS : FilterKeySection = {
1647
1570
value : 'error_event_filters' ,
1648
1571
label : 'Event' ,
1649
1572
children : [
@@ -1653,7 +1576,7 @@ export const ERROR_EVENT_FILTERS: FilterKeySection = {
1653
1576
] ,
1654
1577
} ;
1655
1578
1656
- export const COMBINED_EVENT_FILTERS : FilterKeySection = {
1579
+ const COMBINED_EVENT_FILTERS : FilterKeySection = {
1657
1580
value : 'combined_event_filters' ,
1658
1581
label : 'Event' ,
1659
1582
children : [
@@ -1664,7 +1587,7 @@ export const COMBINED_EVENT_FILTERS: FilterKeySection = {
1664
1587
] ,
1665
1588
} ;
1666
1589
1667
- export const USER_CONTEXT_FILTERS : FilterKeySection = {
1590
+ const USER_CONTEXT_FILTERS : FilterKeySection = {
1668
1591
value : 'user_context_filters' ,
1669
1592
label : 'User' ,
1670
1593
children : [
@@ -1674,7 +1597,7 @@ export const USER_CONTEXT_FILTERS: FilterKeySection = {
1674
1597
] ,
1675
1598
} ;
1676
1599
1677
- export const PERFORMANCE_FILTERS : FilterKeySection = {
1600
+ const PERFORMANCE_FILTERS : FilterKeySection = {
1678
1601
value : 'performance_filters' ,
1679
1602
label : 'Performance' ,
1680
1603
children : [ ...WEB_VITAL_FILTERS . children , ...MOBILE_VITAL_FILTERS . children ] ,
@@ -1702,7 +1625,7 @@ export const COMBINED_DATASET_FILTER_KEY_SECTIONS: FilterKeySection[] = [
1702
1625
// will take in a project platform key, and output only the relevant filter key sections.
1703
1626
// This way, users will not be suggested mobile fields for a backend transaction, for example.
1704
1627
1705
- export const TYPED_TAG_KEY_RE = / t a g s \[ ( [ ^ \s ] * ) , ( [ ^ \s ] * ) \] / ;
1628
+ const TYPED_TAG_KEY_RE = / t a g s \[ ( [ ^ \s ] * ) , ( [ ^ \s ] * ) \] / ;
1706
1629
1707
1630
export function classifyTagKey ( key : string ) : FieldKind {
1708
1631
const result = key . match ( TYPED_TAG_KEY_RE ) ;
0 commit comments