Commit dd4ac18
authored
V8 heap metrics: Track instance memory usage for procedure workers too (#5122)
# Description of Changes
Prior to this PR, the `V8HeapMetrics` were tracked only for the "main"
instance of a database, i.e. the reducer worker. This meant that we had
little to no visibility into memory usage by procedures.
In this PR, we also track values for the procedure workers. We
considered tracking each instance's usage separately with a unique
integer `instance_id` label, but were concerned about cardinality (see
discussion), so decided instead to track only two sets of label values
per database: `JsWorkerKind::Main` and `JsWorkerKind::Procedure`. The
entries for `JsWorkerKind::Procedure` store the sum of the values for
all procedure workers for that database.
I also moved the logic for calling `remove_label_values` into an
associated function on `V8HeapMetrics`, rather than listing them all in
`remove_database_gauges`. This hides the fact that we have label values
for both `JsWorkerKind` variants.
# API and ABI breaking changes
We don't use any of these metrics for billing, and otherwise do not
consider our metrics a stable API.
# Expected complexity level and risk
2: it would be unfortunate if we reported incorrect values for these
metrics, though (as mentioned above) they are not used for billing, only
diagnostics.
# Testing
I do not know how to test metrics.1 parent 0305a24 commit dd4ac18
3 files changed
Lines changed: 83 additions & 63 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
1411 | 1412 | | |
1412 | 1413 | | |
1413 | 1414 | | |
1414 | | - | |
1415 | | - | |
1416 | | - | |
1417 | | - | |
1418 | | - | |
1419 | | - | |
1420 | | - | |
1421 | | - | |
1422 | | - | |
1423 | | - | |
1424 | | - | |
1425 | | - | |
1426 | | - | |
1427 | | - | |
1428 | | - | |
1429 | | - | |
1430 | | - | |
1431 | | - | |
1432 | | - | |
1433 | | - | |
1434 | | - | |
| 1415 | + | |
| 1416 | + | |
| 1417 | + | |
1435 | 1418 | | |
1436 | 1419 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
172 | | - | |
173 | 172 | | |
174 | 173 | | |
175 | | - | |
| 174 | + | |
176 | 175 | | |
177 | 176 | | |
178 | 177 | | |
179 | 178 | | |
180 | | - | |
181 | | - | |
182 | | - | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
183 | 185 | | |
184 | 186 | | |
185 | 187 | | |
| |||
946 | 948 | | |
947 | 949 | | |
948 | 950 | | |
949 | | - | |
| 951 | + | |
950 | 952 | | |
951 | 953 | | |
952 | 954 | | |
| |||
955 | 957 | | |
956 | 958 | | |
957 | 959 | | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
958 | 970 | | |
959 | 971 | | |
960 | 972 | | |
| |||
986 | 998 | | |
987 | 999 | | |
988 | 1000 | | |
989 | | - | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
990 | 1031 | | |
991 | 1032 | | |
992 | 1033 | | |
993 | | - | |
| 1034 | + | |
994 | 1035 | | |
995 | 1036 | | |
996 | | - | |
| 1037 | + | |
997 | 1038 | | |
998 | 1039 | | |
999 | | - | |
| 1040 | + | |
1000 | 1041 | | |
1001 | 1042 | | |
1002 | | - | |
| 1043 | + | |
1003 | 1044 | | |
1004 | 1045 | | |
1005 | | - | |
| 1046 | + | |
1006 | 1047 | | |
1007 | 1048 | | |
1008 | | - | |
| 1049 | + | |
1009 | 1050 | | |
1010 | 1051 | | |
1011 | | - | |
| 1052 | + | |
1012 | 1053 | | |
1013 | 1054 | | |
1014 | | - | |
| 1055 | + | |
1015 | 1056 | | |
1016 | 1057 | | |
1017 | 1058 | | |
| |||
1031 | 1072 | | |
1032 | 1073 | | |
1033 | 1074 | | |
| 1075 | + | |
| 1076 | + | |
1034 | 1077 | | |
1035 | 1078 | | |
1036 | 1079 | | |
| |||
1625 | 1668 | | |
1626 | 1669 | | |
1627 | 1670 | | |
1628 | | - | |
1629 | | - | |
1630 | | - | |
| 1671 | + | |
1631 | 1672 | | |
1632 | 1673 | | |
1633 | 1674 | | |
| |||
1639 | 1680 | | |
1640 | 1681 | | |
1641 | 1682 | | |
1642 | | - | |
1643 | | - | |
1644 | | - | |
| 1683 | + | |
1645 | 1684 | | |
1646 | 1685 | | |
1647 | 1686 | | |
| |||
1655 | 1694 | | |
1656 | 1695 | | |
1657 | 1696 | | |
1658 | | - | |
1659 | | - | |
1660 | | - | |
| 1697 | + | |
1661 | 1698 | | |
1662 | 1699 | | |
1663 | 1700 | | |
| |||
1669 | 1706 | | |
1670 | 1707 | | |
1671 | 1708 | | |
1672 | | - | |
| 1709 | + | |
1673 | 1710 | | |
1674 | 1711 | | |
1675 | 1712 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | 1 | | |
3 | 2 | | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
288 | 288 | | |
289 | 289 | | |
290 | 290 | | |
291 | | - | |
292 | | - | |
| 291 | + | |
| 292 | + | |
293 | 293 | | |
294 | 294 | | |
295 | 295 | | |
296 | | - | |
297 | | - | |
| 296 | + | |
| 297 | + | |
298 | 298 | | |
299 | 299 | | |
300 | 300 | | |
301 | | - | |
302 | | - | |
| 301 | + | |
| 302 | + | |
303 | 303 | | |
304 | 304 | | |
305 | 305 | | |
306 | | - | |
307 | | - | |
| 306 | + | |
| 307 | + | |
308 | 308 | | |
309 | 309 | | |
310 | 310 | | |
311 | | - | |
312 | | - | |
| 311 | + | |
| 312 | + | |
313 | 313 | | |
314 | 314 | | |
315 | 315 | | |
| |||
318 | 318 | | |
319 | 319 | | |
320 | 320 | | |
321 | | - | |
322 | | - | |
| 321 | + | |
| 322 | + | |
323 | 323 | | |
324 | 324 | | |
325 | 325 | | |
326 | | - | |
327 | | - | |
| 326 | + | |
| 327 | + | |
328 | 328 | | |
329 | 329 | | |
330 | 330 | | |
331 | | - | |
332 | | - | |
| 331 | + | |
| 332 | + | |
333 | 333 | | |
334 | 334 | | |
335 | 335 | | |
| |||
0 commit comments