require "./setup"
_ { Swars::User["BOUYATETSU5"].stat(sample_max: 500).unstable_network_stat.count } # => "151.08 ms"
s { Swars::User["BOUYATETSU5"].stat(sample_max: 500).unstable_network_stat.count } # => 8
# >>   Swars::User Load (0.3ms)  SELECT `swars_users`.* FROM `swars_users` WHERE `swars_users`.`user_key` = 'BOUYATETSU5' LIMIT 1
# >>   ↳ app/models/swars/user.rb:44:in `[]'
# >>   Swars::Membership Ids (14.9ms)  SELECT `swars_memberships`.`id` FROM `swars_memberships` INNER JOIN `swars_battles` ON `swars_battles`.`id` = `swars_memberships`.`battle_id` WHERE `swars_memberships`.`user_id` = 228939 ORDER BY `swars_battles`.`battled_at` DESC LIMIT 500
# >>   ↳ app/models/swars/user/stat/scope_ext.rb:31:in `scope_ids'
# >>   Swars::Membership Count (2.6ms)  SELECT COUNT(*) FROM `swars_memberships` INNER JOIN `swars_battles` ON `swars_battles`.`id` = `swars_memberships`.`battle_id` INNER JOIN `swars_finals` ON `swars_finals`.`id` = `swars_battles`.`final_id` INNER JOIN `judges` ON `judges`.`id` = `swars_memberships`.`judge_id` WHERE `swars_memberships`.`id` IN (115532118, 115531275, 115531278, 115531280, 115328506, 115329127, 115329128, 115323281, 115321144, 115320926, 115316398, 115313150, 115313152, 115313153, 115259266, 115257736, 115253086, 115253089, 115250565, 115250566, 115244162, 115244165, 115125401, 115119978, 115118826, 115118280, 115115077, 115115080, 115109340, 115108255, 113848906, 113839569, 113583022, 113583024, 113580093, 113580094, 113580096, 113578125, 113572614, 113572616, 113572620, 113572625, 113572626, 113380852, 113379293, 113380855, 113375302, 113374368, 113371363, 113341249, 113185345, 113184509, 113181557, 113178430, 113175297, 113175026, 113175028, 113175029, 113175031, 112404737, 112404738, 111903910, 111898599, 111896856, 111836130, 111834636, 111829769, 111829771, 111824592, 111829774, 111829776, 111829777, 111506383, 111506384, 111499916, 111498873, 111498876, 111498877, 110726587, 110726590, 110726591, 110720985, 110717008, 110717011, 110717013, 110414770, 110413759, 110412679, 110412710, 110412714, 110410535, 110410537, 110408830, 110408832, 110406521, 110405722, 110405724, 110405725, 110405728, 110401543, 110401545, 110401548, 110401549, 110401551, 110401553, 110401556, 110401558, 110401560, 110401561, 110278183, 110274383, 110274384, 110267067, 110274386, 110263931, 110263137, 110263139, 109469435, 109469436, 109469439, 109469441, 109469443, 109469445, 109469447, 109328264, 109328265, 109328267, 109321853, 109321855, 109321856, 109321859, 109271375, 109267452, 109264009, 109261625, 109261627, 109255354, 109257576, 109251714, 109257582, 107816075, 107816077, 107812242, 107812245, 107812247, 107806108, 107425187, 107417860, 107417862, 107414187, 107413649, 107411709, 107411712, 107411714, 107411716, 107068110, 107061419, 107061423, 107061427, 107058002, 107058004, 107058006, 107051784, 107049868, 107049872, 107049875, 106858692, 106856649, 106856543, 106856546, 106856548, 106856549, 106850601, 106849103, 106845553, 106845555, 106845557, 106297435, 106297437, 106294093, 106291937, 106290512, 106289594, 106289595, 106289598, 106285157, 106281606, 106278229, 106278230, 105380702, 105372924, 105372927, 105367264, 105361124, 105360830, 105360831, 104801693, 104801774, 104801707, 104790668, 104789451, 104787185, 104355208, 104354836, 104350682, 104348210, 104346416, 104346419, 104346421, 104341021, 104340145, 104337187, 103981685, 103981686, 103976080, 103974669, 103968648, 103967141, 103967143, 102984349, 102980305, 102980306, 102977135, 102976837, 102976839, 102975997, 102972428, 102969404, 102965998, 102966002, 102966007, 102961765, 102759641, 102759645, 102759647, 102752356, 102751778, 102749036, 102746830, 102744480, 102744484, 102744491, 102744494, 102007934, 101938698, 101937400, 101937401, 101931227, 101928335, 101924609, 101924611, 101140726, 100796330, 100795051, 100792874, 100792876, 100787773, 100787774, 100787776, 100780983, 100779374, 100423708, 100423710, 100423712, 100423714, 100423717, 100412921, 100411744, 100411746, 100411749, 100401278, 100401282, 100401286, 100352053, 100352055, 100344019, 100344021, 100335060, 100335061, 100335063, 100335066, 99412156, 99408166, 99404922, 99338032, 99338034, 99338037, 99338040, 99338041, 99338044, 98841385, 98841387, 98841388, 98836664, 98834308, 98829692, 98834310, 98825774, 98368179, 98364955, 98362853, 98360681, 98356113, 98352919, 98348128, 98347359, 97812799, 97809725, 97809727, 97800760, 97799103, 97798247, 97528787, 97527767, 97523837, 97522878, 97522880, 97522882, 97516465, 97522883, 97522885, 97403964, 97400591, 97397963, 97397966, 97392765, 97392773, 97392775, 97392778, 96031707, 96029067, 96027176, 96025045, 96025117, 96025118, 96019647, 96019649, 96019651, 96019653, 96014797, 96012288, 96012290, 96012292, 96008385, 96006791, 96006794, 96006796, 95622576, 95622577, 95619244, 95618779, 95616049, 95614397, 95612883, 95612888, 95607387, 95439419, 95436205, 95436207, 95432757, 95430004, 95428081, 95419939, 95365003, 95365005, 95361188, 95357186, 95355833, 95353287, 95351108, 95350319, 94975576, 94971991, 94968423, 94966179, 94962983, 94960323, 94220408, 94220410, 94216705, 94213621, 94209682, 94206121, 94206123, 94201401, 94141476, 94135660, 94134591, 94132018, 94132020, 94132023, 94132025, 94132026, 94123384, 94120967, 94119220, 94119430, 94119431, 93519184, 93518121, 93515458, 93512080, 93513608, 93506458, 93503023, 93500953, 93500958, 93500955, 93497779, 92052010, 92052014, 92052017, 92052021, 92052026, 91567597, 91564006, 91562277, 91559584, 91556126, 91550913, 91545663, 91543356, 91543361, 91415170, 91413362, 91409591, 91407119, 91407121, 91407122, 91403857, 91401147, 91350807, 91350811, 91344372, 91344373, 91339301, 91339304, 91339306, 91339308, 91332288, 91330043, 91330046, 90501423, 90501426, 90497180, 90496094, 90496095, 90489387, 90487552, 90160835, 90159679, 90157386, 90157389, 90093207, 90093211, 90093215, 90087446, 90087449, 89242030, 89241569, 89237852, 89237854, 89174888, 89174891, 89168647, 89168652, 89168653, 89099399, 89098383, 89095667, 89093335, 89093339, 89088785, 89038789, 89038669, 89033804, 89033809, 89027551, 89025916, 89027553, 89024098, 88995122, 88975217, 88972439, 88971127, 88967636, 88967534, 88964023, 88961958, 88959434, 88959082, 88959085, 88932739, 86867358, 86867362, 86867366, 86861451, 86861452, 86861455, 86853951) AND `swars_battles`.`turn_max` < 2 AND `swars_finals`.`key` = 'DISCONNECT' AND `judges`.`key` = 'lose'
# >>   ↳ app/models/swars/user/stat/unstable_network_stat.rb:28:in `block in count'
