Download this file
| 1 | package provision |
| 2 | |
| 3 | // Record-write census entries for wake-latency-3, layered on |
| 4 | // serviceRunsWriteCensusInventory. Reviewed by the branch author; the census |
| 5 | // owner approves the card (census-ruling-wake-latency-3, |
| 6 | // docs/superpowers/notes/census-proposal-wake-latency-3.md). |
| 7 | // - buildStates.write's first try goes on the copy this agent last wrote, |
| 8 | // conditioned on its etag. Its one Put, the build-state object, is the |
| 9 | // same Put with the same condition rule (the etag the merge's state came |
| 10 | // with); its class is unchanged: nonrecord. |
| 11 | func wakeLatency3WriteCensusInventory() []censusEntry { |
| 12 | entries := append([]censusEntry(nil), serviceRunsWriteCensusInventory()...) |
| 13 | replacements := []censusEntry{ |
| 14 | {"internal/host/buildstate.go", "buildStates.write", "nonrecord", "sel:Put", "0c6620f6c436457c18142203cee157e4d2104c79304d1cfd1f159bd4fea40797"}, |
| 15 | } |
| 16 | for _, r := range replacements { |
| 17 | found := false |
| 18 | for i, e := range entries { |
| 19 | if e.File == r.File && e.Unit == r.Unit { |
| 20 | entries[i], found = r, true |
| 21 | } |
| 22 | } |
| 23 | if !found { |
| 24 | entries = append(entries, r) |
| 25 | } |
| 26 | } |
| 27 | return entries |
| 28 | } |
| 29 | |