Commit 3318699
fix(admin): derive EM experiment KPI total from bucketed counts, not metadata
The EM EXPERIMENT_COUNT total (and its workspace roll-up) was sourced from
`numberOfExperiments` metadata while the chart series was built from
experiments bucketed by start_server_timestamp. When those disagree, the
adoption KPI total didn't equal the cumulative chart sum. Derive `total`
from the same counts map that feeds the series so they always match.
Add a regression test covering the metadata-disagrees case.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent a825fcd commit 3318699
2 files changed
Lines changed: 56 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
851 | 851 | | |
852 | 852 | | |
853 | 853 | | |
854 | | - | |
855 | | - | |
856 | | - | |
| 854 | + | |
857 | 855 | | |
858 | 856 | | |
859 | 857 | | |
860 | 858 | | |
861 | 859 | | |
862 | 860 | | |
863 | 861 | | |
864 | | - | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
865 | 869 | | |
866 | 870 | | |
867 | 871 | | |
| |||
1017 | 1021 | | |
1018 | 1022 | | |
1019 | 1023 | | |
1020 | | - | |
1021 | | - | |
1022 | | - | |
| 1024 | + | |
1023 | 1025 | | |
1024 | 1026 | | |
1025 | 1027 | | |
| |||
1045 | 1047 | | |
1046 | 1048 | | |
1047 | 1049 | | |
1048 | | - | |
1049 | | - | |
1050 | | - | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
1051 | 1053 | | |
1052 | 1054 | | |
1053 | 1055 | | |
| |||
1128 | 1130 | | |
1129 | 1131 | | |
1130 | 1132 | | |
1131 | | - | |
1132 | | - | |
| 1133 | + | |
1133 | 1134 | | |
1134 | 1135 | | |
1135 | 1136 | | |
| |||
1138 | 1139 | | |
1139 | 1140 | | |
1140 | 1141 | | |
1141 | | - | |
1142 | | - | |
1143 | | - | |
| 1142 | + | |
1144 | 1143 | | |
1145 | 1144 | | |
1146 | 1145 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
212 | 212 | | |
213 | 213 | | |
214 | 214 | | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
215 | 257 | | |
216 | 258 | | |
217 | 259 | | |
| |||
0 commit comments