outcomes.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332
  1. import {Outcome} from 'sentry/types';
  2. export function Outcomes() {
  3. return {
  4. start: '2022-07-02T19:00:00Z',
  5. end: '2022-07-04T18:35:00Z',
  6. intervals: [
  7. '2022-07-02T19:00:00Z',
  8. '2022-07-02T20:00:00Z',
  9. '2022-07-02T21:00:00Z',
  10. '2022-07-02T22:00:00Z',
  11. '2022-07-02T23:00:00Z',
  12. '2022-07-03T00:00:00Z',
  13. '2022-07-03T01:00:00Z',
  14. '2022-07-03T02:00:00Z',
  15. '2022-07-03T03:00:00Z',
  16. '2022-07-03T04:00:00Z',
  17. '2022-07-03T05:00:00Z',
  18. '2022-07-03T06:00:00Z',
  19. '2022-07-03T07:00:00Z',
  20. '2022-07-03T08:00:00Z',
  21. '2022-07-03T09:00:00Z',
  22. '2022-07-03T10:00:00Z',
  23. '2022-07-03T11:00:00Z',
  24. '2022-07-03T12:00:00Z',
  25. '2022-07-03T13:00:00Z',
  26. '2022-07-03T14:00:00Z',
  27. '2022-07-03T15:00:00Z',
  28. '2022-07-03T16:00:00Z',
  29. '2022-07-03T17:00:00Z',
  30. '2022-07-03T18:00:00Z',
  31. '2022-07-03T19:00:00Z',
  32. '2022-07-03T20:00:00Z',
  33. '2022-07-03T21:00:00Z',
  34. '2022-07-03T22:00:00Z',
  35. '2022-07-03T23:00:00Z',
  36. '2022-07-04T00:00:00Z',
  37. '2022-07-04T01:00:00Z',
  38. '2022-07-04T02:00:00Z',
  39. '2022-07-04T03:00:00Z',
  40. '2022-07-04T04:00:00Z',
  41. '2022-07-04T05:00:00Z',
  42. '2022-07-04T06:00:00Z',
  43. '2022-07-04T07:00:00Z',
  44. '2022-07-04T08:00:00Z',
  45. '2022-07-04T09:00:00Z',
  46. '2022-07-04T10:00:00Z',
  47. '2022-07-04T11:00:00Z',
  48. '2022-07-04T12:00:00Z',
  49. '2022-07-04T13:00:00Z',
  50. '2022-07-04T14:00:00Z',
  51. '2022-07-04T15:00:00Z',
  52. '2022-07-04T16:00:00Z',
  53. '2022-07-04T17:00:00Z',
  54. '2022-07-04T18:00:00Z',
  55. ],
  56. groups: [
  57. {
  58. by: {outcome: 'client_discard'},
  59. totals: {'sum(quantity)': 1231344},
  60. series: {
  61. 'sum(quantity)': [
  62. 0, 1, 1, 1, 94, 1, 1, 0, 566, 179, 1, 1, 1, 0, 222, 6, 287, 465, 83, 7, 0,
  63. 1835, 145, 0, 0, 1, 0, 0, 0, 1, 0, 2, 0, 1, 849, 25331, 147200, 220014,
  64. 189001, 99590, 81288, 134522, 151489, 128585, 41643, 6404, 145, 1381,
  65. ],
  66. },
  67. },
  68. {
  69. by: {outcome: 'rate_limited'},
  70. totals: {'sum(quantity)': 1335469},
  71. series: {
  72. 'sum(quantity)': [
  73. 0, 0, 0, 0, 191, 0, 0, 0, 385, 0, 0, 0, 0, 0, 345, 0, 445, 276, 56, 0, 0,
  74. 1101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 656, 45581, 143705, 168077, 168143,
  75. 127756, 114636, 148322, 162904, 153069, 80977, 17299, 512, 1033,
  76. ],
  77. },
  78. },
  79. {
  80. by: {outcome: 'accepted'},
  81. totals: {'sum(quantity)': 19707040},
  82. series: {
  83. 'sum(quantity)': [
  84. 294117, 281850, 263003, 259581, 246831, 278464, 290677, 242770, 242559,
  85. 248963, 250920, 268994, 296129, 308165, 302398, 301891, 316698, 333888,
  86. 336204, 329735, 323717, 317564, 312407, 307008, 301681, 299652, 276849,
  87. 274486, 298985, 368148, 444434, 423119, 416110, 464443, 526387, 692300,
  88. 720026, 719854, 719658, 719237, 717889, 719757, 718147, 719843, 712099,
  89. 643028, 545065, 311310,
  90. ],
  91. },
  92. },
  93. {
  94. by: {outcome: 'filtered'},
  95. totals: {'sum(quantity)': 13974},
  96. series: {
  97. 'sum(quantity)': [
  98. 250, 278, 247, 251, 270, 269, 285, 256, 248, 267, 326, 335, 258, 255, 269,
  99. 292, 271, 246, 254, 285, 291, 295, 260, 292, 242, 318, 326, 302, 299, 299,
  100. 321, 310, 320, 371, 323, 331, 286, 256, 275, 316, 294, 295, 301, 282, 391,
  101. 358, 391, 217,
  102. ],
  103. },
  104. },
  105. {
  106. by: {outcome: 'invalid'},
  107. totals: {'sum(quantity)': 38},
  108. series: {
  109. 'sum(quantity)': [
  110. 0, 1, 2, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 3, 2, 0, 0, 0, 0,
  111. 0, 0, 1, 2, 0, 0, 0, 2, 1, 1, 1, 2, 2, 0, 0, 1, 1, 4, 3, 0, 0, 0,
  112. ],
  113. },
  114. },
  115. ],
  116. };
  117. }
  118. export function OutcomesWithReason() {
  119. return {
  120. start: '2022-07-02T19:00:00Z',
  121. end: '2022-07-04T18:35:00Z',
  122. intervals: [
  123. '2022-07-02T19:00:00Z',
  124. '2022-07-02T20:00:00Z',
  125. '2022-07-02T21:00:00Z',
  126. '2022-07-02T22:00:00Z',
  127. '2022-07-02T23:00:00Z',
  128. '2022-07-03T00:00:00Z',
  129. '2022-07-03T01:00:00Z',
  130. '2022-07-03T02:00:00Z',
  131. '2022-07-03T03:00:00Z',
  132. '2022-07-03T04:00:00Z',
  133. '2022-07-03T05:00:00Z',
  134. '2022-07-03T06:00:00Z',
  135. '2022-07-03T07:00:00Z',
  136. '2022-07-03T08:00:00Z',
  137. '2022-07-03T09:00:00Z',
  138. '2022-07-03T10:00:00Z',
  139. '2022-07-03T11:00:00Z',
  140. '2022-07-03T12:00:00Z',
  141. '2022-07-03T13:00:00Z',
  142. '2022-07-03T14:00:00Z',
  143. '2022-07-03T15:00:00Z',
  144. '2022-07-03T16:00:00Z',
  145. '2022-07-03T17:00:00Z',
  146. '2022-07-03T18:00:00Z',
  147. '2022-07-03T19:00:00Z',
  148. '2022-07-03T20:00:00Z',
  149. '2022-07-03T21:00:00Z',
  150. '2022-07-03T22:00:00Z',
  151. '2022-07-03T23:00:00Z',
  152. '2022-07-04T00:00:00Z',
  153. '2022-07-04T01:00:00Z',
  154. '2022-07-04T02:00:00Z',
  155. '2022-07-04T03:00:00Z',
  156. '2022-07-04T04:00:00Z',
  157. '2022-07-04T05:00:00Z',
  158. '2022-07-04T06:00:00Z',
  159. '2022-07-04T07:00:00Z',
  160. '2022-07-04T08:00:00Z',
  161. '2022-07-04T09:00:00Z',
  162. '2022-07-04T10:00:00Z',
  163. '2022-07-04T11:00:00Z',
  164. '2022-07-04T12:00:00Z',
  165. '2022-07-04T13:00:00Z',
  166. '2022-07-04T14:00:00Z',
  167. '2022-07-04T15:00:00Z',
  168. '2022-07-04T16:00:00Z',
  169. '2022-07-04T17:00:00Z',
  170. '2022-07-04T18:00:00Z',
  171. ],
  172. groups: [
  173. {
  174. by: {outcome: 'client_discard', reason: 'sample_rate'},
  175. totals: {'sum(quantity)': 1231333},
  176. series: {
  177. 'sum(quantity)': [
  178. 0, 1, 1, 1, 94, 1, 1, 0, 566, 179, 1, 1, 1, 0, 222, 6, 287, 465, 83, 7, 0,
  179. 1835, 145, 0, 0, 1, 0, 0, 0, 1, 0, 2, 0, 1, 849, 25331, 147200, 220014,
  180. 189001, 99590, 81288, 134522, 151489, 128585, 41643, 6404, 135, 1380,
  181. ],
  182. },
  183. },
  184. {
  185. by: {outcome: 'client_discard', reason: 'network_error'},
  186. totals: {'sum(quantity)': 11},
  187. series: {
  188. 'sum(quantity)': [
  189. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  190. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 1,
  191. ],
  192. },
  193. },
  194. {
  195. by: {outcome: 'rate_limited', reason: 'project_abuse_limit'},
  196. totals: {'sum(quantity)': 1335469},
  197. series: {
  198. 'sum(quantity)': [
  199. 0, 0, 0, 0, 191, 0, 0, 0, 385, 0, 0, 0, 0, 0, 345, 0, 445, 276, 56, 0, 0,
  200. 1101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 656, 45581, 143705, 168077, 168143,
  201. 127756, 114636, 148322, 162904, 153069, 80977, 17299, 512, 1033,
  202. ],
  203. },
  204. },
  205. {
  206. by: {outcome: 'accepted', reason: 'none'},
  207. totals: {'sum(quantity)': 19707040},
  208. series: {
  209. 'sum(quantity)': [
  210. 294117, 281850, 263003, 259581, 246831, 278464, 290677, 242770, 242559,
  211. 248963, 250920, 268994, 296129, 308165, 302398, 301891, 316698, 333888,
  212. 336204, 329735, 323717, 317564, 312407, 307008, 301681, 299652, 276849,
  213. 274486, 298985, 368148, 444434, 423119, 416110, 464443, 526387, 692300,
  214. 720026, 719854, 719658, 719237, 717889, 719757, 718147, 719843, 712099,
  215. 643028, 545065, 311310,
  216. ],
  217. },
  218. },
  219. {
  220. by: {outcome: 'filtered', reason: 'Sampled:1'},
  221. totals: {'sum(quantity)': 13956},
  222. series: {
  223. 'sum(quantity)': [
  224. 247, 276, 244, 241, 270, 269, 285, 256, 248, 267, 326, 335, 258, 255, 269,
  225. 292, 271, 246, 254, 285, 291, 295, 260, 292, 242, 318, 326, 302, 299, 299,
  226. 321, 310, 320, 371, 323, 331, 286, 256, 275, 316, 294, 295, 301, 282, 391,
  227. 358, 391, 217,
  228. ],
  229. },
  230. },
  231. {
  232. by: {outcome: 'filtered', reason: 'Sampled:4'},
  233. totals: {'sum(quantity)': 3},
  234. series: {
  235. 'sum(quantity)': [
  236. 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  237. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  238. ],
  239. },
  240. },
  241. {
  242. by: {outcome: 'filtered', reason: 'localhost'},
  243. totals: {'sum(quantity)': 4},
  244. series: {
  245. 'sum(quantity)': [
  246. 1, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  247. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  248. ],
  249. },
  250. },
  251. {
  252. by: {outcome: 'filtered', reason: 'legacy-browsers'},
  253. totals: {'sum(quantity)': 11},
  254. series: {
  255. 'sum(quantity)': [
  256. 1, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  257. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  258. ],
  259. },
  260. },
  261. {
  262. by: {outcome: 'invalid', reason: 'too_large'},
  263. totals: {'sum(quantity)': 37},
  264. series: {
  265. 'sum(quantity)': [
  266. 0, 1, 1, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 3, 2, 0, 0, 0, 0,
  267. 0, 0, 1, 2, 0, 0, 0, 2, 1, 1, 1, 2, 2, 0, 0, 1, 1, 4, 3, 0, 0, 0,
  268. ],
  269. },
  270. },
  271. {
  272. by: {outcome: 'invalid', reason: 'invalid_transaction'},
  273. totals: {'sum(quantity)': 1},
  274. series: {
  275. 'sum(quantity)': [
  276. 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  277. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  278. ],
  279. },
  280. },
  281. ],
  282. };
  283. }
  284. export function OutcomesWithLowProcessedEvents() {
  285. const otherOutcomesGroups = TestStubs.Outcomes().groups.filter(
  286. group => group.by.outcome !== 'accepted' && group.by.outcome !== 'client_discard'
  287. );
  288. return {
  289. ...TestStubs.Outcomes(),
  290. groups: [
  291. ...otherOutcomesGroups,
  292. {
  293. by: {outcome: 'accepted'},
  294. totals: {'sum(quantity)': 1231342},
  295. series: {
  296. 'sum(quantity)': [
  297. 0, 0, 0, 1, 94, 1, 1, 0, 566, 179, 1, 1, 1, 0, 222, 6, 287, 465, 83, 7, 0,
  298. 1835, 145, 0, 0, 1, 0, 0, 0, 1, 0, 2, 0, 1, 849, 25331, 147200, 220014,
  299. 189001, 99590, 81288, 134522, 151489, 128585, 41643, 6404, 145, 1381,
  300. ],
  301. },
  302. },
  303. {
  304. by: {outcome: 'client_discard'},
  305. totals: {'sum(quantity)': 18868070},
  306. series: {
  307. 'sum(quantity)': [
  308. 0, 0, 0, 259581, 246831, 278464, 290677, 242770, 242559, 248963, 250920,
  309. 268994, 296129, 308165, 302398, 301891, 316698, 333888, 336204, 329735,
  310. 323717, 317564, 312407, 307008, 301681, 299652, 276849, 274486, 298985,
  311. 368148, 444434, 423119, 416110, 464443, 526387, 692300, 720026, 719854,
  312. 719658, 719237, 717889, 719757, 718147, 719843, 712099, 643028, 545065,
  313. 311310,
  314. ],
  315. },
  316. },
  317. ],
  318. };
  319. }
  320. export function OutcomesWithoutClientDiscarded() {
  321. return {
  322. ...TestStubs.OutcomesWithReason(),
  323. groups: TestStubs.OutcomesWithReason().groups.filter(
  324. group => group.by.outcome !== Outcome.CLIENT_DISCARD
  325. ),
  326. };
  327. }