transformSessionsResponseToSeries.spec.tsx 48 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145
  1. import {
  2. SessionEmptyGroupedResponseFixture,
  3. SessionUserCountByStatusByReleaseFixture,
  4. } from 'sentry-fixture/sessions';
  5. import {transformSessionsResponseToSeries} from 'sentry/views/dashboards/widgetCard/transformSessionsResponseToSeries';
  6. describe('transformSessionsResponseToSeries', function () {
  7. it('transforms sessions into series', () => {
  8. expect(
  9. transformSessionsResponseToSeries(
  10. SessionUserCountByStatusByReleaseFixture(),
  11. [],
  12. []
  13. )
  14. ).toEqual([
  15. {
  16. seriesName: 'crashed, 1 : sum(session)',
  17. data: [
  18. {name: '2022-01-15T00:00:00Z', value: 0},
  19. {name: '2022-01-16T00:00:00Z', value: 0},
  20. {name: '2022-01-17T00:00:00Z', value: 0},
  21. {name: '2022-01-18T00:00:00Z', value: 0},
  22. {name: '2022-01-19T00:00:00Z', value: 0},
  23. {name: '2022-01-20T00:00:00Z', value: 0},
  24. {name: '2022-01-21T00:00:00Z', value: 0},
  25. {name: '2022-01-22T00:00:00Z', value: 0},
  26. {name: '2022-01-23T00:00:00Z', value: 0},
  27. {name: '2022-01-24T00:00:00Z', value: 23},
  28. {name: '2022-01-25T00:00:00Z', value: 11},
  29. {name: '2022-01-26T00:00:00Z', value: 0},
  30. {name: '2022-01-27T00:00:00Z', value: 0},
  31. {name: '2022-01-28T00:00:00Z', value: 0},
  32. ],
  33. },
  34. {
  35. seriesName: 'crashed, 1 : count_unique(user)',
  36. data: [
  37. {name: '2022-01-15T00:00:00Z', value: 0},
  38. {name: '2022-01-16T00:00:00Z', value: 0},
  39. {name: '2022-01-17T00:00:00Z', value: 0},
  40. {name: '2022-01-18T00:00:00Z', value: 0},
  41. {name: '2022-01-19T00:00:00Z', value: 0},
  42. {name: '2022-01-20T00:00:00Z', value: 0},
  43. {name: '2022-01-21T00:00:00Z', value: 0},
  44. {name: '2022-01-22T00:00:00Z', value: 0},
  45. {name: '2022-01-23T00:00:00Z', value: 0},
  46. {name: '2022-01-24T00:00:00Z', value: 1},
  47. {name: '2022-01-25T00:00:00Z', value: 1},
  48. {name: '2022-01-26T00:00:00Z', value: 0},
  49. {name: '2022-01-27T00:00:00Z', value: 0},
  50. {name: '2022-01-28T00:00:00Z', value: 0},
  51. ],
  52. },
  53. {
  54. seriesName: 'abnormal, 1 : sum(session)',
  55. data: [
  56. {name: '2022-01-15T00:00:00Z', value: 1},
  57. {name: '2022-01-16T00:00:00Z', value: 0},
  58. {name: '2022-01-17T00:00:00Z', value: 0},
  59. {name: '2022-01-18T00:00:00Z', value: 0},
  60. {name: '2022-01-19T00:00:00Z', value: 0},
  61. {name: '2022-01-20T00:00:00Z', value: 0},
  62. {name: '2022-01-21T00:00:00Z', value: 0},
  63. {name: '2022-01-22T00:00:00Z', value: 0},
  64. {name: '2022-01-23T00:00:00Z', value: 0},
  65. {name: '2022-01-24T00:00:00Z', value: 0},
  66. {name: '2022-01-25T00:00:00Z', value: 0},
  67. {name: '2022-01-26T00:00:00Z', value: 0},
  68. {name: '2022-01-27T00:00:00Z', value: 0},
  69. {name: '2022-01-28T00:00:00Z', value: 0},
  70. ],
  71. },
  72. {
  73. seriesName: 'abnormal, 1 : count_unique(user)',
  74. data: [
  75. {name: '2022-01-15T00:00:00Z', value: 1},
  76. {name: '2022-01-16T00:00:00Z', value: 0},
  77. {name: '2022-01-17T00:00:00Z', value: 0},
  78. {name: '2022-01-18T00:00:00Z', value: 0},
  79. {name: '2022-01-19T00:00:00Z', value: 0},
  80. {name: '2022-01-20T00:00:00Z', value: 0},
  81. {name: '2022-01-21T00:00:00Z', value: 0},
  82. {name: '2022-01-22T00:00:00Z', value: 0},
  83. {name: '2022-01-23T00:00:00Z', value: 0},
  84. {name: '2022-01-24T00:00:00Z', value: 0},
  85. {name: '2022-01-25T00:00:00Z', value: 0},
  86. {name: '2022-01-26T00:00:00Z', value: 0},
  87. {name: '2022-01-27T00:00:00Z', value: 0},
  88. {name: '2022-01-28T00:00:00Z', value: 0},
  89. ],
  90. },
  91. {
  92. seriesName: 'errored, 1 : sum(session)',
  93. data: [
  94. {name: '2022-01-15T00:00:00Z', value: 0},
  95. {name: '2022-01-16T00:00:00Z', value: 0},
  96. {name: '2022-01-17T00:00:00Z', value: 0},
  97. {name: '2022-01-18T00:00:00Z', value: 0},
  98. {name: '2022-01-19T00:00:00Z', value: 0},
  99. {name: '2022-01-20T00:00:00Z', value: 37},
  100. {name: '2022-01-21T00:00:00Z', value: 0},
  101. {name: '2022-01-22T00:00:00Z', value: 0},
  102. {name: '2022-01-23T00:00:00Z', value: 0},
  103. {name: '2022-01-24T00:00:00Z', value: 335},
  104. {name: '2022-01-25T00:00:00Z', value: 79},
  105. {name: '2022-01-26T00:00:00Z', value: 0},
  106. {name: '2022-01-27T00:00:00Z', value: 0},
  107. {name: '2022-01-28T00:00:00Z', value: 0},
  108. ],
  109. },
  110. {
  111. seriesName: 'errored, 1 : count_unique(user)',
  112. data: [
  113. {name: '2022-01-15T00:00:00Z', value: 0},
  114. {name: '2022-01-16T00:00:00Z', value: 0},
  115. {name: '2022-01-17T00:00:00Z', value: 0},
  116. {name: '2022-01-18T00:00:00Z', value: 0},
  117. {name: '2022-01-19T00:00:00Z', value: 0},
  118. {name: '2022-01-20T00:00:00Z', value: 1},
  119. {name: '2022-01-21T00:00:00Z', value: 0},
  120. {name: '2022-01-22T00:00:00Z', value: 0},
  121. {name: '2022-01-23T00:00:00Z', value: 0},
  122. {name: '2022-01-24T00:00:00Z', value: 2},
  123. {name: '2022-01-25T00:00:00Z', value: 2},
  124. {name: '2022-01-26T00:00:00Z', value: 0},
  125. {name: '2022-01-27T00:00:00Z', value: 0},
  126. {name: '2022-01-28T00:00:00Z', value: 0},
  127. ],
  128. },
  129. {
  130. seriesName: 'healthy, 1 : sum(session)',
  131. data: [
  132. {name: '2022-01-15T00:00:00Z', value: 0},
  133. {name: '2022-01-16T00:00:00Z', value: 0},
  134. {name: '2022-01-17T00:00:00Z', value: 0},
  135. {name: '2022-01-18T00:00:00Z', value: 0},
  136. {name: '2022-01-19T00:00:00Z', value: 0},
  137. {name: '2022-01-20T00:00:00Z', value: 2503},
  138. {name: '2022-01-21T00:00:00Z', value: 661},
  139. {name: '2022-01-22T00:00:00Z', value: 0},
  140. {name: '2022-01-23T00:00:00Z', value: 0},
  141. {name: '2022-01-24T00:00:00Z', value: 1464},
  142. {name: '2022-01-25T00:00:00Z', value: 430},
  143. {name: '2022-01-26T00:00:00Z', value: 0},
  144. {name: '2022-01-27T00:00:00Z', value: 0},
  145. {name: '2022-01-28T00:00:00Z', value: 0},
  146. ],
  147. },
  148. {
  149. seriesName: 'healthy, 1 : count_unique(user)',
  150. data: [
  151. {name: '2022-01-15T00:00:00Z', value: 0},
  152. {name: '2022-01-16T00:00:00Z', value: 0},
  153. {name: '2022-01-17T00:00:00Z', value: 0},
  154. {name: '2022-01-18T00:00:00Z', value: 0},
  155. {name: '2022-01-19T00:00:00Z', value: 0},
  156. {name: '2022-01-20T00:00:00Z', value: 3},
  157. {name: '2022-01-21T00:00:00Z', value: 3},
  158. {name: '2022-01-22T00:00:00Z', value: 0},
  159. {name: '2022-01-23T00:00:00Z', value: 0},
  160. {name: '2022-01-24T00:00:00Z', value: 1},
  161. {name: '2022-01-25T00:00:00Z', value: 1},
  162. {name: '2022-01-26T00:00:00Z', value: 0},
  163. {name: '2022-01-27T00:00:00Z', value: 0},
  164. {name: '2022-01-28T00:00:00Z', value: 0},
  165. ],
  166. },
  167. {
  168. seriesName: 'crashed, 2 : sum(session)',
  169. data: [
  170. {name: '2022-01-15T00:00:00Z', value: 1},
  171. {name: '2022-01-16T00:00:00Z', value: 0},
  172. {name: '2022-01-17T00:00:00Z', value: 0},
  173. {name: '2022-01-18T00:00:00Z', value: 0},
  174. {name: '2022-01-19T00:00:00Z', value: 0},
  175. {name: '2022-01-20T00:00:00Z', value: 0},
  176. {name: '2022-01-21T00:00:00Z', value: 0},
  177. {name: '2022-01-22T00:00:00Z', value: 0},
  178. {name: '2022-01-23T00:00:00Z', value: 0},
  179. {name: '2022-01-24T00:00:00Z', value: 23},
  180. {name: '2022-01-25T00:00:00Z', value: 11},
  181. {name: '2022-01-26T00:00:00Z', value: 0},
  182. {name: '2022-01-27T00:00:00Z', value: 0},
  183. {name: '2022-01-28T00:00:00Z', value: 0},
  184. ],
  185. },
  186. {
  187. seriesName: 'crashed, 2 : count_unique(user)',
  188. data: [
  189. {name: '2022-01-15T00:00:00Z', value: 1},
  190. {name: '2022-01-16T00:00:00Z', value: 0},
  191. {name: '2022-01-17T00:00:00Z', value: 0},
  192. {name: '2022-01-18T00:00:00Z', value: 0},
  193. {name: '2022-01-19T00:00:00Z', value: 0},
  194. {name: '2022-01-20T00:00:00Z', value: 0},
  195. {name: '2022-01-21T00:00:00Z', value: 0},
  196. {name: '2022-01-22T00:00:00Z', value: 0},
  197. {name: '2022-01-23T00:00:00Z', value: 0},
  198. {name: '2022-01-24T00:00:00Z', value: 2},
  199. {name: '2022-01-25T00:00:00Z', value: 2},
  200. {name: '2022-01-26T00:00:00Z', value: 0},
  201. {name: '2022-01-27T00:00:00Z', value: 0},
  202. {name: '2022-01-28T00:00:00Z', value: 0},
  203. ],
  204. },
  205. {
  206. seriesName: 'abnormal, 2 : sum(session)',
  207. data: [
  208. {name: '2022-01-15T00:00:00Z', value: 1},
  209. {name: '2022-01-16T00:00:00Z', value: 0},
  210. {name: '2022-01-17T00:00:00Z', value: 0},
  211. {name: '2022-01-18T00:00:00Z', value: 0},
  212. {name: '2022-01-19T00:00:00Z', value: 0},
  213. {name: '2022-01-20T00:00:00Z', value: 0},
  214. {name: '2022-01-21T00:00:00Z', value: 0},
  215. {name: '2022-01-22T00:00:00Z', value: 0},
  216. {name: '2022-01-23T00:00:00Z', value: 0},
  217. {name: '2022-01-24T00:00:00Z', value: 0},
  218. {name: '2022-01-25T00:00:00Z', value: 0},
  219. {name: '2022-01-26T00:00:00Z', value: 0},
  220. {name: '2022-01-27T00:00:00Z', value: 0},
  221. {name: '2022-01-28T00:00:00Z', value: 0},
  222. ],
  223. },
  224. {
  225. seriesName: 'abnormal, 2 : count_unique(user)',
  226. data: [
  227. {name: '2022-01-15T00:00:00Z', value: 1},
  228. {name: '2022-01-16T00:00:00Z', value: 0},
  229. {name: '2022-01-17T00:00:00Z', value: 0},
  230. {name: '2022-01-18T00:00:00Z', value: 0},
  231. {name: '2022-01-19T00:00:00Z', value: 0},
  232. {name: '2022-01-20T00:00:00Z', value: 0},
  233. {name: '2022-01-21T00:00:00Z', value: 0},
  234. {name: '2022-01-22T00:00:00Z', value: 0},
  235. {name: '2022-01-23T00:00:00Z', value: 0},
  236. {name: '2022-01-24T00:00:00Z', value: 0},
  237. {name: '2022-01-25T00:00:00Z', value: 0},
  238. {name: '2022-01-26T00:00:00Z', value: 0},
  239. {name: '2022-01-27T00:00:00Z', value: 0},
  240. {name: '2022-01-28T00:00:00Z', value: 0},
  241. ],
  242. },
  243. {
  244. seriesName: 'errored, 2 : sum(session)',
  245. data: [
  246. {name: '2022-01-15T00:00:00Z', value: 1},
  247. {name: '2022-01-16T00:00:00Z', value: 0},
  248. {name: '2022-01-17T00:00:00Z', value: 0},
  249. {name: '2022-01-18T00:00:00Z', value: 0},
  250. {name: '2022-01-19T00:00:00Z', value: 0},
  251. {name: '2022-01-20T00:00:00Z', value: 37},
  252. {name: '2022-01-21T00:00:00Z', value: 0},
  253. {name: '2022-01-22T00:00:00Z', value: 0},
  254. {name: '2022-01-23T00:00:00Z', value: 0},
  255. {name: '2022-01-24T00:00:00Z', value: 335},
  256. {name: '2022-01-25T00:00:00Z', value: 79},
  257. {name: '2022-01-26T00:00:00Z', value: 0},
  258. {name: '2022-01-27T00:00:00Z', value: 0},
  259. {name: '2022-01-28T00:00:00Z', value: 0},
  260. ],
  261. },
  262. {
  263. seriesName: 'errored, 2 : count_unique(user)',
  264. data: [
  265. {name: '2022-01-15T00:00:00Z', value: 1},
  266. {name: '2022-01-16T00:00:00Z', value: 0},
  267. {name: '2022-01-17T00:00:00Z', value: 0},
  268. {name: '2022-01-18T00:00:00Z', value: 0},
  269. {name: '2022-01-19T00:00:00Z', value: 0},
  270. {name: '2022-01-20T00:00:00Z', value: 1},
  271. {name: '2022-01-21T00:00:00Z', value: 0},
  272. {name: '2022-01-22T00:00:00Z', value: 0},
  273. {name: '2022-01-23T00:00:00Z', value: 0},
  274. {name: '2022-01-24T00:00:00Z', value: 1},
  275. {name: '2022-01-25T00:00:00Z', value: 1},
  276. {name: '2022-01-26T00:00:00Z', value: 0},
  277. {name: '2022-01-27T00:00:00Z', value: 0},
  278. {name: '2022-01-28T00:00:00Z', value: 0},
  279. ],
  280. },
  281. {
  282. seriesName: 'healthy, 2 : sum(session)',
  283. data: [
  284. {name: '2022-01-15T00:00:00Z', value: 1},
  285. {name: '2022-01-16T00:00:00Z', value: 0},
  286. {name: '2022-01-17T00:00:00Z', value: 0},
  287. {name: '2022-01-18T00:00:00Z', value: 0},
  288. {name: '2022-01-19T00:00:00Z', value: 0},
  289. {name: '2022-01-20T00:00:00Z', value: 2503},
  290. {name: '2022-01-21T00:00:00Z', value: 661},
  291. {name: '2022-01-22T00:00:00Z', value: 0},
  292. {name: '2022-01-23T00:00:00Z', value: 0},
  293. {name: '2022-01-24T00:00:00Z', value: 1464},
  294. {name: '2022-01-25T00:00:00Z', value: 430},
  295. {name: '2022-01-26T00:00:00Z', value: 0},
  296. {name: '2022-01-27T00:00:00Z', value: 0},
  297. {name: '2022-01-28T00:00:00Z', value: 0},
  298. ],
  299. },
  300. {
  301. seriesName: 'healthy, 2 : count_unique(user)',
  302. data: [
  303. {name: '2022-01-15T00:00:00Z', value: 1},
  304. {name: '2022-01-16T00:00:00Z', value: 0},
  305. {name: '2022-01-17T00:00:00Z', value: 0},
  306. {name: '2022-01-18T00:00:00Z', value: 0},
  307. {name: '2022-01-19T00:00:00Z', value: 0},
  308. {name: '2022-01-20T00:00:00Z', value: 10},
  309. {name: '2022-01-21T00:00:00Z', value: 3},
  310. {name: '2022-01-22T00:00:00Z', value: 0},
  311. {name: '2022-01-23T00:00:00Z', value: 0},
  312. {name: '2022-01-24T00:00:00Z', value: 4},
  313. {name: '2022-01-25T00:00:00Z', value: 3},
  314. {name: '2022-01-26T00:00:00Z', value: 0},
  315. {name: '2022-01-27T00:00:00Z', value: 0},
  316. {name: '2022-01-28T00:00:00Z', value: 0},
  317. ],
  318. },
  319. ]);
  320. });
  321. it('adds derived status series', () => {
  322. expect(
  323. transformSessionsResponseToSeries(
  324. SessionUserCountByStatusByReleaseFixture(),
  325. ['count_crashed(session)'],
  326. []
  327. )
  328. ).toEqual([
  329. {
  330. seriesName: 'crashed, 1 : sum(session)',
  331. data: [
  332. {name: '2022-01-15T00:00:00Z', value: 0},
  333. {name: '2022-01-16T00:00:00Z', value: 0},
  334. {name: '2022-01-17T00:00:00Z', value: 0},
  335. {name: '2022-01-18T00:00:00Z', value: 0},
  336. {name: '2022-01-19T00:00:00Z', value: 0},
  337. {name: '2022-01-20T00:00:00Z', value: 0},
  338. {name: '2022-01-21T00:00:00Z', value: 0},
  339. {name: '2022-01-22T00:00:00Z', value: 0},
  340. {name: '2022-01-23T00:00:00Z', value: 0},
  341. {name: '2022-01-24T00:00:00Z', value: 23},
  342. {name: '2022-01-25T00:00:00Z', value: 11},
  343. {name: '2022-01-26T00:00:00Z', value: 0},
  344. {name: '2022-01-27T00:00:00Z', value: 0},
  345. {name: '2022-01-28T00:00:00Z', value: 0},
  346. ],
  347. },
  348. {
  349. seriesName: 'crashed, 1 : count_unique(user)',
  350. data: [
  351. {name: '2022-01-15T00:00:00Z', value: 0},
  352. {name: '2022-01-16T00:00:00Z', value: 0},
  353. {name: '2022-01-17T00:00:00Z', value: 0},
  354. {name: '2022-01-18T00:00:00Z', value: 0},
  355. {name: '2022-01-19T00:00:00Z', value: 0},
  356. {name: '2022-01-20T00:00:00Z', value: 0},
  357. {name: '2022-01-21T00:00:00Z', value: 0},
  358. {name: '2022-01-22T00:00:00Z', value: 0},
  359. {name: '2022-01-23T00:00:00Z', value: 0},
  360. {name: '2022-01-24T00:00:00Z', value: 1},
  361. {name: '2022-01-25T00:00:00Z', value: 1},
  362. {name: '2022-01-26T00:00:00Z', value: 0},
  363. {name: '2022-01-27T00:00:00Z', value: 0},
  364. {name: '2022-01-28T00:00:00Z', value: 0},
  365. ],
  366. },
  367. {
  368. seriesName: 'crashed, 1 : count_crashed(session)',
  369. data: [
  370. {name: '2022-01-15T00:00:00Z', value: 0},
  371. {name: '2022-01-16T00:00:00Z', value: 0},
  372. {name: '2022-01-17T00:00:00Z', value: 0},
  373. {name: '2022-01-18T00:00:00Z', value: 0},
  374. {name: '2022-01-19T00:00:00Z', value: 0},
  375. {name: '2022-01-20T00:00:00Z', value: 0},
  376. {name: '2022-01-21T00:00:00Z', value: 0},
  377. {name: '2022-01-22T00:00:00Z', value: 0},
  378. {name: '2022-01-23T00:00:00Z', value: 0},
  379. {name: '2022-01-24T00:00:00Z', value: 23},
  380. {name: '2022-01-25T00:00:00Z', value: 11},
  381. {name: '2022-01-26T00:00:00Z', value: 0},
  382. {name: '2022-01-27T00:00:00Z', value: 0},
  383. {name: '2022-01-28T00:00:00Z', value: 0},
  384. ],
  385. },
  386. {
  387. seriesName: 'abnormal, 1 : sum(session)',
  388. data: [
  389. {name: '2022-01-15T00:00:00Z', value: 1},
  390. {name: '2022-01-16T00:00:00Z', value: 0},
  391. {name: '2022-01-17T00:00:00Z', value: 0},
  392. {name: '2022-01-18T00:00:00Z', value: 0},
  393. {name: '2022-01-19T00:00:00Z', value: 0},
  394. {name: '2022-01-20T00:00:00Z', value: 0},
  395. {name: '2022-01-21T00:00:00Z', value: 0},
  396. {name: '2022-01-22T00:00:00Z', value: 0},
  397. {name: '2022-01-23T00:00:00Z', value: 0},
  398. {name: '2022-01-24T00:00:00Z', value: 0},
  399. {name: '2022-01-25T00:00:00Z', value: 0},
  400. {name: '2022-01-26T00:00:00Z', value: 0},
  401. {name: '2022-01-27T00:00:00Z', value: 0},
  402. {name: '2022-01-28T00:00:00Z', value: 0},
  403. ],
  404. },
  405. {
  406. seriesName: 'abnormal, 1 : count_unique(user)',
  407. data: [
  408. {name: '2022-01-15T00:00:00Z', value: 1},
  409. {name: '2022-01-16T00:00:00Z', value: 0},
  410. {name: '2022-01-17T00:00:00Z', value: 0},
  411. {name: '2022-01-18T00:00:00Z', value: 0},
  412. {name: '2022-01-19T00:00:00Z', value: 0},
  413. {name: '2022-01-20T00:00:00Z', value: 0},
  414. {name: '2022-01-21T00:00:00Z', value: 0},
  415. {name: '2022-01-22T00:00:00Z', value: 0},
  416. {name: '2022-01-23T00:00:00Z', value: 0},
  417. {name: '2022-01-24T00:00:00Z', value: 0},
  418. {name: '2022-01-25T00:00:00Z', value: 0},
  419. {name: '2022-01-26T00:00:00Z', value: 0},
  420. {name: '2022-01-27T00:00:00Z', value: 0},
  421. {name: '2022-01-28T00:00:00Z', value: 0},
  422. ],
  423. },
  424. {
  425. seriesName: 'abnormal, 1 : count_crashed(session)',
  426. data: [
  427. {name: '2022-01-15T00:00:00Z', value: 0},
  428. {name: '2022-01-16T00:00:00Z', value: 0},
  429. {name: '2022-01-17T00:00:00Z', value: 0},
  430. {name: '2022-01-18T00:00:00Z', value: 0},
  431. {name: '2022-01-19T00:00:00Z', value: 0},
  432. {name: '2022-01-20T00:00:00Z', value: 0},
  433. {name: '2022-01-21T00:00:00Z', value: 0},
  434. {name: '2022-01-22T00:00:00Z', value: 0},
  435. {name: '2022-01-23T00:00:00Z', value: 0},
  436. {name: '2022-01-24T00:00:00Z', value: 0},
  437. {name: '2022-01-25T00:00:00Z', value: 0},
  438. {name: '2022-01-26T00:00:00Z', value: 0},
  439. {name: '2022-01-27T00:00:00Z', value: 0},
  440. {name: '2022-01-28T00:00:00Z', value: 0},
  441. ],
  442. },
  443. {
  444. seriesName: 'errored, 1 : sum(session)',
  445. data: [
  446. {name: '2022-01-15T00:00:00Z', value: 0},
  447. {name: '2022-01-16T00:00:00Z', value: 0},
  448. {name: '2022-01-17T00:00:00Z', value: 0},
  449. {name: '2022-01-18T00:00:00Z', value: 0},
  450. {name: '2022-01-19T00:00:00Z', value: 0},
  451. {name: '2022-01-20T00:00:00Z', value: 37},
  452. {name: '2022-01-21T00:00:00Z', value: 0},
  453. {name: '2022-01-22T00:00:00Z', value: 0},
  454. {name: '2022-01-23T00:00:00Z', value: 0},
  455. {name: '2022-01-24T00:00:00Z', value: 335},
  456. {name: '2022-01-25T00:00:00Z', value: 79},
  457. {name: '2022-01-26T00:00:00Z', value: 0},
  458. {name: '2022-01-27T00:00:00Z', value: 0},
  459. {name: '2022-01-28T00:00:00Z', value: 0},
  460. ],
  461. },
  462. {
  463. seriesName: 'errored, 1 : count_unique(user)',
  464. data: [
  465. {name: '2022-01-15T00:00:00Z', value: 0},
  466. {name: '2022-01-16T00:00:00Z', value: 0},
  467. {name: '2022-01-17T00:00:00Z', value: 0},
  468. {name: '2022-01-18T00:00:00Z', value: 0},
  469. {name: '2022-01-19T00:00:00Z', value: 0},
  470. {name: '2022-01-20T00:00:00Z', value: 1},
  471. {name: '2022-01-21T00:00:00Z', value: 0},
  472. {name: '2022-01-22T00:00:00Z', value: 0},
  473. {name: '2022-01-23T00:00:00Z', value: 0},
  474. {name: '2022-01-24T00:00:00Z', value: 2},
  475. {name: '2022-01-25T00:00:00Z', value: 2},
  476. {name: '2022-01-26T00:00:00Z', value: 0},
  477. {name: '2022-01-27T00:00:00Z', value: 0},
  478. {name: '2022-01-28T00:00:00Z', value: 0},
  479. ],
  480. },
  481. {
  482. seriesName: 'errored, 1 : count_crashed(session)',
  483. data: [
  484. {name: '2022-01-15T00:00:00Z', value: 0},
  485. {name: '2022-01-16T00:00:00Z', value: 0},
  486. {name: '2022-01-17T00:00:00Z', value: 0},
  487. {name: '2022-01-18T00:00:00Z', value: 0},
  488. {name: '2022-01-19T00:00:00Z', value: 0},
  489. {name: '2022-01-20T00:00:00Z', value: 0},
  490. {name: '2022-01-21T00:00:00Z', value: 0},
  491. {name: '2022-01-22T00:00:00Z', value: 0},
  492. {name: '2022-01-23T00:00:00Z', value: 0},
  493. {name: '2022-01-24T00:00:00Z', value: 0},
  494. {name: '2022-01-25T00:00:00Z', value: 0},
  495. {name: '2022-01-26T00:00:00Z', value: 0},
  496. {name: '2022-01-27T00:00:00Z', value: 0},
  497. {name: '2022-01-28T00:00:00Z', value: 0},
  498. ],
  499. },
  500. {
  501. seriesName: 'healthy, 1 : sum(session)',
  502. data: [
  503. {name: '2022-01-15T00:00:00Z', value: 0},
  504. {name: '2022-01-16T00:00:00Z', value: 0},
  505. {name: '2022-01-17T00:00:00Z', value: 0},
  506. {name: '2022-01-18T00:00:00Z', value: 0},
  507. {name: '2022-01-19T00:00:00Z', value: 0},
  508. {name: '2022-01-20T00:00:00Z', value: 2503},
  509. {name: '2022-01-21T00:00:00Z', value: 661},
  510. {name: '2022-01-22T00:00:00Z', value: 0},
  511. {name: '2022-01-23T00:00:00Z', value: 0},
  512. {name: '2022-01-24T00:00:00Z', value: 1464},
  513. {name: '2022-01-25T00:00:00Z', value: 430},
  514. {name: '2022-01-26T00:00:00Z', value: 0},
  515. {name: '2022-01-27T00:00:00Z', value: 0},
  516. {name: '2022-01-28T00:00:00Z', value: 0},
  517. ],
  518. },
  519. {
  520. seriesName: 'healthy, 1 : count_unique(user)',
  521. data: [
  522. {name: '2022-01-15T00:00:00Z', value: 0},
  523. {name: '2022-01-16T00:00:00Z', value: 0},
  524. {name: '2022-01-17T00:00:00Z', value: 0},
  525. {name: '2022-01-18T00:00:00Z', value: 0},
  526. {name: '2022-01-19T00:00:00Z', value: 0},
  527. {name: '2022-01-20T00:00:00Z', value: 3},
  528. {name: '2022-01-21T00:00:00Z', value: 3},
  529. {name: '2022-01-22T00:00:00Z', value: 0},
  530. {name: '2022-01-23T00:00:00Z', value: 0},
  531. {name: '2022-01-24T00:00:00Z', value: 1},
  532. {name: '2022-01-25T00:00:00Z', value: 1},
  533. {name: '2022-01-26T00:00:00Z', value: 0},
  534. {name: '2022-01-27T00:00:00Z', value: 0},
  535. {name: '2022-01-28T00:00:00Z', value: 0},
  536. ],
  537. },
  538. {
  539. seriesName: 'healthy, 1 : count_crashed(session)',
  540. data: [
  541. {name: '2022-01-15T00:00:00Z', value: 0},
  542. {name: '2022-01-16T00:00:00Z', value: 0},
  543. {name: '2022-01-17T00:00:00Z', value: 0},
  544. {name: '2022-01-18T00:00:00Z', value: 0},
  545. {name: '2022-01-19T00:00:00Z', value: 0},
  546. {name: '2022-01-20T00:00:00Z', value: 0},
  547. {name: '2022-01-21T00:00:00Z', value: 0},
  548. {name: '2022-01-22T00:00:00Z', value: 0},
  549. {name: '2022-01-23T00:00:00Z', value: 0},
  550. {name: '2022-01-24T00:00:00Z', value: 0},
  551. {name: '2022-01-25T00:00:00Z', value: 0},
  552. {name: '2022-01-26T00:00:00Z', value: 0},
  553. {name: '2022-01-27T00:00:00Z', value: 0},
  554. {name: '2022-01-28T00:00:00Z', value: 0},
  555. ],
  556. },
  557. {
  558. seriesName: 'crashed, 2 : sum(session)',
  559. data: [
  560. {name: '2022-01-15T00:00:00Z', value: 1},
  561. {name: '2022-01-16T00:00:00Z', value: 0},
  562. {name: '2022-01-17T00:00:00Z', value: 0},
  563. {name: '2022-01-18T00:00:00Z', value: 0},
  564. {name: '2022-01-19T00:00:00Z', value: 0},
  565. {name: '2022-01-20T00:00:00Z', value: 0},
  566. {name: '2022-01-21T00:00:00Z', value: 0},
  567. {name: '2022-01-22T00:00:00Z', value: 0},
  568. {name: '2022-01-23T00:00:00Z', value: 0},
  569. {name: '2022-01-24T00:00:00Z', value: 23},
  570. {name: '2022-01-25T00:00:00Z', value: 11},
  571. {name: '2022-01-26T00:00:00Z', value: 0},
  572. {name: '2022-01-27T00:00:00Z', value: 0},
  573. {name: '2022-01-28T00:00:00Z', value: 0},
  574. ],
  575. },
  576. {
  577. seriesName: 'crashed, 2 : count_unique(user)',
  578. data: [
  579. {name: '2022-01-15T00:00:00Z', value: 1},
  580. {name: '2022-01-16T00:00:00Z', value: 0},
  581. {name: '2022-01-17T00:00:00Z', value: 0},
  582. {name: '2022-01-18T00:00:00Z', value: 0},
  583. {name: '2022-01-19T00:00:00Z', value: 0},
  584. {name: '2022-01-20T00:00:00Z', value: 0},
  585. {name: '2022-01-21T00:00:00Z', value: 0},
  586. {name: '2022-01-22T00:00:00Z', value: 0},
  587. {name: '2022-01-23T00:00:00Z', value: 0},
  588. {name: '2022-01-24T00:00:00Z', value: 2},
  589. {name: '2022-01-25T00:00:00Z', value: 2},
  590. {name: '2022-01-26T00:00:00Z', value: 0},
  591. {name: '2022-01-27T00:00:00Z', value: 0},
  592. {name: '2022-01-28T00:00:00Z', value: 0},
  593. ],
  594. },
  595. {
  596. seriesName: 'crashed, 2 : count_crashed(session)',
  597. data: [
  598. {name: '2022-01-15T00:00:00Z', value: 1},
  599. {name: '2022-01-16T00:00:00Z', value: 0},
  600. {name: '2022-01-17T00:00:00Z', value: 0},
  601. {name: '2022-01-18T00:00:00Z', value: 0},
  602. {name: '2022-01-19T00:00:00Z', value: 0},
  603. {name: '2022-01-20T00:00:00Z', value: 0},
  604. {name: '2022-01-21T00:00:00Z', value: 0},
  605. {name: '2022-01-22T00:00:00Z', value: 0},
  606. {name: '2022-01-23T00:00:00Z', value: 0},
  607. {name: '2022-01-24T00:00:00Z', value: 23},
  608. {name: '2022-01-25T00:00:00Z', value: 11},
  609. {name: '2022-01-26T00:00:00Z', value: 0},
  610. {name: '2022-01-27T00:00:00Z', value: 0},
  611. {name: '2022-01-28T00:00:00Z', value: 0},
  612. ],
  613. },
  614. {
  615. seriesName: 'abnormal, 2 : sum(session)',
  616. data: [
  617. {name: '2022-01-15T00:00:00Z', value: 1},
  618. {name: '2022-01-16T00:00:00Z', value: 0},
  619. {name: '2022-01-17T00:00:00Z', value: 0},
  620. {name: '2022-01-18T00:00:00Z', value: 0},
  621. {name: '2022-01-19T00:00:00Z', value: 0},
  622. {name: '2022-01-20T00:00:00Z', value: 0},
  623. {name: '2022-01-21T00:00:00Z', value: 0},
  624. {name: '2022-01-22T00:00:00Z', value: 0},
  625. {name: '2022-01-23T00:00:00Z', value: 0},
  626. {name: '2022-01-24T00:00:00Z', value: 0},
  627. {name: '2022-01-25T00:00:00Z', value: 0},
  628. {name: '2022-01-26T00:00:00Z', value: 0},
  629. {name: '2022-01-27T00:00:00Z', value: 0},
  630. {name: '2022-01-28T00:00:00Z', value: 0},
  631. ],
  632. },
  633. {
  634. seriesName: 'abnormal, 2 : count_unique(user)',
  635. data: [
  636. {name: '2022-01-15T00:00:00Z', value: 1},
  637. {name: '2022-01-16T00:00:00Z', value: 0},
  638. {name: '2022-01-17T00:00:00Z', value: 0},
  639. {name: '2022-01-18T00:00:00Z', value: 0},
  640. {name: '2022-01-19T00:00:00Z', value: 0},
  641. {name: '2022-01-20T00:00:00Z', value: 0},
  642. {name: '2022-01-21T00:00:00Z', value: 0},
  643. {name: '2022-01-22T00:00:00Z', value: 0},
  644. {name: '2022-01-23T00:00:00Z', value: 0},
  645. {name: '2022-01-24T00:00:00Z', value: 0},
  646. {name: '2022-01-25T00:00:00Z', value: 0},
  647. {name: '2022-01-26T00:00:00Z', value: 0},
  648. {name: '2022-01-27T00:00:00Z', value: 0},
  649. {name: '2022-01-28T00:00:00Z', value: 0},
  650. ],
  651. },
  652. {
  653. seriesName: 'abnormal, 2 : count_crashed(session)',
  654. data: [
  655. {name: '2022-01-15T00:00:00Z', value: 0},
  656. {name: '2022-01-16T00:00:00Z', value: 0},
  657. {name: '2022-01-17T00:00:00Z', value: 0},
  658. {name: '2022-01-18T00:00:00Z', value: 0},
  659. {name: '2022-01-19T00:00:00Z', value: 0},
  660. {name: '2022-01-20T00:00:00Z', value: 0},
  661. {name: '2022-01-21T00:00:00Z', value: 0},
  662. {name: '2022-01-22T00:00:00Z', value: 0},
  663. {name: '2022-01-23T00:00:00Z', value: 0},
  664. {name: '2022-01-24T00:00:00Z', value: 0},
  665. {name: '2022-01-25T00:00:00Z', value: 0},
  666. {name: '2022-01-26T00:00:00Z', value: 0},
  667. {name: '2022-01-27T00:00:00Z', value: 0},
  668. {name: '2022-01-28T00:00:00Z', value: 0},
  669. ],
  670. },
  671. {
  672. seriesName: 'errored, 2 : sum(session)',
  673. data: [
  674. {name: '2022-01-15T00:00:00Z', value: 1},
  675. {name: '2022-01-16T00:00:00Z', value: 0},
  676. {name: '2022-01-17T00:00:00Z', value: 0},
  677. {name: '2022-01-18T00:00:00Z', value: 0},
  678. {name: '2022-01-19T00:00:00Z', value: 0},
  679. {name: '2022-01-20T00:00:00Z', value: 37},
  680. {name: '2022-01-21T00:00:00Z', value: 0},
  681. {name: '2022-01-22T00:00:00Z', value: 0},
  682. {name: '2022-01-23T00:00:00Z', value: 0},
  683. {name: '2022-01-24T00:00:00Z', value: 335},
  684. {name: '2022-01-25T00:00:00Z', value: 79},
  685. {name: '2022-01-26T00:00:00Z', value: 0},
  686. {name: '2022-01-27T00:00:00Z', value: 0},
  687. {name: '2022-01-28T00:00:00Z', value: 0},
  688. ],
  689. },
  690. {
  691. seriesName: 'errored, 2 : count_unique(user)',
  692. data: [
  693. {name: '2022-01-15T00:00:00Z', value: 1},
  694. {name: '2022-01-16T00:00:00Z', value: 0},
  695. {name: '2022-01-17T00:00:00Z', value: 0},
  696. {name: '2022-01-18T00:00:00Z', value: 0},
  697. {name: '2022-01-19T00:00:00Z', value: 0},
  698. {name: '2022-01-20T00:00:00Z', value: 1},
  699. {name: '2022-01-21T00:00:00Z', value: 0},
  700. {name: '2022-01-22T00:00:00Z', value: 0},
  701. {name: '2022-01-23T00:00:00Z', value: 0},
  702. {name: '2022-01-24T00:00:00Z', value: 1},
  703. {name: '2022-01-25T00:00:00Z', value: 1},
  704. {name: '2022-01-26T00:00:00Z', value: 0},
  705. {name: '2022-01-27T00:00:00Z', value: 0},
  706. {name: '2022-01-28T00:00:00Z', value: 0},
  707. ],
  708. },
  709. {
  710. seriesName: 'errored, 2 : count_crashed(session)',
  711. data: [
  712. {name: '2022-01-15T00:00:00Z', value: 0},
  713. {name: '2022-01-16T00:00:00Z', value: 0},
  714. {name: '2022-01-17T00:00:00Z', value: 0},
  715. {name: '2022-01-18T00:00:00Z', value: 0},
  716. {name: '2022-01-19T00:00:00Z', value: 0},
  717. {name: '2022-01-20T00:00:00Z', value: 0},
  718. {name: '2022-01-21T00:00:00Z', value: 0},
  719. {name: '2022-01-22T00:00:00Z', value: 0},
  720. {name: '2022-01-23T00:00:00Z', value: 0},
  721. {name: '2022-01-24T00:00:00Z', value: 0},
  722. {name: '2022-01-25T00:00:00Z', value: 0},
  723. {name: '2022-01-26T00:00:00Z', value: 0},
  724. {name: '2022-01-27T00:00:00Z', value: 0},
  725. {name: '2022-01-28T00:00:00Z', value: 0},
  726. ],
  727. },
  728. {
  729. seriesName: 'healthy, 2 : sum(session)',
  730. data: [
  731. {name: '2022-01-15T00:00:00Z', value: 1},
  732. {name: '2022-01-16T00:00:00Z', value: 0},
  733. {name: '2022-01-17T00:00:00Z', value: 0},
  734. {name: '2022-01-18T00:00:00Z', value: 0},
  735. {name: '2022-01-19T00:00:00Z', value: 0},
  736. {name: '2022-01-20T00:00:00Z', value: 2503},
  737. {name: '2022-01-21T00:00:00Z', value: 661},
  738. {name: '2022-01-22T00:00:00Z', value: 0},
  739. {name: '2022-01-23T00:00:00Z', value: 0},
  740. {name: '2022-01-24T00:00:00Z', value: 1464},
  741. {name: '2022-01-25T00:00:00Z', value: 430},
  742. {name: '2022-01-26T00:00:00Z', value: 0},
  743. {name: '2022-01-27T00:00:00Z', value: 0},
  744. {name: '2022-01-28T00:00:00Z', value: 0},
  745. ],
  746. },
  747. {
  748. seriesName: 'healthy, 2 : count_unique(user)',
  749. data: [
  750. {name: '2022-01-15T00:00:00Z', value: 1},
  751. {name: '2022-01-16T00:00:00Z', value: 0},
  752. {name: '2022-01-17T00:00:00Z', value: 0},
  753. {name: '2022-01-18T00:00:00Z', value: 0},
  754. {name: '2022-01-19T00:00:00Z', value: 0},
  755. {name: '2022-01-20T00:00:00Z', value: 10},
  756. {name: '2022-01-21T00:00:00Z', value: 3},
  757. {name: '2022-01-22T00:00:00Z', value: 0},
  758. {name: '2022-01-23T00:00:00Z', value: 0},
  759. {name: '2022-01-24T00:00:00Z', value: 4},
  760. {name: '2022-01-25T00:00:00Z', value: 3},
  761. {name: '2022-01-26T00:00:00Z', value: 0},
  762. {name: '2022-01-27T00:00:00Z', value: 0},
  763. {name: '2022-01-28T00:00:00Z', value: 0},
  764. ],
  765. },
  766. {
  767. seriesName: 'healthy, 2 : count_crashed(session)',
  768. data: [
  769. {name: '2022-01-15T00:00:00Z', value: 0},
  770. {name: '2022-01-16T00:00:00Z', value: 0},
  771. {name: '2022-01-17T00:00:00Z', value: 0},
  772. {name: '2022-01-18T00:00:00Z', value: 0},
  773. {name: '2022-01-19T00:00:00Z', value: 0},
  774. {name: '2022-01-20T00:00:00Z', value: 0},
  775. {name: '2022-01-21T00:00:00Z', value: 0},
  776. {name: '2022-01-22T00:00:00Z', value: 0},
  777. {name: '2022-01-23T00:00:00Z', value: 0},
  778. {name: '2022-01-24T00:00:00Z', value: 0},
  779. {name: '2022-01-25T00:00:00Z', value: 0},
  780. {name: '2022-01-26T00:00:00Z', value: 0},
  781. {name: '2022-01-27T00:00:00Z', value: 0},
  782. {name: '2022-01-28T00:00:00Z', value: 0},
  783. ],
  784. },
  785. ]);
  786. });
  787. it('omits injected fields', () => {
  788. expect(
  789. transformSessionsResponseToSeries(
  790. SessionUserCountByStatusByReleaseFixture(),
  791. ['count_crashed(session)'],
  792. ['sum(session)']
  793. )
  794. ).toEqual([
  795. {
  796. seriesName: 'crashed, 1 : count_unique(user)',
  797. data: [
  798. {name: '2022-01-15T00:00:00Z', value: 0},
  799. {name: '2022-01-16T00:00:00Z', value: 0},
  800. {name: '2022-01-17T00:00:00Z', value: 0},
  801. {name: '2022-01-18T00:00:00Z', value: 0},
  802. {name: '2022-01-19T00:00:00Z', value: 0},
  803. {name: '2022-01-20T00:00:00Z', value: 0},
  804. {name: '2022-01-21T00:00:00Z', value: 0},
  805. {name: '2022-01-22T00:00:00Z', value: 0},
  806. {name: '2022-01-23T00:00:00Z', value: 0},
  807. {name: '2022-01-24T00:00:00Z', value: 1},
  808. {name: '2022-01-25T00:00:00Z', value: 1},
  809. {name: '2022-01-26T00:00:00Z', value: 0},
  810. {name: '2022-01-27T00:00:00Z', value: 0},
  811. {name: '2022-01-28T00:00:00Z', value: 0},
  812. ],
  813. },
  814. {
  815. seriesName: 'crashed, 1 : count_crashed(session)',
  816. data: [
  817. {name: '2022-01-15T00:00:00Z', value: 0},
  818. {name: '2022-01-16T00:00:00Z', value: 0},
  819. {name: '2022-01-17T00:00:00Z', value: 0},
  820. {name: '2022-01-18T00:00:00Z', value: 0},
  821. {name: '2022-01-19T00:00:00Z', value: 0},
  822. {name: '2022-01-20T00:00:00Z', value: 0},
  823. {name: '2022-01-21T00:00:00Z', value: 0},
  824. {name: '2022-01-22T00:00:00Z', value: 0},
  825. {name: '2022-01-23T00:00:00Z', value: 0},
  826. {name: '2022-01-24T00:00:00Z', value: 23},
  827. {name: '2022-01-25T00:00:00Z', value: 11},
  828. {name: '2022-01-26T00:00:00Z', value: 0},
  829. {name: '2022-01-27T00:00:00Z', value: 0},
  830. {name: '2022-01-28T00:00:00Z', value: 0},
  831. ],
  832. },
  833. {
  834. seriesName: 'abnormal, 1 : count_unique(user)',
  835. data: [
  836. {name: '2022-01-15T00:00:00Z', value: 1},
  837. {name: '2022-01-16T00:00:00Z', value: 0},
  838. {name: '2022-01-17T00:00:00Z', value: 0},
  839. {name: '2022-01-18T00:00:00Z', value: 0},
  840. {name: '2022-01-19T00:00:00Z', value: 0},
  841. {name: '2022-01-20T00:00:00Z', value: 0},
  842. {name: '2022-01-21T00:00:00Z', value: 0},
  843. {name: '2022-01-22T00:00:00Z', value: 0},
  844. {name: '2022-01-23T00:00:00Z', value: 0},
  845. {name: '2022-01-24T00:00:00Z', value: 0},
  846. {name: '2022-01-25T00:00:00Z', value: 0},
  847. {name: '2022-01-26T00:00:00Z', value: 0},
  848. {name: '2022-01-27T00:00:00Z', value: 0},
  849. {name: '2022-01-28T00:00:00Z', value: 0},
  850. ],
  851. },
  852. {
  853. seriesName: 'abnormal, 1 : count_crashed(session)',
  854. data: [
  855. {name: '2022-01-15T00:00:00Z', value: 0},
  856. {name: '2022-01-16T00:00:00Z', value: 0},
  857. {name: '2022-01-17T00:00:00Z', value: 0},
  858. {name: '2022-01-18T00:00:00Z', value: 0},
  859. {name: '2022-01-19T00:00:00Z', value: 0},
  860. {name: '2022-01-20T00:00:00Z', value: 0},
  861. {name: '2022-01-21T00:00:00Z', value: 0},
  862. {name: '2022-01-22T00:00:00Z', value: 0},
  863. {name: '2022-01-23T00:00:00Z', value: 0},
  864. {name: '2022-01-24T00:00:00Z', value: 0},
  865. {name: '2022-01-25T00:00:00Z', value: 0},
  866. {name: '2022-01-26T00:00:00Z', value: 0},
  867. {name: '2022-01-27T00:00:00Z', value: 0},
  868. {name: '2022-01-28T00:00:00Z', value: 0},
  869. ],
  870. },
  871. {
  872. seriesName: 'errored, 1 : count_unique(user)',
  873. data: [
  874. {name: '2022-01-15T00:00:00Z', value: 0},
  875. {name: '2022-01-16T00:00:00Z', value: 0},
  876. {name: '2022-01-17T00:00:00Z', value: 0},
  877. {name: '2022-01-18T00:00:00Z', value: 0},
  878. {name: '2022-01-19T00:00:00Z', value: 0},
  879. {name: '2022-01-20T00:00:00Z', value: 1},
  880. {name: '2022-01-21T00:00:00Z', value: 0},
  881. {name: '2022-01-22T00:00:00Z', value: 0},
  882. {name: '2022-01-23T00:00:00Z', value: 0},
  883. {name: '2022-01-24T00:00:00Z', value: 2},
  884. {name: '2022-01-25T00:00:00Z', value: 2},
  885. {name: '2022-01-26T00:00:00Z', value: 0},
  886. {name: '2022-01-27T00:00:00Z', value: 0},
  887. {name: '2022-01-28T00:00:00Z', value: 0},
  888. ],
  889. },
  890. {
  891. seriesName: 'errored, 1 : count_crashed(session)',
  892. data: [
  893. {name: '2022-01-15T00:00:00Z', value: 0},
  894. {name: '2022-01-16T00:00:00Z', value: 0},
  895. {name: '2022-01-17T00:00:00Z', value: 0},
  896. {name: '2022-01-18T00:00:00Z', value: 0},
  897. {name: '2022-01-19T00:00:00Z', value: 0},
  898. {name: '2022-01-20T00:00:00Z', value: 0},
  899. {name: '2022-01-21T00:00:00Z', value: 0},
  900. {name: '2022-01-22T00:00:00Z', value: 0},
  901. {name: '2022-01-23T00:00:00Z', value: 0},
  902. {name: '2022-01-24T00:00:00Z', value: 0},
  903. {name: '2022-01-25T00:00:00Z', value: 0},
  904. {name: '2022-01-26T00:00:00Z', value: 0},
  905. {name: '2022-01-27T00:00:00Z', value: 0},
  906. {name: '2022-01-28T00:00:00Z', value: 0},
  907. ],
  908. },
  909. {
  910. seriesName: 'healthy, 1 : count_unique(user)',
  911. data: [
  912. {name: '2022-01-15T00:00:00Z', value: 0},
  913. {name: '2022-01-16T00:00:00Z', value: 0},
  914. {name: '2022-01-17T00:00:00Z', value: 0},
  915. {name: '2022-01-18T00:00:00Z', value: 0},
  916. {name: '2022-01-19T00:00:00Z', value: 0},
  917. {name: '2022-01-20T00:00:00Z', value: 3},
  918. {name: '2022-01-21T00:00:00Z', value: 3},
  919. {name: '2022-01-22T00:00:00Z', value: 0},
  920. {name: '2022-01-23T00:00:00Z', value: 0},
  921. {name: '2022-01-24T00:00:00Z', value: 1},
  922. {name: '2022-01-25T00:00:00Z', value: 1},
  923. {name: '2022-01-26T00:00:00Z', value: 0},
  924. {name: '2022-01-27T00:00:00Z', value: 0},
  925. {name: '2022-01-28T00:00:00Z', value: 0},
  926. ],
  927. },
  928. {
  929. seriesName: 'healthy, 1 : count_crashed(session)',
  930. data: [
  931. {name: '2022-01-15T00:00:00Z', value: 0},
  932. {name: '2022-01-16T00:00:00Z', value: 0},
  933. {name: '2022-01-17T00:00:00Z', value: 0},
  934. {name: '2022-01-18T00:00:00Z', value: 0},
  935. {name: '2022-01-19T00:00:00Z', value: 0},
  936. {name: '2022-01-20T00:00:00Z', value: 0},
  937. {name: '2022-01-21T00:00:00Z', value: 0},
  938. {name: '2022-01-22T00:00:00Z', value: 0},
  939. {name: '2022-01-23T00:00:00Z', value: 0},
  940. {name: '2022-01-24T00:00:00Z', value: 0},
  941. {name: '2022-01-25T00:00:00Z', value: 0},
  942. {name: '2022-01-26T00:00:00Z', value: 0},
  943. {name: '2022-01-27T00:00:00Z', value: 0},
  944. {name: '2022-01-28T00:00:00Z', value: 0},
  945. ],
  946. },
  947. {
  948. seriesName: 'crashed, 2 : count_unique(user)',
  949. data: [
  950. {name: '2022-01-15T00:00:00Z', value: 1},
  951. {name: '2022-01-16T00:00:00Z', value: 0},
  952. {name: '2022-01-17T00:00:00Z', value: 0},
  953. {name: '2022-01-18T00:00:00Z', value: 0},
  954. {name: '2022-01-19T00:00:00Z', value: 0},
  955. {name: '2022-01-20T00:00:00Z', value: 0},
  956. {name: '2022-01-21T00:00:00Z', value: 0},
  957. {name: '2022-01-22T00:00:00Z', value: 0},
  958. {name: '2022-01-23T00:00:00Z', value: 0},
  959. {name: '2022-01-24T00:00:00Z', value: 2},
  960. {name: '2022-01-25T00:00:00Z', value: 2},
  961. {name: '2022-01-26T00:00:00Z', value: 0},
  962. {name: '2022-01-27T00:00:00Z', value: 0},
  963. {name: '2022-01-28T00:00:00Z', value: 0},
  964. ],
  965. },
  966. {
  967. seriesName: 'crashed, 2 : count_crashed(session)',
  968. data: [
  969. {name: '2022-01-15T00:00:00Z', value: 1},
  970. {name: '2022-01-16T00:00:00Z', value: 0},
  971. {name: '2022-01-17T00:00:00Z', value: 0},
  972. {name: '2022-01-18T00:00:00Z', value: 0},
  973. {name: '2022-01-19T00:00:00Z', value: 0},
  974. {name: '2022-01-20T00:00:00Z', value: 0},
  975. {name: '2022-01-21T00:00:00Z', value: 0},
  976. {name: '2022-01-22T00:00:00Z', value: 0},
  977. {name: '2022-01-23T00:00:00Z', value: 0},
  978. {name: '2022-01-24T00:00:00Z', value: 23},
  979. {name: '2022-01-25T00:00:00Z', value: 11},
  980. {name: '2022-01-26T00:00:00Z', value: 0},
  981. {name: '2022-01-27T00:00:00Z', value: 0},
  982. {name: '2022-01-28T00:00:00Z', value: 0},
  983. ],
  984. },
  985. {
  986. seriesName: 'abnormal, 2 : count_unique(user)',
  987. data: [
  988. {name: '2022-01-15T00:00:00Z', value: 1},
  989. {name: '2022-01-16T00:00:00Z', value: 0},
  990. {name: '2022-01-17T00:00:00Z', value: 0},
  991. {name: '2022-01-18T00:00:00Z', value: 0},
  992. {name: '2022-01-19T00:00:00Z', value: 0},
  993. {name: '2022-01-20T00:00:00Z', value: 0},
  994. {name: '2022-01-21T00:00:00Z', value: 0},
  995. {name: '2022-01-22T00:00:00Z', value: 0},
  996. {name: '2022-01-23T00:00:00Z', value: 0},
  997. {name: '2022-01-24T00:00:00Z', value: 0},
  998. {name: '2022-01-25T00:00:00Z', value: 0},
  999. {name: '2022-01-26T00:00:00Z', value: 0},
  1000. {name: '2022-01-27T00:00:00Z', value: 0},
  1001. {name: '2022-01-28T00:00:00Z', value: 0},
  1002. ],
  1003. },
  1004. {
  1005. seriesName: 'abnormal, 2 : count_crashed(session)',
  1006. data: [
  1007. {name: '2022-01-15T00:00:00Z', value: 0},
  1008. {name: '2022-01-16T00:00:00Z', value: 0},
  1009. {name: '2022-01-17T00:00:00Z', value: 0},
  1010. {name: '2022-01-18T00:00:00Z', value: 0},
  1011. {name: '2022-01-19T00:00:00Z', value: 0},
  1012. {name: '2022-01-20T00:00:00Z', value: 0},
  1013. {name: '2022-01-21T00:00:00Z', value: 0},
  1014. {name: '2022-01-22T00:00:00Z', value: 0},
  1015. {name: '2022-01-23T00:00:00Z', value: 0},
  1016. {name: '2022-01-24T00:00:00Z', value: 0},
  1017. {name: '2022-01-25T00:00:00Z', value: 0},
  1018. {name: '2022-01-26T00:00:00Z', value: 0},
  1019. {name: '2022-01-27T00:00:00Z', value: 0},
  1020. {name: '2022-01-28T00:00:00Z', value: 0},
  1021. ],
  1022. },
  1023. {
  1024. seriesName: 'errored, 2 : count_unique(user)',
  1025. data: [
  1026. {name: '2022-01-15T00:00:00Z', value: 1},
  1027. {name: '2022-01-16T00:00:00Z', value: 0},
  1028. {name: '2022-01-17T00:00:00Z', value: 0},
  1029. {name: '2022-01-18T00:00:00Z', value: 0},
  1030. {name: '2022-01-19T00:00:00Z', value: 0},
  1031. {name: '2022-01-20T00:00:00Z', value: 1},
  1032. {name: '2022-01-21T00:00:00Z', value: 0},
  1033. {name: '2022-01-22T00:00:00Z', value: 0},
  1034. {name: '2022-01-23T00:00:00Z', value: 0},
  1035. {name: '2022-01-24T00:00:00Z', value: 1},
  1036. {name: '2022-01-25T00:00:00Z', value: 1},
  1037. {name: '2022-01-26T00:00:00Z', value: 0},
  1038. {name: '2022-01-27T00:00:00Z', value: 0},
  1039. {name: '2022-01-28T00:00:00Z', value: 0},
  1040. ],
  1041. },
  1042. {
  1043. seriesName: 'errored, 2 : count_crashed(session)',
  1044. data: [
  1045. {name: '2022-01-15T00:00:00Z', value: 0},
  1046. {name: '2022-01-16T00:00:00Z', value: 0},
  1047. {name: '2022-01-17T00:00:00Z', value: 0},
  1048. {name: '2022-01-18T00:00:00Z', value: 0},
  1049. {name: '2022-01-19T00:00:00Z', value: 0},
  1050. {name: '2022-01-20T00:00:00Z', value: 0},
  1051. {name: '2022-01-21T00:00:00Z', value: 0},
  1052. {name: '2022-01-22T00:00:00Z', value: 0},
  1053. {name: '2022-01-23T00:00:00Z', value: 0},
  1054. {name: '2022-01-24T00:00:00Z', value: 0},
  1055. {name: '2022-01-25T00:00:00Z', value: 0},
  1056. {name: '2022-01-26T00:00:00Z', value: 0},
  1057. {name: '2022-01-27T00:00:00Z', value: 0},
  1058. {name: '2022-01-28T00:00:00Z', value: 0},
  1059. ],
  1060. },
  1061. {
  1062. seriesName: 'healthy, 2 : count_unique(user)',
  1063. data: [
  1064. {name: '2022-01-15T00:00:00Z', value: 1},
  1065. {name: '2022-01-16T00:00:00Z', value: 0},
  1066. {name: '2022-01-17T00:00:00Z', value: 0},
  1067. {name: '2022-01-18T00:00:00Z', value: 0},
  1068. {name: '2022-01-19T00:00:00Z', value: 0},
  1069. {name: '2022-01-20T00:00:00Z', value: 10},
  1070. {name: '2022-01-21T00:00:00Z', value: 3},
  1071. {name: '2022-01-22T00:00:00Z', value: 0},
  1072. {name: '2022-01-23T00:00:00Z', value: 0},
  1073. {name: '2022-01-24T00:00:00Z', value: 4},
  1074. {name: '2022-01-25T00:00:00Z', value: 3},
  1075. {name: '2022-01-26T00:00:00Z', value: 0},
  1076. {name: '2022-01-27T00:00:00Z', value: 0},
  1077. {name: '2022-01-28T00:00:00Z', value: 0},
  1078. ],
  1079. },
  1080. {
  1081. seriesName: 'healthy, 2 : count_crashed(session)',
  1082. data: [
  1083. {name: '2022-01-15T00:00:00Z', value: 0},
  1084. {name: '2022-01-16T00:00:00Z', value: 0},
  1085. {name: '2022-01-17T00:00:00Z', value: 0},
  1086. {name: '2022-01-18T00:00:00Z', value: 0},
  1087. {name: '2022-01-19T00:00:00Z', value: 0},
  1088. {name: '2022-01-20T00:00:00Z', value: 0},
  1089. {name: '2022-01-21T00:00:00Z', value: 0},
  1090. {name: '2022-01-22T00:00:00Z', value: 0},
  1091. {name: '2022-01-23T00:00:00Z', value: 0},
  1092. {name: '2022-01-24T00:00:00Z', value: 0},
  1093. {name: '2022-01-25T00:00:00Z', value: 0},
  1094. {name: '2022-01-26T00:00:00Z', value: 0},
  1095. {name: '2022-01-27T00:00:00Z', value: 0},
  1096. {name: '2022-01-28T00:00:00Z', value: 0},
  1097. ],
  1098. },
  1099. ]);
  1100. });
  1101. it('returns a single series with 0 as values when there are no groups returned', () => {
  1102. expect(
  1103. transformSessionsResponseToSeries(SessionEmptyGroupedResponseFixture(), [], [])
  1104. ).toEqual([
  1105. {
  1106. seriesName: '(no results)',
  1107. data: [
  1108. {name: '2022-01-15T00:00:00Z', value: 0},
  1109. {name: '2022-01-16T00:00:00Z', value: 0},
  1110. {name: '2022-01-17T00:00:00Z', value: 0},
  1111. {name: '2022-01-18T00:00:00Z', value: 0},
  1112. {name: '2022-01-19T00:00:00Z', value: 0},
  1113. {name: '2022-01-20T00:00:00Z', value: 0},
  1114. {name: '2022-01-21T00:00:00Z', value: 0},
  1115. {name: '2022-01-22T00:00:00Z', value: 0},
  1116. {name: '2022-01-23T00:00:00Z', value: 0},
  1117. {name: '2022-01-24T00:00:00Z', value: 0},
  1118. {name: '2022-01-25T00:00:00Z', value: 0},
  1119. {name: '2022-01-26T00:00:00Z', value: 0},
  1120. {name: '2022-01-27T00:00:00Z', value: 0},
  1121. {name: '2022-01-28T00:00:00Z', value: 0},
  1122. ],
  1123. },
  1124. ]);
  1125. });
  1126. it('supports legend aliases', () => {
  1127. expect(
  1128. transformSessionsResponseToSeries(
  1129. SessionUserCountByStatusByReleaseFixture(),
  1130. [],
  1131. [],
  1132. 'Lorem'
  1133. )[0]
  1134. ).toEqual(
  1135. expect.objectContaining({
  1136. seriesName: 'Lorem > crashed, 1 : sum(session)',
  1137. })
  1138. );
  1139. });
  1140. });