ComputeSavings applies the counterfactual model. TotalHours sums only the two time-valued levers (automation + context-switch); ContextTokens (tokens) and AddressableCount (a count) are reported separately by design. ContextTokens is NOT computed here — it is derived from real file sizes by BuildSta
(c Constants, n Counts)
| 76 | // ContextTokens is NOT computed here — it is derived from real file sizes by |
| 77 | // BuildStats and assigned after this call. |
| 78 | func ComputeSavings(c Constants, n Counts) Savings { |
| 79 | auto := float64(n.AutoRuns+n.OwnerTicks) * c.MinutesPerUnattendedRun / 60.0 |
| 80 | sw := float64(n.ResumeLookups+n.RefLookups) * c.MinutesPerContextSwitch / 60.0 |
| 81 | total := auto + sw |
| 82 | return Savings{ |
| 83 | AutomationHours: auto, |
| 84 | ContextSwitchHours: sw, |
| 85 | AddressableCount: n.CrossLookups + n.RefLookups, |
| 86 | TotalHours: total, |
| 87 | TotalDollars: total * c.DollarPerHour, |
| 88 | } |
| 89 | } |
no outgoing calls