sessions.ts 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881
  1. import type {SessionApiResponse} from 'sentry/types/organization';
  2. export function SessionsFieldFixture(field: string): SessionApiResponse {
  3. return {
  4. start: '',
  5. end: '',
  6. query: '',
  7. intervals: [
  8. '2021-03-05T00:00:00Z',
  9. '2021-03-06T00:00:00Z',
  10. '2021-03-07T00:00:00Z',
  11. '2021-03-08T00:00:00Z',
  12. '2021-03-09T00:00:00Z',
  13. '2021-03-10T00:00:00Z',
  14. '2021-03-11T00:00:00Z',
  15. '2021-03-12T00:00:00Z',
  16. '2021-03-13T00:00:00Z',
  17. '2021-03-14T00:00:00Z',
  18. '2021-03-15T00:00:00Z',
  19. '2021-03-16T00:00:00Z',
  20. '2021-03-17T00:00:00Z',
  21. '2021-03-18T00:00:00Z',
  22. ],
  23. groups: [
  24. {
  25. by: {},
  26. totals: {
  27. [field]: 492,
  28. },
  29. series: {
  30. [field]: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 490],
  31. },
  32. },
  33. ],
  34. };
  35. }
  36. export function SessionUserCountByStatusFixture(): SessionApiResponse {
  37. return {
  38. start: '',
  39. end: '',
  40. query: '',
  41. intervals: [
  42. '2021-03-05T00:00:00Z',
  43. '2021-03-06T00:00:00Z',
  44. '2021-03-07T00:00:00Z',
  45. '2021-03-08T00:00:00Z',
  46. '2021-03-09T00:00:00Z',
  47. '2021-03-10T00:00:00Z',
  48. '2021-03-11T00:00:00Z',
  49. '2021-03-12T00:00:00Z',
  50. '2021-03-13T00:00:00Z',
  51. '2021-03-14T00:00:00Z',
  52. '2021-03-15T00:00:00Z',
  53. '2021-03-16T00:00:00Z',
  54. '2021-03-17T00:00:00Z',
  55. '2021-03-18T00:00:00Z',
  56. ],
  57. groups: [
  58. {
  59. by: {
  60. 'session.status': 'crashed',
  61. },
  62. totals: {
  63. 'sum(session)': 492,
  64. 'count_unique(user)': 92,
  65. 'p50(session.duration)': 195,
  66. },
  67. series: {
  68. 'sum(session)': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 490],
  69. 'count_unique(user)': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 90],
  70. 'p50(session.duration)': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 193],
  71. },
  72. },
  73. {
  74. by: {
  75. 'session.status': 'healthy',
  76. },
  77. totals: {
  78. 'sum(session)': 9260,
  79. 'count_unique(user)': 260,
  80. 'p50(session.duration)': 195,
  81. },
  82. series: {
  83. 'sum(session)': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9167, 93],
  84. 'count_unique(user)': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 258],
  85. 'p50(session.duration)': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 193],
  86. },
  87. },
  88. {
  89. by: {
  90. 'session.status': 'abnormal',
  91. },
  92. totals: {
  93. 'sum(session)': 0,
  94. 'count_unique(user)': 0,
  95. 'p50(session.duration)': 0,
  96. },
  97. series: {
  98. 'sum(session)': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
  99. 'count_unique(user)': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
  100. 'p50(session.duration)': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
  101. },
  102. },
  103. {
  104. by: {
  105. 'session.status': 'errored',
  106. },
  107. totals: {
  108. 'sum(session)': 99,
  109. 'count_unique(user)': 9,
  110. 'p50(session.duration)': 195,
  111. },
  112. series: {
  113. 'sum(session)': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 99, 0],
  114. 'count_unique(user)': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 8],
  115. 'p50(session.duration)': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 194],
  116. },
  117. },
  118. ],
  119. };
  120. }
  121. // this one is higher than the first one
  122. // first one can be used as "This Release" and the second one works nicely as "All Releases"
  123. export function SessionUserCountByStatus2Fixture(): SessionApiResponse {
  124. return {
  125. start: '',
  126. end: '',
  127. query: '',
  128. intervals: [
  129. '2021-03-05T00:00:00Z',
  130. '2021-03-06T00:00:00Z',
  131. '2021-03-07T00:00:00Z',
  132. '2021-03-08T00:00:00Z',
  133. '2021-03-09T00:00:00Z',
  134. '2021-03-10T00:00:00Z',
  135. '2021-03-11T00:00:00Z',
  136. '2021-03-12T00:00:00Z',
  137. '2021-03-13T00:00:00Z',
  138. '2021-03-14T00:00:00Z',
  139. '2021-03-15T00:00:00Z',
  140. '2021-03-16T00:00:00Z',
  141. '2021-03-17T00:00:00Z',
  142. '2021-03-18T00:00:00Z',
  143. ],
  144. groups: [
  145. {
  146. by: {
  147. 'session.status': 'crashed',
  148. },
  149. totals: {
  150. 'sum(session)': 992,
  151. 'count_unique(user)': 92,
  152. 'p50(session.duration)': 802,
  153. },
  154. series: {
  155. 'sum(session)': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 990],
  156. 'count_unique(user)': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 90],
  157. 'p50(session.duration)': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 800],
  158. },
  159. },
  160. {
  161. by: {
  162. 'session.status': 'abnormal',
  163. },
  164. totals: {
  165. 'sum(session)': 0,
  166. 'count_unique(user)': 0,
  167. 'p50(session.duration)': 0,
  168. },
  169. series: {
  170. 'sum(session)': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
  171. 'count_unique(user)': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
  172. 'p50(session.duration)': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
  173. },
  174. },
  175. {
  176. by: {
  177. 'session.status': 'healthy',
  178. },
  179. totals: {
  180. 'sum(session)': 202136,
  181. 'count_unique(user)': 99136,
  182. 'p50(session.duration)': 108404,
  183. },
  184. series: {
  185. 'sum(session)': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3404, 198732],
  186. 'count_unique(user)': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 404, 98732],
  187. 'p50(session.duration)': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 404, 108000],
  188. },
  189. },
  190. {
  191. by: {
  192. 'session.status': 'errored',
  193. },
  194. totals: {
  195. 'sum(session)': 1954,
  196. 'count_unique(user)': 915,
  197. 'p50(session.duration)': 800,
  198. },
  199. series: {
  200. 'sum(session)': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 1914],
  201. 'count_unique(user)': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 914],
  202. 'p50(session.duration)': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 799],
  203. },
  204. },
  205. ],
  206. };
  207. }
  208. export function SessionStatusCountByReleaseInPeriodFixture(): SessionApiResponse {
  209. return {
  210. start: '',
  211. end: '',
  212. query:
  213. 'release:7a82c130be9143361f20bc77252df783cf91e4fc OR release:e102abb2c46e7fe8686441091005c12aed90da99',
  214. intervals: [
  215. '2021-03-05T00:00:00Z',
  216. '2021-03-06T00:00:00Z',
  217. '2021-03-07T00:00:00Z',
  218. '2021-03-08T00:00:00Z',
  219. '2021-03-09T00:00:00Z',
  220. '2021-03-10T00:00:00Z',
  221. '2021-03-11T00:00:00Z',
  222. '2021-03-12T00:00:00Z',
  223. '2021-03-13T00:00:00Z',
  224. '2021-03-14T00:00:00Z',
  225. '2021-03-15T00:00:00Z',
  226. '2021-03-16T00:00:00Z',
  227. '2021-03-17T00:00:00Z',
  228. '2021-03-18T00:00:00Z',
  229. ],
  230. groups: [
  231. {
  232. by: {
  233. project: 123,
  234. release: '7a82c130be9143361f20bc77252df783cf91e4fc',
  235. 'session.status': 'crashed',
  236. },
  237. totals: {'sum(session)': 492},
  238. series: {'sum(session)': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 490]},
  239. },
  240. {
  241. by: {
  242. 'session.status': 'healthy',
  243. project: 123,
  244. release: 'e102abb2c46e7fe8686441091005c12aed90da99',
  245. },
  246. totals: {'sum(session)': 6260},
  247. series: {'sum(session)': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5750, 510]},
  248. },
  249. {
  250. by: {
  251. project: 123,
  252. 'session.status': 'abnormal',
  253. release: 'e102abb2c46e7fe8686441091005c12aed90da99',
  254. },
  255. totals: {'sum(session)': 0},
  256. series: {'sum(session)': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]},
  257. },
  258. {
  259. by: {
  260. project: 123,
  261. release: 'e102abb2c46e7fe8686441091005c12aed90da99',
  262. 'session.status': 'crashed',
  263. },
  264. totals: {'sum(session)': 5},
  265. series: {'sum(session)': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0]},
  266. },
  267. {
  268. by: {
  269. project: 123,
  270. 'session.status': 'abnormal',
  271. release: '7a82c130be9143361f20bc77252df783cf91e4fc',
  272. },
  273. totals: {'sum(session)': 0},
  274. series: {'sum(session)': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]},
  275. },
  276. {
  277. by: {
  278. project: 123,
  279. release: 'e102abb2c46e7fe8686441091005c12aed90da99',
  280. 'session.status': 'errored',
  281. },
  282. totals: {'sum(session)': 59},
  283. series: {'sum(session)': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 59, 0]},
  284. },
  285. {
  286. by: {
  287. 'session.status': 'healthy',
  288. project: 123,
  289. release: '7a82c130be9143361f20bc77252df783cf91e4fc',
  290. },
  291. totals: {'sum(session)': 202136},
  292. series: {'sum(session)': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3404, 198732]},
  293. },
  294. {
  295. by: {
  296. project: 123,
  297. release: '7a82c130be9143361f20bc77252df783cf91e4fc',
  298. 'session.status': 'errored',
  299. },
  300. totals: {'sum(session)': 1954},
  301. series: {'sum(session)': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 1914]},
  302. },
  303. ],
  304. };
  305. }
  306. export function SessionStatusCountByProjectInPeriodFixture(): SessionApiResponse {
  307. return {
  308. start: '',
  309. end: '',
  310. query: '',
  311. intervals: [
  312. '2021-03-05T00:00:00Z',
  313. '2021-03-06T00:00:00Z',
  314. '2021-03-07T00:00:00Z',
  315. '2021-03-08T00:00:00Z',
  316. '2021-03-09T00:00:00Z',
  317. '2021-03-10T00:00:00Z',
  318. '2021-03-11T00:00:00Z',
  319. '2021-03-12T00:00:00Z',
  320. '2021-03-13T00:00:00Z',
  321. '2021-03-14T00:00:00Z',
  322. '2021-03-15T00:00:00Z',
  323. '2021-03-16T00:00:00Z',
  324. '2021-03-17T00:00:00Z',
  325. '2021-03-18T00:00:00Z',
  326. ],
  327. groups: [
  328. {
  329. by: {
  330. project: 123,
  331. 'session.status': 'crashed',
  332. },
  333. totals: {'sum(session)': 992},
  334. series: {'sum(session)': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 990]},
  335. },
  336. {
  337. by: {
  338. project: 123,
  339. 'session.status': 'healthy',
  340. },
  341. totals: {'sum(session)': 9260},
  342. series: {'sum(session)': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9167, 93]},
  343. },
  344. {
  345. by: {
  346. project: 123,
  347. 'session.status': 'abnormal',
  348. },
  349. totals: {'sum(session)': 0},
  350. series: {'sum(session)': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]},
  351. },
  352. {
  353. by: {
  354. project: 123,
  355. 'session.status': 'errored',
  356. },
  357. totals: {'sum(session)': 99},
  358. series: {'sum(session)': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 99, 0]},
  359. },
  360. ],
  361. };
  362. }
  363. export function SesssionTotalCountByReleaseIn24hFixture(): SessionApiResponse {
  364. return {
  365. start: '',
  366. end: '',
  367. query:
  368. 'release:7a82c130be9143361f20bc77252df783cf91e4fc OR release:e102abb2c46e7fe8686441091005c12aed90da99',
  369. intervals: [
  370. '2021-03-17T10:00:00Z',
  371. '2021-03-17T11:00:00Z',
  372. '2021-03-17T12:00:00Z',
  373. '2021-03-17T13:00:00Z',
  374. '2021-03-17T14:00:00Z',
  375. '2021-03-17T15:00:00Z',
  376. '2021-03-17T16:00:00Z',
  377. '2021-03-17T17:00:00Z',
  378. '2021-03-17T18:00:00Z',
  379. '2021-03-17T19:00:00Z',
  380. '2021-03-17T20:00:00Z',
  381. '2021-03-17T21:00:00Z',
  382. '2021-03-17T22:00:00Z',
  383. '2021-03-17T23:00:00Z',
  384. '2021-03-18T00:00:00Z',
  385. '2021-03-18T01:00:00Z',
  386. '2021-03-18T02:00:00Z',
  387. '2021-03-18T03:00:00Z',
  388. '2021-03-18T04:00:00Z',
  389. '2021-03-18T05:00:00Z',
  390. '2021-03-18T06:00:00Z',
  391. '2021-03-18T07:00:00Z',
  392. '2021-03-18T08:00:00Z',
  393. '2021-03-18T09:00:00Z',
  394. ],
  395. groups: [
  396. {
  397. by: {project: 123, release: '7a82c130be9143361f20bc77252df783cf91e4fc'},
  398. totals: {'sum(session)': 219826},
  399. series: {
  400. 'sum(session)': [
  401. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3444, 14912, 15649, 18019, 16726,
  402. 17540, 16970, 25015, 34686, 46434, 10431,
  403. ],
  404. },
  405. },
  406. {
  407. by: {release: 'e102abb2c46e7fe8686441091005c12aed90da99', project: 123},
  408. totals: {'sum(session)': 6320},
  409. series: {
  410. 'sum(session)': [
  411. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5809, 400, 22, 26, 12, 19, 8, 0, 19, 5,
  412. 0,
  413. ],
  414. },
  415. },
  416. ],
  417. };
  418. }
  419. export function SessionTotalCountByProjectIn24hFixture(): SessionApiResponse {
  420. return {
  421. start: '',
  422. end: '',
  423. query: '',
  424. intervals: [
  425. '2021-03-17T10:00:00Z',
  426. '2021-03-17T11:00:00Z',
  427. '2021-03-17T12:00:00Z',
  428. '2021-03-17T13:00:00Z',
  429. '2021-03-17T14:00:00Z',
  430. '2021-03-17T15:00:00Z',
  431. '2021-03-17T16:00:00Z',
  432. '2021-03-17T17:00:00Z',
  433. '2021-03-17T18:00:00Z',
  434. '2021-03-17T19:00:00Z',
  435. '2021-03-17T20:00:00Z',
  436. '2021-03-17T21:00:00Z',
  437. '2021-03-17T22:00:00Z',
  438. '2021-03-17T23:00:00Z',
  439. '2021-03-18T00:00:00Z',
  440. '2021-03-18T01:00:00Z',
  441. '2021-03-18T02:00:00Z',
  442. '2021-03-18T03:00:00Z',
  443. '2021-03-18T04:00:00Z',
  444. '2021-03-18T05:00:00Z',
  445. '2021-03-18T06:00:00Z',
  446. '2021-03-18T07:00:00Z',
  447. '2021-03-18T08:00:00Z',
  448. '2021-03-18T09:00:00Z',
  449. ],
  450. groups: [
  451. {
  452. by: {project: 123},
  453. totals: {'sum(session)': 835965},
  454. series: {
  455. 'sum(session)': [
  456. 51284, 43820, 46981, 56929, 59999, 60476, 54145, 52642, 42917, 35787, 35036,
  457. 29287, 24815, 19815, 16334, 16415, 18961, 17512, 18149, 17585, 25725, 36365,
  458. 48104, 6882,
  459. ],
  460. },
  461. },
  462. ],
  463. };
  464. }
  465. export function SessionUserStatusCountByReleaseInPeriodFixture(): SessionApiResponse {
  466. return {
  467. start: '',
  468. end: '',
  469. query:
  470. 'release:7a82c130be9143361f20bc77252df783cf91e4fc OR release:e102abb2c46e7fe8686441091005c12aed90da99',
  471. intervals: [
  472. '2021-03-05T00:00:00Z',
  473. '2021-03-06T00:00:00Z',
  474. '2021-03-07T00:00:00Z',
  475. '2021-03-08T00:00:00Z',
  476. '2021-03-09T00:00:00Z',
  477. '2021-03-10T00:00:00Z',
  478. '2021-03-11T00:00:00Z',
  479. '2021-03-12T00:00:00Z',
  480. '2021-03-13T00:00:00Z',
  481. '2021-03-14T00:00:00Z',
  482. '2021-03-15T00:00:00Z',
  483. '2021-03-16T00:00:00Z',
  484. '2021-03-17T00:00:00Z',
  485. '2021-03-18T00:00:00Z',
  486. ],
  487. groups: [
  488. {
  489. by: {
  490. project: 123,
  491. release: '7a82c130be9143361f20bc77252df783cf91e4fc',
  492. 'session.status': 'crashed',
  493. },
  494. totals: {'sum(session)': 492, 'count_unique(user)': 92},
  495. series: {
  496. 'sum(session)': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 490],
  497. 'count_unique(user)': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 90],
  498. },
  499. },
  500. {
  501. by: {
  502. 'session.status': 'healthy',
  503. project: 123,
  504. release: 'e102abb2c46e7fe8686441091005c12aed90da99',
  505. },
  506. totals: {'sum(session)': 6260, 'count_unique(user)': 760},
  507. series: {
  508. 'sum(session)': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5750, 510],
  509. 'count_unique(user)': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 750, 10],
  510. },
  511. },
  512. {
  513. by: {
  514. project: 123,
  515. 'session.status': 'abnormal',
  516. release: 'e102abb2c46e7fe8686441091005c12aed90da99',
  517. },
  518. totals: {'sum(session)': 0, 'count_unique(user)': 0},
  519. series: {
  520. 'sum(session)': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
  521. 'count_unique(user)': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
  522. },
  523. },
  524. {
  525. by: {
  526. project: 123,
  527. release: 'e102abb2c46e7fe8686441091005c12aed90da99',
  528. 'session.status': 'crashed',
  529. },
  530. totals: {'sum(session)': 5, 'count_unique(user)': 1},
  531. series: {
  532. 'sum(session)': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0],
  533. 'count_unique(user)': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0],
  534. },
  535. },
  536. {
  537. by: {
  538. project: 123,
  539. 'session.status': 'abnormal',
  540. release: '7a82c130be9143361f20bc77252df783cf91e4fc',
  541. },
  542. totals: {'sum(session)': 0, 'count_unique(user)': 0},
  543. series: {
  544. 'sum(session)': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
  545. 'count_unique(user)': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
  546. },
  547. },
  548. {
  549. by: {
  550. project: 123,
  551. release: 'e102abb2c46e7fe8686441091005c12aed90da99',
  552. 'session.status': 'errored',
  553. },
  554. totals: {'sum(session)': 59, 'count_unique(user)': 9},
  555. series: {
  556. 'sum(session)': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 59, 0],
  557. 'count_unique(user)': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0],
  558. },
  559. },
  560. {
  561. by: {
  562. 'session.status': 'healthy',
  563. project: 123,
  564. release: '7a82c130be9143361f20bc77252df783cf91e4fc',
  565. },
  566. totals: {'sum(session)': 202136, 'count_unique(user)': 99136},
  567. series: {
  568. 'sum(session)': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3404, 198732],
  569. 'count_unique(user)': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 404, 98732],
  570. },
  571. },
  572. {
  573. by: {
  574. project: 123,
  575. release: '7a82c130be9143361f20bc77252df783cf91e4fc',
  576. 'session.status': 'errored',
  577. },
  578. totals: {'sum(session)': 1954, 'count_unique(user)': 915},
  579. series: {
  580. 'sum(session)': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 1914],
  581. 'count_unique(user)': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 914],
  582. },
  583. },
  584. ],
  585. };
  586. }
  587. export function SessionUserStatusCountByProjectInPeriodFixture(): SessionApiResponse {
  588. return {
  589. start: '',
  590. end: '',
  591. query: '',
  592. intervals: [
  593. '2021-03-05T00:00:00Z',
  594. '2021-03-06T00:00:00Z',
  595. '2021-03-07T00:00:00Z',
  596. '2021-03-08T00:00:00Z',
  597. '2021-03-09T00:00:00Z',
  598. '2021-03-10T00:00:00Z',
  599. '2021-03-11T00:00:00Z',
  600. '2021-03-12T00:00:00Z',
  601. '2021-03-13T00:00:00Z',
  602. '2021-03-14T00:00:00Z',
  603. '2021-03-15T00:00:00Z',
  604. '2021-03-16T00:00:00Z',
  605. '2021-03-17T00:00:00Z',
  606. '2021-03-18T00:00:00Z',
  607. ],
  608. groups: [
  609. {
  610. by: {
  611. project: 123,
  612. 'session.status': 'crashed',
  613. },
  614. totals: {'sum(session)': 992, 'count_unique(user)': 92},
  615. series: {
  616. 'sum(session)': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 990],
  617. 'count_unique(user)': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 90],
  618. },
  619. },
  620. {
  621. by: {
  622. project: 123,
  623. 'session.status': 'healthy',
  624. },
  625. totals: {'sum(session)': 9260, 'count_unique(user)': 260},
  626. series: {
  627. 'sum(session)': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9167, 93],
  628. 'count_unique(user)': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 258],
  629. },
  630. },
  631. {
  632. by: {
  633. project: 123,
  634. 'session.status': 'abnormal',
  635. },
  636. totals: {'sum(session)': 0, 'count_unique(user)': 0},
  637. series: {
  638. 'sum(session)': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
  639. 'count_unique(user)': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
  640. },
  641. },
  642. {
  643. by: {
  644. project: 123,
  645. 'session.status': 'errored',
  646. },
  647. totals: {'sum(session)': 99, 'count_unique(user)': 9},
  648. series: {
  649. 'sum(session)': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 99, 0],
  650. 'count_unique(user)': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 8],
  651. },
  652. },
  653. ],
  654. };
  655. }
  656. export function UserTotalCountByReleaseIn24hFixture(): SessionApiResponse {
  657. return {
  658. start: '',
  659. end: '',
  660. query:
  661. 'release:7a82c130be9143361f20bc77252df783cf91e4fc OR release:e102abb2c46e7fe8686441091005c12aed90da99',
  662. intervals: [
  663. '2021-03-17T10:00:00Z',
  664. '2021-03-17T11:00:00Z',
  665. '2021-03-17T12:00:00Z',
  666. '2021-03-17T13:00:00Z',
  667. '2021-03-17T14:00:00Z',
  668. '2021-03-17T15:00:00Z',
  669. '2021-03-17T16:00:00Z',
  670. '2021-03-17T17:00:00Z',
  671. '2021-03-17T18:00:00Z',
  672. '2021-03-17T19:00:00Z',
  673. '2021-03-17T20:00:00Z',
  674. '2021-03-17T21:00:00Z',
  675. '2021-03-17T22:00:00Z',
  676. '2021-03-17T23:00:00Z',
  677. '2021-03-18T00:00:00Z',
  678. '2021-03-18T01:00:00Z',
  679. '2021-03-18T02:00:00Z',
  680. '2021-03-18T03:00:00Z',
  681. '2021-03-18T04:00:00Z',
  682. '2021-03-18T05:00:00Z',
  683. '2021-03-18T06:00:00Z',
  684. '2021-03-18T07:00:00Z',
  685. '2021-03-18T08:00:00Z',
  686. '2021-03-18T09:00:00Z',
  687. ],
  688. groups: [
  689. {
  690. by: {project: 123, release: '7a82c130be9143361f20bc77252df783cf91e4fc'},
  691. totals: {'count_unique(user)': 56826},
  692. series: {
  693. 'count_unique(user)': [
  694. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 444, 4912, 5649, 8019, 6726, 7540,
  695. 6970, 5015, 4686, 6434, 431,
  696. ],
  697. },
  698. },
  699. {
  700. by: {release: 'e102abb2c46e7fe8686441091005c12aed90da99', project: 123},
  701. totals: {'count_unique(user)': 850},
  702. series: {
  703. 'count_unique(user)': [
  704. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 809, 0, 2, 6, 2, 9, 8, 0, 9, 5, 0,
  705. ],
  706. },
  707. },
  708. ],
  709. };
  710. }
  711. export function UserTotalCountByProjectIn24hFixture(): SessionApiResponse {
  712. return {
  713. start: '',
  714. end: '',
  715. query: '',
  716. intervals: [
  717. '2021-03-17T10:00:00Z',
  718. '2021-03-17T11:00:00Z',
  719. '2021-03-17T12:00:00Z',
  720. '2021-03-17T13:00:00Z',
  721. '2021-03-17T14:00:00Z',
  722. '2021-03-17T15:00:00Z',
  723. '2021-03-17T16:00:00Z',
  724. '2021-03-17T17:00:00Z',
  725. '2021-03-17T18:00:00Z',
  726. '2021-03-17T19:00:00Z',
  727. '2021-03-17T20:00:00Z',
  728. '2021-03-17T21:00:00Z',
  729. '2021-03-17T22:00:00Z',
  730. '2021-03-17T23:00:00Z',
  731. '2021-03-18T00:00:00Z',
  732. '2021-03-18T01:00:00Z',
  733. '2021-03-18T02:00:00Z',
  734. '2021-03-18T03:00:00Z',
  735. '2021-03-18T04:00:00Z',
  736. '2021-03-18T05:00:00Z',
  737. '2021-03-18T06:00:00Z',
  738. '2021-03-18T07:00:00Z',
  739. '2021-03-18T08:00:00Z',
  740. '2021-03-18T09:00:00Z',
  741. ],
  742. groups: [
  743. {
  744. by: {project: 123},
  745. totals: {'count_unique(user)': 140965},
  746. series: {
  747. 'count_unique(user)': [
  748. 1284, 3820, 6981, 6929, 9999, 1476, 4145, 2642, 2917, 5787, 5036, 9287, 4815,
  749. 9815, 6334, 6415, 8961, 7512, 8149, 7585, 5725, 6365, 8104, 882,
  750. ],
  751. },
  752. },
  753. ],
  754. };
  755. }
  756. export function SessionUserCountByStatusByReleaseFixture(): SessionApiResponse {
  757. return {
  758. start: '2022-01-15T00:00:00Z',
  759. end: '2022-01-29T00:00:00Z',
  760. query: '',
  761. intervals: [
  762. '2022-01-15T00:00:00Z',
  763. '2022-01-16T00:00:00Z',
  764. '2022-01-17T00:00:00Z',
  765. '2022-01-18T00:00:00Z',
  766. '2022-01-19T00:00:00Z',
  767. '2022-01-20T00:00:00Z',
  768. '2022-01-21T00:00:00Z',
  769. '2022-01-22T00:00:00Z',
  770. '2022-01-23T00:00:00Z',
  771. '2022-01-24T00:00:00Z',
  772. '2022-01-25T00:00:00Z',
  773. '2022-01-26T00:00:00Z',
  774. '2022-01-27T00:00:00Z',
  775. '2022-01-28T00:00:00Z',
  776. ],
  777. groups: [
  778. {
  779. by: {'session.status': 'crashed', release: '1'},
  780. totals: {'sum(session)': 34, 'count_unique(user)': 1},
  781. series: {
  782. 'sum(session)': [0, 0, 0, 0, 0, 0, 0, 0, 0, 23, 11, 0, 0, 0],
  783. 'count_unique(user)': [0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0],
  784. },
  785. },
  786. {
  787. by: {'session.status': 'abnormal', release: '1'},
  788. totals: {'sum(session)': 1, 'count_unique(user)': 1},
  789. series: {
  790. 'sum(session)': [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
  791. 'count_unique(user)': [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
  792. },
  793. },
  794. {
  795. by: {'session.status': 'errored', release: '1'},
  796. totals: {'sum(session)': 451, 'count_unique(user)': 2},
  797. series: {
  798. 'sum(session)': [0, 0, 0, 0, 0, 37, 0, 0, 0, 335, 79, 0, 0, 0],
  799. 'count_unique(user)': [0, 0, 0, 0, 0, 1, 0, 0, 0, 2, 2, 0, 0, 0],
  800. },
  801. },
  802. {
  803. by: {'session.status': 'healthy', release: '1'},
  804. totals: {'sum(session)': 5058, 'count_unique(user)': 3},
  805. series: {
  806. 'sum(session)': [0, 0, 0, 0, 0, 2503, 661, 0, 0, 1464, 430, 0, 0, 0],
  807. 'count_unique(user)': [0, 0, 0, 0, 0, 3, 3, 0, 0, 1, 1, 0, 0, 0],
  808. },
  809. },
  810. {
  811. by: {'session.status': 'crashed', release: '2'},
  812. totals: {'sum(session)': 35, 'count_unique(user)': 2},
  813. series: {
  814. 'sum(session)': [1, 0, 0, 0, 0, 0, 0, 0, 0, 23, 11, 0, 0, 0],
  815. 'count_unique(user)': [1, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0],
  816. },
  817. },
  818. {
  819. by: {'session.status': 'abnormal', release: '2'},
  820. totals: {'sum(session)': 1, 'count_unique(user)': 1},
  821. series: {
  822. 'sum(session)': [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
  823. 'count_unique(user)': [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
  824. },
  825. },
  826. {
  827. by: {'session.status': 'errored', release: '2'},
  828. totals: {'sum(session)': 452, 'count_unique(user)': 1},
  829. series: {
  830. 'sum(session)': [1, 0, 0, 0, 0, 37, 0, 0, 0, 335, 79, 0, 0, 0],
  831. 'count_unique(user)': [1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0],
  832. },
  833. },
  834. {
  835. by: {'session.status': 'healthy', release: '2'},
  836. totals: {'sum(session)': 5059, 'count_unique(user)': 10},
  837. series: {
  838. 'sum(session)': [1, 0, 0, 0, 0, 2503, 661, 0, 0, 1464, 430, 0, 0, 0],
  839. 'count_unique(user)': [1, 0, 0, 0, 0, 10, 3, 0, 0, 4, 3, 0, 0, 0],
  840. },
  841. },
  842. ],
  843. };
  844. }
  845. export function SessionEmptyGroupedResponseFixture(): SessionApiResponse {
  846. return {
  847. start: '2022-01-15T00:00:00Z',
  848. end: '2022-01-29T00:00:00Z',
  849. query: '',
  850. intervals: [
  851. '2022-01-15T00:00:00Z',
  852. '2022-01-16T00:00:00Z',
  853. '2022-01-17T00:00:00Z',
  854. '2022-01-18T00:00:00Z',
  855. '2022-01-19T00:00:00Z',
  856. '2022-01-20T00:00:00Z',
  857. '2022-01-21T00:00:00Z',
  858. '2022-01-22T00:00:00Z',
  859. '2022-01-23T00:00:00Z',
  860. '2022-01-24T00:00:00Z',
  861. '2022-01-25T00:00:00Z',
  862. '2022-01-26T00:00:00Z',
  863. '2022-01-27T00:00:00Z',
  864. '2022-01-28T00:00:00Z',
  865. ],
  866. groups: [],
  867. };
  868. }