Commit 9129cb1
authored
Replace the bespoke BRP schedule.graph implementation with ScheduleData. (#23733)
# Objective
- A possible step towards #10981.
- Followup to #22520.
- We accidentally have two implementations of the same thing! We created
a way to collect schedule data in `bevy_dev_tools` and in `bevy_remote`.
`ScheduleData` is a more complete implementation of collecting schedule
data, and is less tied to the internals of BRP (e.g., it supports
serializing to disk instead of only through the BRP API), so we switch
to that.
## Solution
- Replace the implementation of `schedule.graph` with the `ScheduleData`
API.
A disadvantage is that we now need to wait for the schedules to be
initialized before we can read them. Since users have to connect with
BRP though, it is almost certain that the schedules will be initialized
by the time they request the schedules. This may not be true of
schedules like state transitions though - since these only run rarely.
In a future PR, we can build the schedules on-demand instead.
## Testing
- Updated the test for this.
- Ran the same test as #23452
- Terminal 1: `cargo r --example server --features=bevy_remote`
- Terminal 2: `curl
-d'{"jsonrpc":"2.0","method":"schedule.graph","id":1,"params":{"schedule_label":"First"}}'
-X POST -H "Accept: applcation/json" -H "Content-Type: application/json"
http://127.0.0.1:15702`
- It dumped out a whole load of JSON that looked expected!
- I don't have a visualization of the schedule data yet, so I can't
validate that it's correct, but there's no reason to believe its wrong
given the existing `ScheduleData` tests.1 parent 9e7355d commit 9129cb1
2 files changed
+32
-63
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
28 | 31 | | |
29 | 32 | | |
30 | 33 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
526 | 527 | | |
527 | 528 | | |
528 | 529 | | |
529 | | - | |
| 530 | + | |
530 | 531 | | |
531 | | - | |
532 | | - | |
533 | | - | |
534 | | - | |
535 | | - | |
536 | | - | |
537 | | - | |
538 | | - | |
539 | | - | |
540 | | - | |
541 | | - | |
542 | | - | |
543 | | - | |
544 | | - | |
545 | | - | |
546 | | - | |
547 | | - | |
| 532 | + | |
| 533 | + | |
548 | 534 | | |
549 | 535 | | |
550 | 536 | | |
| |||
1627 | 1613 | | |
1628 | 1614 | | |
1629 | 1615 | | |
1630 | | - | |
| 1616 | + | |
1631 | 1617 | | |
1632 | | - | |
1633 | | - | |
1634 | | - | |
| 1618 | + | |
| 1619 | + | |
1635 | 1620 | | |
1636 | | - | |
| 1621 | + | |
1637 | 1622 | | |
1638 | 1623 | | |
1639 | | - | |
1640 | | - | |
1641 | | - | |
1642 | | - | |
1643 | | - | |
1644 | | - | |
1645 | | - | |
1646 | | - | |
1647 | | - | |
1648 | | - | |
1649 | | - | |
1650 | | - | |
1651 | | - | |
1652 | | - | |
1653 | | - | |
1654 | | - | |
1655 | | - | |
1656 | | - | |
1657 | | - | |
1658 | | - | |
1659 | | - | |
1660 | | - | |
1661 | | - | |
| 1624 | + | |
1662 | 1625 | | |
1663 | | - | |
1664 | | - | |
1665 | | - | |
1666 | | - | |
1667 | | - | |
1668 | | - | |
1669 | | - | |
1670 | | - | |
1671 | | - | |
| 1626 | + | |
| 1627 | + | |
| 1628 | + | |
| 1629 | + | |
| 1630 | + | |
| 1631 | + | |
| 1632 | + | |
| 1633 | + | |
| 1634 | + | |
| 1635 | + | |
| 1636 | + | |
1672 | 1637 | | |
1673 | | - | |
| 1638 | + | |
1674 | 1639 | | |
1675 | 1640 | | |
1676 | 1641 | | |
| |||
2215 | 2180 | | |
2216 | 2181 | | |
2217 | 2182 | | |
2218 | | - | |
| 2183 | + | |
2219 | 2184 | | |
2220 | | - | |
2221 | 2185 | | |
2222 | 2186 | | |
2223 | 2187 | | |
2224 | 2188 | | |
2225 | 2189 | | |
2226 | 2190 | | |
2227 | 2191 | | |
2228 | | - | |
2229 | | - | |
2230 | | - | |
2231 | | - | |
2232 | | - | |
| 2192 | + | |
| 2193 | + | |
| 2194 | + | |
| 2195 | + | |
| 2196 | + | |
| 2197 | + | |
| 2198 | + | |
2233 | 2199 | | |
2234 | 2200 | | |
0 commit comments