metrics.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334
  1. // Totals will not be correct for all aggregation functions.
  2. // Consider adding aggregation specific fixture (e.g. MetricsP75Field) if your test depends on it.
  3. export function MetricsField({field, ...rest} = {}) {
  4. return {
  5. start: '2021-12-01T16:15:00Z',
  6. end: '2021-12-02T16:15:00Z',
  7. query: '',
  8. intervals: [
  9. '2021-12-01T16:15:00Z',
  10. '2021-12-01T16:30:00Z',
  11. '2021-12-01T16:45:00Z',
  12. '2021-12-01T17:00:00Z',
  13. '2021-12-01T17:15:00Z',
  14. '2021-12-01T17:30:00Z',
  15. '2021-12-01T17:45:00Z',
  16. '2021-12-01T18:00:00Z',
  17. '2021-12-01T18:15:00Z',
  18. '2021-12-01T18:30:00Z',
  19. '2021-12-01T18:45:00Z',
  20. '2021-12-01T19:00:00Z',
  21. '2021-12-01T19:15:00Z',
  22. '2021-12-01T19:30:00Z',
  23. '2021-12-01T19:45:00Z',
  24. '2021-12-01T20:00:00Z',
  25. '2021-12-01T20:15:00Z',
  26. '2021-12-01T20:30:00Z',
  27. '2021-12-01T20:45:00Z',
  28. '2021-12-01T21:00:00Z',
  29. '2021-12-01T21:15:00Z',
  30. '2021-12-01T21:30:00Z',
  31. '2021-12-01T21:45:00Z',
  32. '2021-12-01T22:00:00Z',
  33. '2021-12-01T22:15:00Z',
  34. '2021-12-01T22:30:00Z',
  35. '2021-12-01T22:45:00Z',
  36. '2021-12-01T23:00:00Z',
  37. '2021-12-01T23:15:00Z',
  38. '2021-12-01T23:30:00Z',
  39. '2021-12-01T23:45:00Z',
  40. '2021-12-02T00:00:00Z',
  41. '2021-12-02T00:15:00Z',
  42. '2021-12-02T00:30:00Z',
  43. '2021-12-02T00:45:00Z',
  44. '2021-12-02T01:00:00Z',
  45. '2021-12-02T01:15:00Z',
  46. '2021-12-02T01:30:00Z',
  47. '2021-12-02T01:45:00Z',
  48. '2021-12-02T02:00:00Z',
  49. '2021-12-02T02:15:00Z',
  50. '2021-12-02T02:30:00Z',
  51. '2021-12-02T02:45:00Z',
  52. '2021-12-02T03:00:00Z',
  53. '2021-12-02T03:15:00Z',
  54. '2021-12-02T03:30:00Z',
  55. '2021-12-02T03:45:00Z',
  56. '2021-12-02T04:00:00Z',
  57. '2021-12-02T04:15:00Z',
  58. '2021-12-02T04:30:00Z',
  59. '2021-12-02T04:45:00Z',
  60. '2021-12-02T05:00:00Z',
  61. '2021-12-02T05:15:00Z',
  62. '2021-12-02T05:30:00Z',
  63. '2021-12-02T05:45:00Z',
  64. '2021-12-02T06:00:00Z',
  65. '2021-12-02T06:15:00Z',
  66. '2021-12-02T06:30:00Z',
  67. '2021-12-02T06:45:00Z',
  68. '2021-12-02T07:00:00Z',
  69. '2021-12-02T07:15:00Z',
  70. '2021-12-02T07:30:00Z',
  71. '2021-12-02T07:45:00Z',
  72. '2021-12-02T08:00:00Z',
  73. '2021-12-02T08:15:00Z',
  74. '2021-12-02T08:30:00Z',
  75. '2021-12-02T08:45:00Z',
  76. '2021-12-02T09:00:00Z',
  77. '2021-12-02T09:15:00Z',
  78. '2021-12-02T09:30:00Z',
  79. '2021-12-02T09:45:00Z',
  80. '2021-12-02T10:00:00Z',
  81. '2021-12-02T10:15:00Z',
  82. '2021-12-02T10:30:00Z',
  83. '2021-12-02T10:45:00Z',
  84. '2021-12-02T11:00:00Z',
  85. '2021-12-02T11:15:00Z',
  86. '2021-12-02T11:30:00Z',
  87. '2021-12-02T11:45:00Z',
  88. '2021-12-02T12:00:00Z',
  89. '2021-12-02T12:15:00Z',
  90. '2021-12-02T12:30:00Z',
  91. '2021-12-02T12:45:00Z',
  92. '2021-12-02T13:00:00Z',
  93. '2021-12-02T13:15:00Z',
  94. '2021-12-02T13:30:00Z',
  95. '2021-12-02T13:45:00Z',
  96. '2021-12-02T14:00:00Z',
  97. '2021-12-02T14:15:00Z',
  98. '2021-12-02T14:30:00Z',
  99. '2021-12-02T14:45:00Z',
  100. '2021-12-02T15:00:00Z',
  101. '2021-12-02T15:15:00Z',
  102. '2021-12-02T15:30:00Z',
  103. '2021-12-02T15:45:00Z',
  104. '2021-12-02T16:00:00Z',
  105. ],
  106. groups: [
  107. {
  108. by: {},
  109. totals: {
  110. [field]: 51292.95404741901,
  111. },
  112. series: {
  113. [field]: [
  114. 443.6200417187068, 471.7512262596214, 632.5356294251225, 538.6063865509535,
  115. 524.4706847412767, 552.1308328866158, 491.4847951529728, 540.5649544109818,
  116. 430.31622543090765, 513.2803858330382, 498.20598088568426, 503.9482408241235,
  117. 496.3081254057422, 530.4951893480746, 510.9472734431329, 534.2121619563322,
  118. 580.24191602519, 582.2308981360263, 628.6978339387008, 569.093042423482,
  119. 625.5703758567254, 529.286046746119, 491.3038256504387, 548.2822063955006,
  120. 569.3739373104116, 579.5492159758986, 483.9070230718182, 529.9636517032774,
  121. 554.3095224302028, 546.8567462459974, 574.3167313021837, 578.9293435905665,
  122. 561.8965496805288, 576.137674866579, 529.6122522035633, 513.9424504410429,
  123. 543.8130703563698, 597.6542214420452, 510.1568375049254, 510.7187029189223,
  124. 433.78137928589973, 539.3227194785493, 436.44338223053234, 607.1985174516628,
  125. 524.8753880194068, 501.7107697990002, 514.0727518760925, 541.2173843758375,
  126. 556.0898842681038, 535.6274044037233, 475.75355633285346, 587.3256393771101,
  127. 494.61335151920775, 643.5242484747213, 519.9786827806394, 534.7536939750254,
  128. 570.1995703475561, 452.91363051761834, 613.7709480932585, 520.9545797679832,
  129. 497.2156651159481, 625.7054147147829, 490.6365344675922, 592.1175307910397,
  130. 564.6276355603038, 514.8572640893523, 484.47902185133046, 597.7622625233755,
  131. 559.1799635501319, 571.7109630540343, 513.212778566814, 549.1636248727518,
  132. 462.32331107946504, 551.0869305265527, 576.872028698758, 636.4899532813711,
  133. 479.0486254908533, 543.761081985735, 488.9454132823779, 536.1309059508741,
  134. 534.9354940989901, 567.6136279473333, 458.8870965420118, 514.9547377042924,
  135. 525.3278756572803, 502.05863531061544, 575.8454944963837, 524.476069016465,
  136. 431.1190903001866, 543.5139624946099, 598.8881832598959, 510.5100592771207,
  137. 541.151976697214, 550.0881388522994, 485.26355742991586, 460.14344601636975,
  138. ],
  139. },
  140. },
  141. ],
  142. ...rest,
  143. };
  144. }
  145. export function MetricsTotalCountByReleaseIn24h() {
  146. return {
  147. query:
  148. 'release:7a82c130be9143361f20bc77252df783cf91e4fc OR release:e102abb2c46e7fe8686441091005c12aed90da99',
  149. intervals: [
  150. '2021-03-17T10:00:00Z',
  151. '2021-03-17T11:00:00Z',
  152. '2021-03-17T12:00:00Z',
  153. '2021-03-17T13:00:00Z',
  154. '2021-03-17T14:00:00Z',
  155. '2021-03-17T15:00:00Z',
  156. '2021-03-17T16:00:00Z',
  157. '2021-03-17T17:00:00Z',
  158. '2021-03-17T18:00:00Z',
  159. '2021-03-17T19:00:00Z',
  160. '2021-03-17T20:00:00Z',
  161. '2021-03-17T21:00:00Z',
  162. '2021-03-17T22:00:00Z',
  163. '2021-03-17T23:00:00Z',
  164. '2021-03-18T00:00:00Z',
  165. '2021-03-18T01:00:00Z',
  166. '2021-03-18T02:00:00Z',
  167. '2021-03-18T03:00:00Z',
  168. '2021-03-18T04:00:00Z',
  169. '2021-03-18T05:00:00Z',
  170. '2021-03-18T06:00:00Z',
  171. '2021-03-18T07:00:00Z',
  172. '2021-03-18T08:00:00Z',
  173. '2021-03-18T09:00:00Z',
  174. ],
  175. groups: [
  176. {
  177. by: {project: 123, release: '7a82c130be9143361f20bc77252df783cf91e4fc'},
  178. totals: {'sum(session)': 219826},
  179. series: {
  180. 'sum(session)': [
  181. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3444, 14912, 15649, 18019, 16726,
  182. 17540, 16970, 25015, 34686, 46434, 10431,
  183. ],
  184. },
  185. },
  186. {
  187. by: {release: 'e102abb2c46e7fe8686441091005c12aed90da99', project: 123},
  188. totals: {'sum(session)': 6320},
  189. series: {
  190. 'sum(session)': [
  191. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5809, 400, 22, 26, 12, 19, 8, 0, 19, 5,
  192. 0,
  193. ],
  194. },
  195. },
  196. ],
  197. };
  198. }
  199. export function MetricsSessionUserCountByStatusByRelease() {
  200. return {
  201. start: '2022-01-15T00:00:00Z',
  202. end: '2022-01-29T00:00:00Z',
  203. query: '',
  204. intervals: [
  205. '2022-01-15T00:00:00Z',
  206. '2022-01-16T00:00:00Z',
  207. '2022-01-17T00:00:00Z',
  208. '2022-01-18T00:00:00Z',
  209. '2022-01-19T00:00:00Z',
  210. '2022-01-20T00:00:00Z',
  211. '2022-01-21T00:00:00Z',
  212. '2022-01-22T00:00:00Z',
  213. '2022-01-23T00:00:00Z',
  214. '2022-01-24T00:00:00Z',
  215. '2022-01-25T00:00:00Z',
  216. '2022-01-26T00:00:00Z',
  217. '2022-01-27T00:00:00Z',
  218. '2022-01-28T00:00:00Z',
  219. ],
  220. groups: [
  221. {
  222. by: {'session.status': 'crashed', release: '1'},
  223. totals: {
  224. 'sum(sentry.sessions.session)': 34,
  225. 'count_unique(sentry.sessions.user)': 1,
  226. },
  227. series: {
  228. 'sum(sentry.sessions.session)': [0, 0, 0, 0, 0, 0, 0, 0, 0, 23, 11, 0, 0, 0],
  229. 'count_unique(sentry.sessions.user)': [
  230. 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0,
  231. ],
  232. },
  233. },
  234. {
  235. by: {'session.status': 'abnormal', release: '1'},
  236. totals: {
  237. 'sum(sentry.sessions.session)': 1,
  238. 'count_unique(sentry.sessions.user)': 1,
  239. },
  240. series: {
  241. 'sum(sentry.sessions.session)': [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
  242. 'count_unique(sentry.sessions.user)': [
  243. 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  244. ],
  245. },
  246. },
  247. {
  248. by: {'session.status': 'errored', release: '1'},
  249. totals: {
  250. 'sum(sentry.sessions.session)': 451,
  251. 'count_unique(sentry.sessions.user)': 2,
  252. },
  253. series: {
  254. 'sum(sentry.sessions.session)': [0, 0, 0, 0, 0, 37, 0, 0, 0, 335, 79, 0, 0, 0],
  255. 'count_unique(sentry.sessions.user)': [
  256. 0, 0, 0, 0, 0, 1, 0, 0, 0, 2, 2, 0, 0, 0,
  257. ],
  258. },
  259. },
  260. {
  261. by: {'session.status': 'healthy', release: '1'},
  262. totals: {
  263. 'sum(sentry.sessions.session)': 5058,
  264. 'count_unique(sentry.sessions.user)': 3,
  265. },
  266. series: {
  267. 'sum(sentry.sessions.session)': [
  268. 0, 0, 0, 0, 0, 2503, 661, 0, 0, 1464, 430, 0, 0, 0,
  269. ],
  270. 'count_unique(sentry.sessions.user)': [
  271. 0, 0, 0, 0, 0, 3, 3, 0, 0, 1, 1, 0, 0, 0,
  272. ],
  273. },
  274. },
  275. {
  276. by: {'session.status': 'crashed', release: '2'},
  277. totals: {
  278. 'sum(sentry.sessions.session)': 35,
  279. 'count_unique(sentry.sessions.user)': 2,
  280. },
  281. series: {
  282. 'sum(sentry.sessions.session)': [1, 0, 0, 0, 0, 0, 0, 0, 0, 23, 11, 0, 0, 0],
  283. 'count_unique(sentry.sessions.user)': [
  284. 1, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0,
  285. ],
  286. },
  287. },
  288. {
  289. by: {'session.status': 'abnormal', release: '2'},
  290. totals: {
  291. 'sum(sentry.sessions.session)': 1,
  292. 'count_unique(sentry.sessions.user)': 1,
  293. },
  294. series: {
  295. 'sum(sentry.sessions.session)': [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
  296. 'count_unique(sentry.sessions.user)': [
  297. 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  298. ],
  299. },
  300. },
  301. {
  302. by: {'session.status': 'errored', release: '2'},
  303. totals: {
  304. 'sum(sentry.sessions.session)': 452,
  305. 'count_unique(sentry.sessions.user)': 1,
  306. },
  307. series: {
  308. 'sum(sentry.sessions.session)': [1, 0, 0, 0, 0, 37, 0, 0, 0, 335, 79, 0, 0, 0],
  309. 'count_unique(sentry.sessions.user)': [
  310. 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0,
  311. ],
  312. },
  313. },
  314. {
  315. by: {'session.status': 'healthy', release: '2'},
  316. totals: {
  317. 'sum(sentry.sessions.session)': 5059,
  318. 'count_unique(sentry.sessions.user)': 10,
  319. },
  320. series: {
  321. 'sum(sentry.sessions.session)': [
  322. 1, 0, 0, 0, 0, 2503, 661, 0, 0, 1464, 430, 0, 0, 0,
  323. ],
  324. 'count_unique(sentry.sessions.user)': [
  325. 1, 0, 0, 0, 0, 10, 3, 0, 0, 4, 3, 0, 0, 0,
  326. ],
  327. },
  328. },
  329. ],
  330. };
  331. }