From 0f1d1bce4df115b7fd9b279e575ae78ef0711c22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferdinand=20M=C3=BCtsch?= Date: Mon, 12 Apr 2021 22:57:15 +0200 Subject: [PATCH] fix: summary missing interval calculation (fix #168) --- coverage/coverage.out | 640 ++++++++++++++++++++------------------- services/aggregation.go | 5 - services/summary.go | 9 + services/summary_test.go | 54 ++++ 4 files changed, 388 insertions(+), 320 deletions(-) diff --git a/coverage/coverage.out b/coverage/coverage.out index df80de5..d7ab14f 100644 --- a/coverage/coverage.out +++ b/coverage/coverage.out @@ -1,55 +1,22 @@ mode: set -github.com/muety/wakapi/models/user.go:13.13,15.2 1 1 -github.com/muety/wakapi/models/user.go:78.43,81.2 1 0 -github.com/muety/wakapi/models/user.go:83.45,86.2 1 0 -github.com/muety/wakapi/models/user.go:88.33,93.2 1 0 -github.com/muety/wakapi/models/user.go:95.41,97.2 1 0 -github.com/muety/wakapi/models/user.go:99.45,101.2 1 0 -github.com/muety/wakapi/models/user.go:103.45,105.2 1 0 -github.com/muety/wakapi/models/user.go:107.39,109.2 1 0 -github.com/muety/wakapi/models/heartbeat.go:32.34,34.2 1 1 -github.com/muety/wakapi/models/heartbeat.go:36.65,37.46 1 1 -github.com/muety/wakapi/models/heartbeat.go:37.46,38.46 1 1 -github.com/muety/wakapi/models/heartbeat.go:38.46,41.4 2 1 -github.com/muety/wakapi/models/heartbeat.go:45.50,46.11 1 1 -github.com/muety/wakapi/models/heartbeat.go:59.2,59.15 1 1 -github.com/muety/wakapi/models/heartbeat.go:63.2,63.12 1 1 -github.com/muety/wakapi/models/heartbeat.go:47.22,48.18 1 1 -github.com/muety/wakapi/models/heartbeat.go:49.21,50.17 1 1 -github.com/muety/wakapi/models/heartbeat.go:51.23,52.19 1 1 -github.com/muety/wakapi/models/heartbeat.go:53.17,54.26 1 1 -github.com/muety/wakapi/models/heartbeat.go:55.22,56.18 1 1 -github.com/muety/wakapi/models/heartbeat.go:59.15,61.3 1 1 -github.com/muety/wakapi/models/heartbeat.go:66.37,82.2 1 0 -github.com/muety/wakapi/models/heartbeat.go:90.41,92.16 2 0 -github.com/muety/wakapi/models/heartbeat.go:95.2,96.10 2 0 -github.com/muety/wakapi/models/heartbeat.go:92.16,94.3 1 0 -github.com/muety/wakapi/models/heartbeats.go:7.31,9.2 1 0 -github.com/muety/wakapi/models/heartbeats.go:11.41,13.2 1 0 -github.com/muety/wakapi/models/heartbeats.go:15.36,17.2 1 0 -github.com/muety/wakapi/models/heartbeats.go:19.43,22.2 2 0 -github.com/muety/wakapi/models/heartbeats.go:24.41,26.18 1 0 -github.com/muety/wakapi/models/heartbeats.go:29.2,29.16 1 0 -github.com/muety/wakapi/models/heartbeats.go:26.18,28.3 1 0 -github.com/muety/wakapi/models/heartbeats.go:32.40,34.18 1 0 -github.com/muety/wakapi/models/heartbeats.go:37.2,37.24 1 0 -github.com/muety/wakapi/models/heartbeats.go:34.18,36.3 1 0 -github.com/muety/wakapi/models/shared.go:35.52,37.2 1 0 -github.com/muety/wakapi/models/shared.go:39.52,42.16 3 0 -github.com/muety/wakapi/models/shared.go:45.2,47.12 3 0 -github.com/muety/wakapi/models/shared.go:42.16,44.3 1 0 -github.com/muety/wakapi/models/shared.go:51.52,57.22 2 0 -github.com/muety/wakapi/models/shared.go:73.2,76.12 3 0 -github.com/muety/wakapi/models/shared.go:58.14,60.17 2 0 -github.com/muety/wakapi/models/shared.go:63.13,65.8 2 0 -github.com/muety/wakapi/models/shared.go:66.17,68.8 2 0 -github.com/muety/wakapi/models/shared.go:69.10,70.64 1 0 -github.com/muety/wakapi/models/shared.go:60.17,62.4 1 0 -github.com/muety/wakapi/models/shared.go:79.45,81.2 1 0 -github.com/muety/wakapi/models/shared.go:83.51,86.2 2 0 -github.com/muety/wakapi/models/shared.go:88.37,91.2 2 0 -github.com/muety/wakapi/models/shared.go:93.35,95.2 1 0 -github.com/muety/wakapi/models/shared.go:97.34,99.2 1 0 +github.com/muety/wakapi/models/mail_address.go:15.13,18.2 2 1 +github.com/muety/wakapi/models/mail_address.go:24.38,26.2 1 0 +github.com/muety/wakapi/models/mail_address.go:28.35,30.21 2 0 +github.com/muety/wakapi/models/mail_address.go:36.2,36.11 1 0 +github.com/muety/wakapi/models/mail_address.go:30.21,31.21 1 0 +github.com/muety/wakapi/models/mail_address.go:34.3,34.18 1 0 +github.com/muety/wakapi/models/mail_address.go:31.21,33.4 1 0 +github.com/muety/wakapi/models/mail_address.go:39.35,41.2 1 0 +github.com/muety/wakapi/models/mail_address.go:43.43,45.22 2 0 +github.com/muety/wakapi/models/mail_address.go:48.2,48.12 1 0 +github.com/muety/wakapi/models/mail_address.go:45.22,47.3 1 0 +github.com/muety/wakapi/models/mail_address.go:51.46,53.22 2 0 +github.com/muety/wakapi/models/mail_address.go:56.2,56.12 1 0 +github.com/muety/wakapi/models/mail_address.go:53.22,55.3 1 0 +github.com/muety/wakapi/models/mail_address.go:59.40,60.22 1 0 +github.com/muety/wakapi/models/mail_address.go:65.2,65.13 1 0 +github.com/muety/wakapi/models/mail_address.go:60.22,61.17 1 0 +github.com/muety/wakapi/models/mail_address.go:61.17,63.4 1 0 github.com/muety/wakapi/models/summary.go:69.29,71.2 1 1 github.com/muety/wakapi/models/summary.go:73.37,80.2 6 1 github.com/muety/wakapi/models/summary.go:82.35,84.2 1 1 @@ -100,12 +67,24 @@ github.com/muety/wakapi/models/summary.go:212.11,220.6 1 1 github.com/muety/wakapi/models/summary.go:237.33,239.2 1 1 github.com/muety/wakapi/models/summary.go:241.43,243.2 1 1 github.com/muety/wakapi/models/summary.go:245.38,247.2 1 1 -github.com/muety/wakapi/models/models.go:3.14,5.2 0 1 -github.com/muety/wakapi/models/alias.go:12.32,14.2 1 0 -github.com/muety/wakapi/models/alias.go:16.37,17.35 1 0 -github.com/muety/wakapi/models/alias.go:22.2,22.14 1 0 -github.com/muety/wakapi/models/alias.go:17.35,18.18 1 0 -github.com/muety/wakapi/models/alias.go:18.18,20.4 1 0 +github.com/muety/wakapi/models/user.go:5.13,7.2 1 1 +github.com/muety/wakapi/models/user.go:70.43,73.2 1 0 +github.com/muety/wakapi/models/user.go:75.45,78.2 1 0 +github.com/muety/wakapi/models/user.go:80.33,85.2 1 0 +github.com/muety/wakapi/models/user.go:87.41,89.2 1 0 +github.com/muety/wakapi/models/user.go:91.45,93.2 1 0 +github.com/muety/wakapi/models/user.go:95.45,97.2 1 0 +github.com/muety/wakapi/models/user.go:99.39,101.2 1 0 +github.com/muety/wakapi/models/heartbeats.go:7.31,9.2 1 0 +github.com/muety/wakapi/models/heartbeats.go:11.41,13.2 1 0 +github.com/muety/wakapi/models/heartbeats.go:15.36,17.2 1 0 +github.com/muety/wakapi/models/heartbeats.go:19.43,22.2 2 0 +github.com/muety/wakapi/models/heartbeats.go:24.41,26.18 1 0 +github.com/muety/wakapi/models/heartbeats.go:29.2,29.16 1 0 +github.com/muety/wakapi/models/heartbeats.go:26.18,28.3 1 0 +github.com/muety/wakapi/models/heartbeats.go:32.40,34.18 1 0 +github.com/muety/wakapi/models/heartbeats.go:37.2,37.24 1 0 +github.com/muety/wakapi/models/heartbeats.go:34.18,36.3 1 0 github.com/muety/wakapi/models/filters.go:16.56,17.16 1 0 github.com/muety/wakapi/models/filters.go:29.2,29.19 1 0 github.com/muety/wakapi/models/filters.go:18.22,19.32 1 0 @@ -124,6 +103,23 @@ github.com/muety/wakapi/models/filters.go:39.8,39.27 1 1 github.com/muety/wakapi/models/filters.go:39.27,41.3 1 0 github.com/muety/wakapi/models/filters.go:41.8,41.28 1 1 github.com/muety/wakapi/models/filters.go:41.28,43.3 1 0 +github.com/muety/wakapi/models/heartbeat.go:32.34,34.2 1 1 +github.com/muety/wakapi/models/heartbeat.go:36.65,37.46 1 1 +github.com/muety/wakapi/models/heartbeat.go:37.46,38.46 1 1 +github.com/muety/wakapi/models/heartbeat.go:38.46,41.4 2 1 +github.com/muety/wakapi/models/heartbeat.go:45.50,46.11 1 1 +github.com/muety/wakapi/models/heartbeat.go:59.2,59.15 1 1 +github.com/muety/wakapi/models/heartbeat.go:63.2,63.12 1 1 +github.com/muety/wakapi/models/heartbeat.go:47.22,48.18 1 1 +github.com/muety/wakapi/models/heartbeat.go:49.21,50.17 1 1 +github.com/muety/wakapi/models/heartbeat.go:51.23,52.19 1 1 +github.com/muety/wakapi/models/heartbeat.go:53.17,54.26 1 1 +github.com/muety/wakapi/models/heartbeat.go:55.22,56.18 1 1 +github.com/muety/wakapi/models/heartbeat.go:59.15,61.3 1 1 +github.com/muety/wakapi/models/heartbeat.go:66.37,82.2 1 0 +github.com/muety/wakapi/models/heartbeat.go:90.41,92.16 2 0 +github.com/muety/wakapi/models/heartbeat.go:95.2,96.10 2 0 +github.com/muety/wakapi/models/heartbeat.go:92.16,94.3 1 0 github.com/muety/wakapi/models/interval.go:39.47,40.23 1 0 github.com/muety/wakapi/models/interval.go:45.2,45.14 1 0 github.com/muety/wakapi/models/interval.go:40.23,41.13 1 0 @@ -131,107 +127,107 @@ github.com/muety/wakapi/models/interval.go:41.13,43.4 1 0 github.com/muety/wakapi/models/language_mapping.go:11.42,13.2 1 0 github.com/muety/wakapi/models/language_mapping.go:15.51,17.2 1 0 github.com/muety/wakapi/models/language_mapping.go:19.52,21.2 1 0 -github.com/muety/wakapi/config/config.go:134.70,136.2 1 0 -github.com/muety/wakapi/config/config.go:138.65,140.2 1 0 -github.com/muety/wakapi/config/config.go:142.82,152.2 1 0 -github.com/muety/wakapi/config/config.go:154.31,156.2 1 0 -github.com/muety/wakapi/config/config.go:158.32,160.2 1 0 -github.com/muety/wakapi/config/config.go:162.74,163.19 1 0 -github.com/muety/wakapi/config/config.go:164.10,165.34 1 0 -github.com/muety/wakapi/config/config.go:165.34,174.4 8 0 -github.com/muety/wakapi/config/config.go:178.73,179.33 1 0 -github.com/muety/wakapi/config/config.go:179.33,187.17 5 0 -github.com/muety/wakapi/config/config.go:191.3,192.13 2 0 -github.com/muety/wakapi/config/config.go:187.17,189.4 1 0 -github.com/muety/wakapi/config/config.go:196.50,197.19 1 0 -github.com/muety/wakapi/config/config.go:210.2,210.12 1 0 -github.com/muety/wakapi/config/config.go:198.23,202.5 1 0 -github.com/muety/wakapi/config/config.go:203.26,206.5 1 0 -github.com/muety/wakapi/config/config.go:207.24,208.48 1 0 -github.com/muety/wakapi/config/config.go:213.53,224.2 1 1 -github.com/muety/wakapi/config/config.go:226.56,228.16 2 1 -github.com/muety/wakapi/config/config.go:232.2,239.3 1 1 -github.com/muety/wakapi/config/config.go:228.16,230.3 1 0 -github.com/muety/wakapi/config/config.go:242.54,244.2 1 1 -github.com/muety/wakapi/config/config.go:246.60,248.2 1 0 -github.com/muety/wakapi/config/config.go:250.59,252.2 1 0 -github.com/muety/wakapi/config/config.go:254.57,256.2 1 0 -github.com/muety/wakapi/config/config.go:258.53,260.2 1 0 -github.com/muety/wakapi/config/config.go:262.46,264.2 1 0 -github.com/muety/wakapi/config/config.go:266.29,268.2 1 1 -github.com/muety/wakapi/config/config.go:270.27,272.16 2 0 -github.com/muety/wakapi/config/config.go:275.2,278.16 3 0 -github.com/muety/wakapi/config/config.go:282.2,282.41 1 0 -github.com/muety/wakapi/config/config.go:272.16,274.3 1 0 -github.com/muety/wakapi/config/config.go:278.16,280.3 1 0 -github.com/muety/wakapi/config/config.go:285.48,297.16 3 0 -github.com/muety/wakapi/config/config.go:300.2,302.16 3 0 -github.com/muety/wakapi/config/config.go:306.2,306.55 1 0 -github.com/muety/wakapi/config/config.go:310.2,310.15 1 0 -github.com/muety/wakapi/config/config.go:297.16,299.3 1 0 -github.com/muety/wakapi/config/config.go:302.16,304.3 1 0 -github.com/muety/wakapi/config/config.go:306.55,308.3 1 0 -github.com/muety/wakapi/config/config.go:313.38,314.43 1 0 -github.com/muety/wakapi/config/config.go:317.2,317.15 1 0 -github.com/muety/wakapi/config/config.go:314.43,316.3 1 0 -github.com/muety/wakapi/config/config.go:320.45,321.27 1 0 -github.com/muety/wakapi/config/config.go:324.2,324.15 1 0 -github.com/muety/wakapi/config/config.go:321.27,323.3 1 0 -github.com/muety/wakapi/config/config.go:327.50,331.91 1 0 -github.com/muety/wakapi/config/config.go:331.91,332.29 1 0 -github.com/muety/wakapi/config/config.go:336.4,339.48 3 0 -github.com/muety/wakapi/config/config.go:342.4,342.39 1 0 -github.com/muety/wakapi/config/config.go:345.4,345.69 1 0 -github.com/muety/wakapi/config/config.go:332.29,334.5 1 0 -github.com/muety/wakapi/config/config.go:339.48,341.5 1 0 -github.com/muety/wakapi/config/config.go:342.39,344.5 1 0 -github.com/muety/wakapi/config/config.go:347.79,351.27 2 0 -github.com/muety/wakapi/config/config.go:358.4,358.16 1 0 -github.com/muety/wakapi/config/config.go:351.27,352.84 1 0 -github.com/muety/wakapi/config/config.go:352.84,353.57 1 0 -github.com/muety/wakapi/config/config.go:353.57,355.7 1 0 -github.com/muety/wakapi/config/config.go:360.17,362.3 1 0 -github.com/muety/wakapi/config/config.go:365.77,366.29 1 0 -github.com/muety/wakapi/config/config.go:371.2,371.19 1 0 -github.com/muety/wakapi/config/config.go:366.29,367.18 1 0 -github.com/muety/wakapi/config/config.go:367.18,369.4 1 0 -github.com/muety/wakapi/config/config.go:374.26,376.2 1 0 -github.com/muety/wakapi/config/config.go:378.20,380.2 1 0 -github.com/muety/wakapi/config/config.go:382.21,387.96 3 0 -github.com/muety/wakapi/config/config.go:391.2,399.52 5 0 -github.com/muety/wakapi/config/config.go:403.2,403.47 1 0 -github.com/muety/wakapi/config/config.go:409.2,409.70 1 0 -github.com/muety/wakapi/config/config.go:413.2,413.28 1 0 -github.com/muety/wakapi/config/config.go:417.2,417.29 1 0 -github.com/muety/wakapi/config/config.go:422.2,422.94 1 0 -github.com/muety/wakapi/config/config.go:426.2,427.14 2 0 -github.com/muety/wakapi/config/config.go:387.96,389.3 1 0 -github.com/muety/wakapi/config/config.go:399.52,401.3 1 0 -github.com/muety/wakapi/config/config.go:403.47,404.14 1 0 -github.com/muety/wakapi/config/config.go:404.14,406.4 1 0 -github.com/muety/wakapi/config/config.go:409.70,411.3 1 0 -github.com/muety/wakapi/config/config.go:413.28,415.3 1 0 -github.com/muety/wakapi/config/config.go:417.29,420.3 2 0 -github.com/muety/wakapi/config/config.go:422.94,424.3 1 0 +github.com/muety/wakapi/models/mail.go:16.44,20.2 3 0 +github.com/muety/wakapi/models/mail.go:22.44,26.2 3 0 +github.com/muety/wakapi/models/mail.go:28.32,41.2 1 0 +github.com/muety/wakapi/models/mail.go:43.41,45.2 1 0 +github.com/muety/wakapi/models/models.go:3.14,5.2 0 1 +github.com/muety/wakapi/models/shared.go:35.52,37.2 1 0 +github.com/muety/wakapi/models/shared.go:39.52,42.16 3 0 +github.com/muety/wakapi/models/shared.go:45.2,47.12 3 0 +github.com/muety/wakapi/models/shared.go:42.16,44.3 1 0 +github.com/muety/wakapi/models/shared.go:51.52,57.22 2 0 +github.com/muety/wakapi/models/shared.go:73.2,76.12 3 0 +github.com/muety/wakapi/models/shared.go:58.14,60.17 2 0 +github.com/muety/wakapi/models/shared.go:63.13,65.8 2 0 +github.com/muety/wakapi/models/shared.go:66.17,68.8 2 0 +github.com/muety/wakapi/models/shared.go:69.10,70.64 1 0 +github.com/muety/wakapi/models/shared.go:60.17,62.4 1 0 +github.com/muety/wakapi/models/shared.go:79.45,81.2 1 0 +github.com/muety/wakapi/models/shared.go:83.51,86.2 2 0 +github.com/muety/wakapi/models/shared.go:88.37,91.2 2 0 +github.com/muety/wakapi/models/shared.go:93.35,95.2 1 0 +github.com/muety/wakapi/models/shared.go:97.34,99.2 1 0 +github.com/muety/wakapi/models/alias.go:12.32,14.2 1 0 +github.com/muety/wakapi/models/alias.go:16.37,17.35 1 0 +github.com/muety/wakapi/models/alias.go:22.2,22.14 1 0 +github.com/muety/wakapi/models/alias.go:17.35,18.18 1 0 +github.com/muety/wakapi/models/alias.go:18.18,20.4 1 0 +github.com/muety/wakapi/config/config.go:146.70,148.2 1 0 +github.com/muety/wakapi/config/config.go:150.65,152.2 1 0 +github.com/muety/wakapi/config/config.go:154.82,164.2 1 0 +github.com/muety/wakapi/config/config.go:166.31,168.2 1 0 +github.com/muety/wakapi/config/config.go:170.32,172.2 1 0 +github.com/muety/wakapi/config/config.go:174.74,175.19 1 0 +github.com/muety/wakapi/config/config.go:176.10,177.34 1 0 +github.com/muety/wakapi/config/config.go:177.34,186.4 8 0 +github.com/muety/wakapi/config/config.go:190.50,191.19 1 0 +github.com/muety/wakapi/config/config.go:204.2,204.12 1 0 +github.com/muety/wakapi/config/config.go:192.23,196.5 1 0 +github.com/muety/wakapi/config/config.go:197.26,200.5 1 0 +github.com/muety/wakapi/config/config.go:201.24,202.48 1 0 +github.com/muety/wakapi/config/config.go:207.53,218.2 1 1 +github.com/muety/wakapi/config/config.go:220.56,222.16 2 1 +github.com/muety/wakapi/config/config.go:226.2,233.3 1 1 +github.com/muety/wakapi/config/config.go:222.16,224.3 1 0 +github.com/muety/wakapi/config/config.go:236.54,238.2 1 1 +github.com/muety/wakapi/config/config.go:240.60,242.2 1 0 +github.com/muety/wakapi/config/config.go:244.59,246.2 1 0 +github.com/muety/wakapi/config/config.go:248.57,250.2 1 0 +github.com/muety/wakapi/config/config.go:252.53,254.2 1 0 +github.com/muety/wakapi/config/config.go:256.46,258.2 1 0 +github.com/muety/wakapi/config/config.go:260.43,262.2 1 0 +github.com/muety/wakapi/config/config.go:264.29,266.2 1 1 +github.com/muety/wakapi/config/config.go:268.48,278.65 2 0 +github.com/muety/wakapi/config/config.go:282.2,282.15 1 0 +github.com/muety/wakapi/config/config.go:278.65,280.3 1 0 +github.com/muety/wakapi/config/config.go:285.38,286.43 1 0 +github.com/muety/wakapi/config/config.go:289.2,289.15 1 0 +github.com/muety/wakapi/config/config.go:286.43,288.3 1 0 +github.com/muety/wakapi/config/config.go:292.45,293.27 1 0 +github.com/muety/wakapi/config/config.go:296.2,296.15 1 0 +github.com/muety/wakapi/config/config.go:293.27,295.3 1 0 +github.com/muety/wakapi/config/config.go:299.50,303.91 1 0 +github.com/muety/wakapi/config/config.go:303.91,304.29 1 0 +github.com/muety/wakapi/config/config.go:308.4,311.96 3 0 +github.com/muety/wakapi/config/config.go:314.4,314.39 1 0 +github.com/muety/wakapi/config/config.go:317.4,317.69 1 0 +github.com/muety/wakapi/config/config.go:304.29,306.5 1 0 +github.com/muety/wakapi/config/config.go:311.96,313.5 1 0 +github.com/muety/wakapi/config/config.go:314.39,316.5 1 0 +github.com/muety/wakapi/config/config.go:319.79,323.27 2 0 +github.com/muety/wakapi/config/config.go:330.4,330.16 1 0 +github.com/muety/wakapi/config/config.go:323.27,324.84 1 0 +github.com/muety/wakapi/config/config.go:324.84,325.57 1 0 +github.com/muety/wakapi/config/config.go:325.57,327.7 1 0 +github.com/muety/wakapi/config/config.go:332.17,334.3 1 0 +github.com/muety/wakapi/config/config.go:337.77,338.29 1 0 +github.com/muety/wakapi/config/config.go:343.2,343.19 1 0 +github.com/muety/wakapi/config/config.go:338.29,339.18 1 0 +github.com/muety/wakapi/config/config.go:339.18,341.4 1 0 +github.com/muety/wakapi/config/config.go:346.26,348.2 1 0 +github.com/muety/wakapi/config/config.go:350.20,352.2 1 0 +github.com/muety/wakapi/config/config.go:354.35,359.96 3 0 +github.com/muety/wakapi/config/config.go:363.2,371.52 5 0 +github.com/muety/wakapi/config/config.go:375.2,375.47 1 0 +github.com/muety/wakapi/config/config.go:381.2,381.70 1 0 +github.com/muety/wakapi/config/config.go:385.2,385.28 1 0 +github.com/muety/wakapi/config/config.go:389.2,389.29 1 0 +github.com/muety/wakapi/config/config.go:394.2,394.94 1 0 +github.com/muety/wakapi/config/config.go:398.2,399.14 2 0 +github.com/muety/wakapi/config/config.go:359.96,361.3 1 0 +github.com/muety/wakapi/config/config.go:371.52,373.3 1 0 +github.com/muety/wakapi/config/config.go:375.47,376.14 1 0 +github.com/muety/wakapi/config/config.go:376.14,378.4 1 0 +github.com/muety/wakapi/config/config.go:381.70,383.3 1 0 +github.com/muety/wakapi/config/config.go:385.28,387.3 1 0 +github.com/muety/wakapi/config/config.go:389.29,392.3 2 0 +github.com/muety/wakapi/config/config.go:394.94,396.3 1 0 github.com/muety/wakapi/config/utils.go:5.78,7.22 2 0 github.com/muety/wakapi/config/utils.go:13.2,13.11 1 0 github.com/muety/wakapi/config/utils.go:7.22,8.18 1 0 github.com/muety/wakapi/config/utils.go:11.3,11.12 1 0 github.com/muety/wakapi/config/utils.go:8.18,10.4 1 0 -github.com/muety/wakapi/utils/template.go:8.41,10.16 2 0 -github.com/muety/wakapi/utils/template.go:13.2,13.23 1 0 -github.com/muety/wakapi/utils/template.go:10.16,12.3 1 0 -github.com/muety/wakapi/utils/template.go:16.37,17.30 1 0 -github.com/muety/wakapi/utils/template.go:20.2,20.10 1 0 -github.com/muety/wakapi/utils/template.go:17.30,19.3 1 0 -github.com/muety/wakapi/utils/filesystem.go:14.68,16.16 2 0 -github.com/muety/wakapi/utils/filesystem.go:20.2,21.15 2 0 -github.com/muety/wakapi/utils/filesystem.go:33.2,33.15 1 0 -github.com/muety/wakapi/utils/filesystem.go:16.16,18.3 1 0 -github.com/muety/wakapi/utils/filesystem.go:21.15,23.47 2 0 -github.com/muety/wakapi/utils/filesystem.go:23.47,25.23 2 0 -github.com/muety/wakapi/utils/filesystem.go:29.4,29.19 1 0 -github.com/muety/wakapi/utils/filesystem.go:25.23,27.5 1 0 github.com/muety/wakapi/utils/color.go:8.90,10.32 2 0 github.com/muety/wakapi/utils/color.go:15.2,15.15 1 0 github.com/muety/wakapi/utils/color.go:10.32,11.50 1 0 @@ -263,13 +259,40 @@ github.com/muety/wakapi/utils/date.go:71.2,71.13 1 0 github.com/muety/wakapi/utils/date.go:59.36,62.3 2 0 github.com/muety/wakapi/utils/date.go:63.21,66.3 2 0 github.com/muety/wakapi/utils/date.go:67.21,70.3 2 0 -github.com/muety/wakapi/utils/http.go:9.73,12.58 3 0 -github.com/muety/wakapi/utils/http.go:12.58,14.3 1 0 github.com/muety/wakapi/utils/strings.go:8.34,10.2 1 0 github.com/muety/wakapi/utils/strings.go:12.77,13.29 1 0 github.com/muety/wakapi/utils/strings.go:18.2,18.19 1 0 github.com/muety/wakapi/utils/strings.go:13.29,14.18 1 0 github.com/muety/wakapi/utils/strings.go:14.18,16.4 1 0 +github.com/muety/wakapi/utils/auth.go:16.79,18.54 2 0 +github.com/muety/wakapi/utils/auth.go:22.2,24.16 3 0 +github.com/muety/wakapi/utils/auth.go:28.2,30.45 3 0 +github.com/muety/wakapi/utils/auth.go:33.2,34.32 2 0 +github.com/muety/wakapi/utils/auth.go:18.54,20.3 1 0 +github.com/muety/wakapi/utils/auth.go:24.16,26.3 1 0 +github.com/muety/wakapi/utils/auth.go:30.45,32.3 1 0 +github.com/muety/wakapi/utils/auth.go:37.65,39.85 2 0 +github.com/muety/wakapi/utils/auth.go:43.2,44.30 2 0 +github.com/muety/wakapi/utils/auth.go:39.85,41.3 1 0 +github.com/muety/wakapi/utils/auth.go:47.94,49.16 2 0 +github.com/muety/wakapi/utils/auth.go:53.2,53.107 1 0 +github.com/muety/wakapi/utils/auth.go:57.2,57.22 1 0 +github.com/muety/wakapi/utils/auth.go:49.16,51.3 1 0 +github.com/muety/wakapi/utils/auth.go:53.107,55.3 1 0 +github.com/muety/wakapi/utils/auth.go:60.56,64.2 3 0 +github.com/muety/wakapi/utils/auth.go:66.55,69.16 3 0 +github.com/muety/wakapi/utils/auth.go:72.2,72.16 1 0 +github.com/muety/wakapi/utils/auth.go:69.16,71.3 1 0 +github.com/muety/wakapi/utils/filesystem.go:14.68,16.16 2 0 +github.com/muety/wakapi/utils/filesystem.go:20.2,21.15 2 0 +github.com/muety/wakapi/utils/filesystem.go:33.2,33.15 1 0 +github.com/muety/wakapi/utils/filesystem.go:16.16,18.3 1 0 +github.com/muety/wakapi/utils/filesystem.go:21.15,23.47 2 0 +github.com/muety/wakapi/utils/filesystem.go:23.47,25.23 2 0 +github.com/muety/wakapi/utils/filesystem.go:29.4,29.19 1 0 +github.com/muety/wakapi/utils/filesystem.go:25.23,27.5 1 0 +github.com/muety/wakapi/utils/http.go:9.73,12.58 3 0 +github.com/muety/wakapi/utils/http.go:12.58,14.3 1 0 github.com/muety/wakapi/utils/summary.go:10.66,11.40 1 0 github.com/muety/wakapi/utils/summary.go:16.2,16.48 1 0 github.com/muety/wakapi/utils/summary.go:11.40,12.27 1 0 @@ -308,25 +331,41 @@ github.com/muety/wakapi/utils/summary.go:96.18,98.5 1 0 github.com/muety/wakapi/utils/summary.go:112.48,116.51 2 0 github.com/muety/wakapi/utils/summary.go:119.2,119.12 1 0 github.com/muety/wakapi/utils/summary.go:116.51,118.3 1 0 -github.com/muety/wakapi/utils/auth.go:16.79,18.54 2 0 -github.com/muety/wakapi/utils/auth.go:22.2,24.16 3 0 -github.com/muety/wakapi/utils/auth.go:28.2,30.45 3 0 -github.com/muety/wakapi/utils/auth.go:33.2,34.32 2 0 -github.com/muety/wakapi/utils/auth.go:18.54,20.3 1 0 -github.com/muety/wakapi/utils/auth.go:24.16,26.3 1 0 -github.com/muety/wakapi/utils/auth.go:30.45,32.3 1 0 -github.com/muety/wakapi/utils/auth.go:37.65,39.85 2 0 -github.com/muety/wakapi/utils/auth.go:43.2,44.30 2 0 -github.com/muety/wakapi/utils/auth.go:39.85,41.3 1 0 -github.com/muety/wakapi/utils/auth.go:47.94,49.16 2 0 -github.com/muety/wakapi/utils/auth.go:53.2,53.107 1 0 -github.com/muety/wakapi/utils/auth.go:57.2,57.22 1 0 -github.com/muety/wakapi/utils/auth.go:49.16,51.3 1 0 -github.com/muety/wakapi/utils/auth.go:53.107,55.3 1 0 -github.com/muety/wakapi/utils/auth.go:60.56,64.2 3 0 -github.com/muety/wakapi/utils/auth.go:66.55,69.16 3 0 -github.com/muety/wakapi/utils/auth.go:72.2,72.16 1 0 -github.com/muety/wakapi/utils/auth.go:69.16,71.3 1 0 +github.com/muety/wakapi/utils/template.go:8.41,10.16 2 0 +github.com/muety/wakapi/utils/template.go:13.2,13.23 1 0 +github.com/muety/wakapi/utils/template.go:10.16,12.3 1 0 +github.com/muety/wakapi/utils/template.go:16.37,17.30 1 0 +github.com/muety/wakapi/utils/template.go:20.2,20.10 1 0 +github.com/muety/wakapi/utils/template.go:17.30,19.3 1 0 +github.com/muety/wakapi/middlewares/authenticate.go:19.91,25.2 1 1 +github.com/muety/wakapi/middlewares/authenticate.go:27.90,30.2 2 0 +github.com/muety/wakapi/middlewares/authenticate.go:32.90,35.2 2 0 +github.com/muety/wakapi/middlewares/authenticate.go:37.71,38.71 1 0 +github.com/muety/wakapi/middlewares/authenticate.go:38.71,40.3 1 0 +github.com/muety/wakapi/middlewares/authenticate.go:43.107,47.16 3 0 +github.com/muety/wakapi/middlewares/authenticate.go:51.2,51.31 1 0 +github.com/muety/wakapi/middlewares/authenticate.go:67.2,68.12 2 0 +github.com/muety/wakapi/middlewares/authenticate.go:47.16,49.3 1 0 +github.com/muety/wakapi/middlewares/authenticate.go:51.31,52.31 1 0 +github.com/muety/wakapi/middlewares/authenticate.go:57.3,57.29 1 0 +github.com/muety/wakapi/middlewares/authenticate.go:64.3,64.9 1 0 +github.com/muety/wakapi/middlewares/authenticate.go:52.31,55.4 2 0 +github.com/muety/wakapi/middlewares/authenticate.go:57.29,60.4 2 0 +github.com/muety/wakapi/middlewares/authenticate.go:60.9,63.4 2 0 +github.com/muety/wakapi/middlewares/authenticate.go:71.70,72.39 1 0 +github.com/muety/wakapi/middlewares/authenticate.go:77.2,77.14 1 0 +github.com/muety/wakapi/middlewares/authenticate.go:72.39,73.60 1 0 +github.com/muety/wakapi/middlewares/authenticate.go:73.60,75.4 1 0 +github.com/muety/wakapi/middlewares/authenticate.go:80.92,82.16 2 1 +github.com/muety/wakapi/middlewares/authenticate.go:86.2,89.16 4 1 +github.com/muety/wakapi/middlewares/authenticate.go:92.2,92.18 1 1 +github.com/muety/wakapi/middlewares/authenticate.go:82.16,84.3 1 1 +github.com/muety/wakapi/middlewares/authenticate.go:89.16,91.3 1 0 +github.com/muety/wakapi/middlewares/authenticate.go:95.92,97.16 2 0 +github.com/muety/wakapi/middlewares/authenticate.go:101.2,102.16 2 0 +github.com/muety/wakapi/middlewares/authenticate.go:109.2,109.18 1 0 +github.com/muety/wakapi/middlewares/authenticate.go:97.16,99.3 1 0 +github.com/muety/wakapi/middlewares/authenticate.go:102.16,104.3 1 0 github.com/muety/wakapi/middlewares/filetype.go:13.83,14.43 1 0 github.com/muety/wakapi/middlewares/filetype.go:14.43,19.3 1 0 github.com/muety/wakapi/middlewares/filetype.go:22.84,24.34 2 0 @@ -375,110 +414,44 @@ github.com/muety/wakapi/middlewares/sentry.go:15.43,19.3 1 0 github.com/muety/wakapi/middlewares/sentry.go:22.78,25.54 3 0 github.com/muety/wakapi/middlewares/sentry.go:25.54,26.43 1 0 github.com/muety/wakapi/middlewares/sentry.go:26.43,28.4 1 0 -github.com/muety/wakapi/middlewares/authenticate.go:19.91,25.2 1 1 -github.com/muety/wakapi/middlewares/authenticate.go:27.90,30.2 2 0 -github.com/muety/wakapi/middlewares/authenticate.go:32.90,35.2 2 0 -github.com/muety/wakapi/middlewares/authenticate.go:37.71,38.71 1 0 -github.com/muety/wakapi/middlewares/authenticate.go:38.71,40.3 1 0 -github.com/muety/wakapi/middlewares/authenticate.go:43.107,47.16 3 0 -github.com/muety/wakapi/middlewares/authenticate.go:51.2,51.31 1 0 -github.com/muety/wakapi/middlewares/authenticate.go:67.2,68.12 2 0 -github.com/muety/wakapi/middlewares/authenticate.go:47.16,49.3 1 0 -github.com/muety/wakapi/middlewares/authenticate.go:51.31,52.31 1 0 -github.com/muety/wakapi/middlewares/authenticate.go:57.3,57.29 1 0 -github.com/muety/wakapi/middlewares/authenticate.go:64.3,64.9 1 0 -github.com/muety/wakapi/middlewares/authenticate.go:52.31,55.4 2 0 -github.com/muety/wakapi/middlewares/authenticate.go:57.29,60.4 2 0 -github.com/muety/wakapi/middlewares/authenticate.go:60.9,63.4 2 0 -github.com/muety/wakapi/middlewares/authenticate.go:71.70,72.39 1 0 -github.com/muety/wakapi/middlewares/authenticate.go:77.2,77.14 1 0 -github.com/muety/wakapi/middlewares/authenticate.go:72.39,73.60 1 0 -github.com/muety/wakapi/middlewares/authenticate.go:73.60,75.4 1 0 -github.com/muety/wakapi/middlewares/authenticate.go:80.92,82.16 2 1 -github.com/muety/wakapi/middlewares/authenticate.go:86.2,89.16 4 1 -github.com/muety/wakapi/middlewares/authenticate.go:92.2,92.18 1 1 -github.com/muety/wakapi/middlewares/authenticate.go:82.16,84.3 1 1 -github.com/muety/wakapi/middlewares/authenticate.go:89.16,91.3 1 0 -github.com/muety/wakapi/middlewares/authenticate.go:95.92,97.16 2 0 -github.com/muety/wakapi/middlewares/authenticate.go:101.2,102.16 2 0 -github.com/muety/wakapi/middlewares/authenticate.go:109.2,109.18 1 0 -github.com/muety/wakapi/middlewares/authenticate.go:97.16,99.3 1 0 -github.com/muety/wakapi/middlewares/authenticate.go:102.16,104.3 1 0 -github.com/muety/wakapi/services/alias.go:17.77,22.2 1 1 -github.com/muety/wakapi/services/alias.go:26.60,27.43 1 1 -github.com/muety/wakapi/services/alias.go:30.2,30.14 1 1 -github.com/muety/wakapi/services/alias.go:27.43,29.3 1 1 -github.com/muety/wakapi/services/alias.go:33.62,35.16 2 1 -github.com/muety/wakapi/services/alias.go:38.2,38.12 1 1 -github.com/muety/wakapi/services/alias.go:35.16,37.3 1 1 -github.com/muety/wakapi/services/alias.go:41.76,43.16 2 0 -github.com/muety/wakapi/services/alias.go:46.2,46.21 1 0 -github.com/muety/wakapi/services/alias.go:43.16,45.3 1 0 -github.com/muety/wakapi/services/alias.go:49.113,51.16 2 0 -github.com/muety/wakapi/services/alias.go:54.2,54.21 1 0 -github.com/muety/wakapi/services/alias.go:51.16,53.3 1 0 -github.com/muety/wakapi/services/alias.go:57.108,58.32 1 1 -github.com/muety/wakapi/services/alias.go:64.2,65.46 2 1 -github.com/muety/wakapi/services/alias.go:70.2,70.19 1 1 -github.com/muety/wakapi/services/alias.go:58.32,59.52 1 1 -github.com/muety/wakapi/services/alias.go:59.52,61.4 1 1 -github.com/muety/wakapi/services/alias.go:65.46,66.48 1 1 -github.com/muety/wakapi/services/alias.go:66.48,68.4 1 1 -github.com/muety/wakapi/services/alias.go:73.77,75.16 2 0 -github.com/muety/wakapi/services/alias.go:78.2,79.20 2 0 -github.com/muety/wakapi/services/alias.go:75.16,77.3 1 0 -github.com/muety/wakapi/services/alias.go:82.60,83.24 1 0 -github.com/muety/wakapi/services/alias.go:86.2,88.12 3 0 -github.com/muety/wakapi/services/alias.go:83.24,85.3 1 0 -github.com/muety/wakapi/services/alias.go:91.69,94.28 3 0 -github.com/muety/wakapi/services/alias.go:102.2,104.31 2 0 -github.com/muety/wakapi/services/alias.go:108.2,108.12 1 0 -github.com/muety/wakapi/services/alias.go:94.28,95.21 1 0 -github.com/muety/wakapi/services/alias.go:98.3,99.16 2 0 -github.com/muety/wakapi/services/alias.go:95.21,97.4 1 0 -github.com/muety/wakapi/services/alias.go:104.31,106.3 1 0 -github.com/muety/wakapi/services/alias.go:111.52,112.51 1 0 -github.com/muety/wakapi/services/alias.go:112.51,114.3 1 0 github.com/muety/wakapi/services/aggregation.go:24.142,31.2 1 0 -github.com/muety/wakapi/services/aggregation.go:40.43,42.37 1 0 -github.com/muety/wakapi/services/aggregation.go:46.2,48.19 3 0 -github.com/muety/wakapi/services/aggregation.go:42.37,44.3 1 0 -github.com/muety/wakapi/services/aggregation.go:51.67,55.40 3 0 -github.com/muety/wakapi/services/aggregation.go:59.2,59.50 1 0 -github.com/muety/wakapi/services/aggregation.go:64.2,64.60 1 0 -github.com/muety/wakapi/services/aggregation.go:70.2,70.35 1 0 -github.com/muety/wakapi/services/aggregation.go:55.40,57.3 1 0 -github.com/muety/wakapi/services/aggregation.go:59.50,61.3 1 0 -github.com/muety/wakapi/services/aggregation.go:64.60,68.3 3 0 -github.com/muety/wakapi/services/aggregation.go:73.109,74.24 1 0 -github.com/muety/wakapi/services/aggregation.go:74.24,75.111 1 0 -github.com/muety/wakapi/services/aggregation.go:75.111,77.4 1 0 -github.com/muety/wakapi/services/aggregation.go:77.9,80.4 2 0 -github.com/muety/wakapi/services/aggregation.go:84.80,85.33 1 0 -github.com/muety/wakapi/services/aggregation.go:85.33,86.60 1 0 -github.com/muety/wakapi/services/aggregation.go:86.60,88.4 1 0 -github.com/muety/wakapi/services/aggregation.go:92.100,96.59 3 0 -github.com/muety/wakapi/services/aggregation.go:111.2,112.16 2 0 -github.com/muety/wakapi/services/aggregation.go:118.2,119.16 2 0 -github.com/muety/wakapi/services/aggregation.go:125.2,126.44 2 0 -github.com/muety/wakapi/services/aggregation.go:131.2,131.41 1 0 -github.com/muety/wakapi/services/aggregation.go:145.2,145.12 1 0 -github.com/muety/wakapi/services/aggregation.go:96.59,99.3 2 0 -github.com/muety/wakapi/services/aggregation.go:99.8,99.47 1 0 -github.com/muety/wakapi/services/aggregation.go:99.47,101.30 2 0 -github.com/muety/wakapi/services/aggregation.go:101.30,102.43 1 0 -github.com/muety/wakapi/services/aggregation.go:102.43,104.5 1 0 -github.com/muety/wakapi/services/aggregation.go:106.8,108.3 1 0 -github.com/muety/wakapi/services/aggregation.go:112.16,115.3 2 0 -github.com/muety/wakapi/services/aggregation.go:119.16,122.3 2 0 -github.com/muety/wakapi/services/aggregation.go:126.44,128.3 1 0 -github.com/muety/wakapi/services/aggregation.go:131.41,132.21 1 0 -github.com/muety/wakapi/services/aggregation.go:132.21,136.4 1 0 -github.com/muety/wakapi/services/aggregation.go:136.9,136.62 1 0 -github.com/muety/wakapi/services/aggregation.go:136.62,140.4 1 0 -github.com/muety/wakapi/services/aggregation.go:148.83,163.41 5 0 -github.com/muety/wakapi/services/aggregation.go:163.41,173.3 3 0 -github.com/muety/wakapi/services/aggregation.go:176.34,179.2 2 0 +github.com/muety/wakapi/services/aggregation.go:40.43,44.2 3 0 +github.com/muety/wakapi/services/aggregation.go:46.67,50.40 3 0 +github.com/muety/wakapi/services/aggregation.go:54.2,54.50 1 0 +github.com/muety/wakapi/services/aggregation.go:59.2,59.60 1 0 +github.com/muety/wakapi/services/aggregation.go:65.2,65.35 1 0 +github.com/muety/wakapi/services/aggregation.go:50.40,52.3 1 0 +github.com/muety/wakapi/services/aggregation.go:54.50,56.3 1 0 +github.com/muety/wakapi/services/aggregation.go:59.60,63.3 3 0 +github.com/muety/wakapi/services/aggregation.go:68.109,69.24 1 0 +github.com/muety/wakapi/services/aggregation.go:69.24,70.111 1 0 +github.com/muety/wakapi/services/aggregation.go:70.111,72.4 1 0 +github.com/muety/wakapi/services/aggregation.go:72.9,75.4 2 0 +github.com/muety/wakapi/services/aggregation.go:79.80,80.33 1 0 +github.com/muety/wakapi/services/aggregation.go:80.33,81.60 1 0 +github.com/muety/wakapi/services/aggregation.go:81.60,83.4 1 0 +github.com/muety/wakapi/services/aggregation.go:87.100,91.59 3 0 +github.com/muety/wakapi/services/aggregation.go:106.2,107.16 2 0 +github.com/muety/wakapi/services/aggregation.go:113.2,114.16 2 0 +github.com/muety/wakapi/services/aggregation.go:120.2,121.44 2 0 +github.com/muety/wakapi/services/aggregation.go:126.2,126.41 1 0 +github.com/muety/wakapi/services/aggregation.go:140.2,140.12 1 0 +github.com/muety/wakapi/services/aggregation.go:91.59,94.3 2 0 +github.com/muety/wakapi/services/aggregation.go:94.8,94.47 1 0 +github.com/muety/wakapi/services/aggregation.go:94.47,96.30 2 0 +github.com/muety/wakapi/services/aggregation.go:96.30,97.43 1 0 +github.com/muety/wakapi/services/aggregation.go:97.43,99.5 1 0 +github.com/muety/wakapi/services/aggregation.go:101.8,103.3 1 0 +github.com/muety/wakapi/services/aggregation.go:107.16,110.3 2 0 +github.com/muety/wakapi/services/aggregation.go:114.16,117.3 2 0 +github.com/muety/wakapi/services/aggregation.go:121.44,123.3 1 0 +github.com/muety/wakapi/services/aggregation.go:126.41,127.21 1 0 +github.com/muety/wakapi/services/aggregation.go:127.21,131.4 1 0 +github.com/muety/wakapi/services/aggregation.go:131.9,131.62 1 0 +github.com/muety/wakapi/services/aggregation.go:131.62,135.4 1 0 +github.com/muety/wakapi/services/aggregation.go:143.83,158.41 5 0 +github.com/muety/wakapi/services/aggregation.go:158.41,168.3 3 0 +github.com/muety/wakapi/services/aggregation.go:171.34,174.2 2 0 github.com/muety/wakapi/services/heartbeat.go:17.141,23.2 1 0 github.com/muety/wakapi/services/heartbeat.go:25.72,27.2 1 0 github.com/muety/wakapi/services/heartbeat.go:29.80,34.32 3 0 @@ -499,13 +472,6 @@ github.com/muety/wakapi/services/heartbeat.go:82.2,82.28 1 0 github.com/muety/wakapi/services/heartbeat.go:86.2,86.24 1 0 github.com/muety/wakapi/services/heartbeat.go:78.16,80.3 1 0 github.com/muety/wakapi/services/heartbeat.go:82.28,84.3 1 0 -github.com/muety/wakapi/services/key_value.go:14.89,19.2 1 0 -github.com/muety/wakapi/services/key_value.go:21.83,23.2 1 0 -github.com/muety/wakapi/services/key_value.go:25.78,27.16 2 0 -github.com/muety/wakapi/services/key_value.go:33.2,33.11 1 0 -github.com/muety/wakapi/services/key_value.go:27.16,32.3 1 0 -github.com/muety/wakapi/services/key_value.go:36.72,38.2 1 0 -github.com/muety/wakapi/services/key_value.go:40.60,42.2 1 0 github.com/muety/wakapi/services/language_mapping.go:18.118,24.2 1 0 github.com/muety/wakapi/services/language_mapping.go:26.86,28.2 1 0 github.com/muety/wakapi/services/language_mapping.go:30.96,31.53 1 0 @@ -525,29 +491,6 @@ github.com/muety/wakapi/services/language_mapping.go:66.82,67.26 1 0 github.com/muety/wakapi/services/language_mapping.go:70.2,72.12 3 0 github.com/muety/wakapi/services/language_mapping.go:67.26,69.3 1 0 github.com/muety/wakapi/services/language_mapping.go:75.74,78.2 1 0 -github.com/muety/wakapi/services/misc.go:23.126,30.2 1 0 -github.com/muety/wakapi/services/misc.go:42.50,44.48 1 0 -github.com/muety/wakapi/services/misc.go:48.2,50.19 3 0 -github.com/muety/wakapi/services/misc.go:44.48,46.3 1 0 -github.com/muety/wakapi/services/misc.go:53.51,59.40 4 0 -github.com/muety/wakapi/services/misc.go:63.2,66.56 2 0 -github.com/muety/wakapi/services/misc.go:77.2,77.12 1 0 -github.com/muety/wakapi/services/misc.go:59.40,61.3 1 0 -github.com/muety/wakapi/services/misc.go:66.56,67.27 1 0 -github.com/muety/wakapi/services/misc.go:67.27,72.4 1 0 -github.com/muety/wakapi/services/misc.go:73.8,75.3 1 0 -github.com/muety/wakapi/services/misc.go:80.116,81.24 1 0 -github.com/muety/wakapi/services/misc.go:81.24,82.151 1 0 -github.com/muety/wakapi/services/misc.go:91.3,91.48 1 0 -github.com/muety/wakapi/services/misc.go:82.151,84.4 1 0 -github.com/muety/wakapi/services/misc.go:84.9,90.4 2 0 -github.com/muety/wakapi/services/misc.go:91.48,94.4 2 0 -github.com/muety/wakapi/services/misc.go:98.86,101.30 3 0 -github.com/muety/wakapi/services/misc.go:106.2,109.17 1 0 -github.com/muety/wakapi/services/misc.go:113.2,116.17 1 0 -github.com/muety/wakapi/services/misc.go:101.30,104.3 2 0 -github.com/muety/wakapi/services/misc.go:109.17,111.3 1 0 -github.com/muety/wakapi/services/misc.go:116.17,118.3 1 0 github.com/muety/wakapi/services/summary.go:27.149,35.2 1 1 github.com/muety/wakapi/services/summary.go:39.136,42.66 2 1 github.com/muety/wakapi/services/summary.go:47.2,47.44 1 1 @@ -625,18 +568,20 @@ github.com/muety/wakapi/services/summary.go:288.43,290.3 1 1 github.com/muety/wakapi/services/summary.go:295.116,296.25 1 1 github.com/muety/wakapi/services/summary.go:300.2,303.44 2 1 github.com/muety/wakapi/services/summary.go:308.2,308.40 1 1 -github.com/muety/wakapi/services/summary.go:324.2,324.54 1 1 -github.com/muety/wakapi/services/summary.go:328.2,328.18 1 1 +github.com/muety/wakapi/services/summary.go:333.2,333.54 1 1 +github.com/muety/wakapi/services/summary.go:337.2,337.18 1 1 github.com/muety/wakapi/services/summary.go:296.25,298.3 1 0 github.com/muety/wakapi/services/summary.go:303.44,305.3 1 1 github.com/muety/wakapi/services/summary.go:308.40,310.19 2 1 -github.com/muety/wakapi/services/summary.go:315.3,318.22 3 0 +github.com/muety/wakapi/services/summary.go:317.3,322.34 3 1 +github.com/muety/wakapi/services/summary.go:327.3,327.22 1 1 github.com/muety/wakapi/services/summary.go:310.19,311.12 1 1 -github.com/muety/wakapi/services/summary.go:318.22,320.4 1 0 -github.com/muety/wakapi/services/summary.go:324.54,326.3 1 1 -github.com/muety/wakapi/services/summary.go:331.59,333.25 2 1 -github.com/muety/wakapi/services/summary.go:336.2,336.32 1 1 -github.com/muety/wakapi/services/summary.go:333.25,335.3 1 1 +github.com/muety/wakapi/services/summary.go:322.34,324.4 1 1 +github.com/muety/wakapi/services/summary.go:327.22,329.4 1 1 +github.com/muety/wakapi/services/summary.go:333.54,335.3 1 1 +github.com/muety/wakapi/services/summary.go:340.59,342.25 2 1 +github.com/muety/wakapi/services/summary.go:345.2,345.32 1 1 +github.com/muety/wakapi/services/summary.go:342.25,344.3 1 1 github.com/muety/wakapi/services/user.go:19.73,25.2 1 0 github.com/muety/wakapi/services/user.go:27.74,28.40 1 0 github.com/muety/wakapi/services/user.go:32.2,33.16 2 0 @@ -667,3 +612,68 @@ github.com/muety/wakapi/services/user.go:115.8,117.3 1 0 github.com/muety/wakapi/services/user.go:121.85,123.2 1 0 github.com/muety/wakapi/services/user.go:125.57,128.2 2 0 github.com/muety/wakapi/services/user.go:130.38,132.2 1 0 +github.com/muety/wakapi/services/alias.go:17.77,22.2 1 1 +github.com/muety/wakapi/services/alias.go:26.60,27.43 1 1 +github.com/muety/wakapi/services/alias.go:30.2,30.14 1 1 +github.com/muety/wakapi/services/alias.go:27.43,29.3 1 1 +github.com/muety/wakapi/services/alias.go:33.62,35.16 2 1 +github.com/muety/wakapi/services/alias.go:38.2,38.12 1 1 +github.com/muety/wakapi/services/alias.go:35.16,37.3 1 1 +github.com/muety/wakapi/services/alias.go:41.76,43.16 2 0 +github.com/muety/wakapi/services/alias.go:46.2,46.21 1 0 +github.com/muety/wakapi/services/alias.go:43.16,45.3 1 0 +github.com/muety/wakapi/services/alias.go:49.113,51.16 2 0 +github.com/muety/wakapi/services/alias.go:54.2,54.21 1 0 +github.com/muety/wakapi/services/alias.go:51.16,53.3 1 0 +github.com/muety/wakapi/services/alias.go:57.108,58.32 1 1 +github.com/muety/wakapi/services/alias.go:64.2,65.46 2 1 +github.com/muety/wakapi/services/alias.go:70.2,70.19 1 1 +github.com/muety/wakapi/services/alias.go:58.32,59.52 1 1 +github.com/muety/wakapi/services/alias.go:59.52,61.4 1 1 +github.com/muety/wakapi/services/alias.go:65.46,66.48 1 1 +github.com/muety/wakapi/services/alias.go:66.48,68.4 1 1 +github.com/muety/wakapi/services/alias.go:73.77,75.16 2 0 +github.com/muety/wakapi/services/alias.go:78.2,79.20 2 0 +github.com/muety/wakapi/services/alias.go:75.16,77.3 1 0 +github.com/muety/wakapi/services/alias.go:82.60,83.24 1 0 +github.com/muety/wakapi/services/alias.go:86.2,88.12 3 0 +github.com/muety/wakapi/services/alias.go:83.24,85.3 1 0 +github.com/muety/wakapi/services/alias.go:91.69,94.28 3 0 +github.com/muety/wakapi/services/alias.go:102.2,104.31 2 0 +github.com/muety/wakapi/services/alias.go:108.2,108.12 1 0 +github.com/muety/wakapi/services/alias.go:94.28,95.21 1 0 +github.com/muety/wakapi/services/alias.go:98.3,99.16 2 0 +github.com/muety/wakapi/services/alias.go:95.21,97.4 1 0 +github.com/muety/wakapi/services/alias.go:104.31,106.3 1 0 +github.com/muety/wakapi/services/alias.go:111.52,112.51 1 0 +github.com/muety/wakapi/services/alias.go:112.51,114.3 1 0 +github.com/muety/wakapi/services/key_value.go:14.89,19.2 1 0 +github.com/muety/wakapi/services/key_value.go:21.83,23.2 1 0 +github.com/muety/wakapi/services/key_value.go:25.78,27.16 2 0 +github.com/muety/wakapi/services/key_value.go:33.2,33.11 1 0 +github.com/muety/wakapi/services/key_value.go:27.16,32.3 1 0 +github.com/muety/wakapi/services/key_value.go:36.72,38.2 1 0 +github.com/muety/wakapi/services/key_value.go:40.60,42.2 1 0 +github.com/muety/wakapi/services/misc.go:23.126,30.2 1 0 +github.com/muety/wakapi/services/misc.go:42.50,44.48 1 0 +github.com/muety/wakapi/services/misc.go:48.2,50.19 3 0 +github.com/muety/wakapi/services/misc.go:44.48,46.3 1 0 +github.com/muety/wakapi/services/misc.go:53.51,59.40 4 0 +github.com/muety/wakapi/services/misc.go:63.2,66.56 2 0 +github.com/muety/wakapi/services/misc.go:77.2,77.12 1 0 +github.com/muety/wakapi/services/misc.go:59.40,61.3 1 0 +github.com/muety/wakapi/services/misc.go:66.56,67.27 1 0 +github.com/muety/wakapi/services/misc.go:67.27,72.4 1 0 +github.com/muety/wakapi/services/misc.go:73.8,75.3 1 0 +github.com/muety/wakapi/services/misc.go:80.116,81.24 1 0 +github.com/muety/wakapi/services/misc.go:81.24,82.151 1 0 +github.com/muety/wakapi/services/misc.go:91.3,91.48 1 0 +github.com/muety/wakapi/services/misc.go:82.151,84.4 1 0 +github.com/muety/wakapi/services/misc.go:84.9,90.4 2 0 +github.com/muety/wakapi/services/misc.go:91.48,94.4 2 0 +github.com/muety/wakapi/services/misc.go:98.86,101.30 3 0 +github.com/muety/wakapi/services/misc.go:106.2,109.17 1 0 +github.com/muety/wakapi/services/misc.go:113.2,116.17 1 0 +github.com/muety/wakapi/services/misc.go:101.30,104.3 2 0 +github.com/muety/wakapi/services/misc.go:109.17,111.3 1 0 +github.com/muety/wakapi/services/misc.go:116.17,118.3 1 0 diff --git a/services/aggregation.go b/services/aggregation.go index 09f5d90..6f71b63 100644 --- a/services/aggregation.go +++ b/services/aggregation.go @@ -38,11 +38,6 @@ type AggregationJob struct { // Schedule a job to (re-)generate summaries every day shortly after midnight func (srv *AggregationService) Schedule() { - // Run once initially - if err := srv.Run(nil); err != nil { - logbuch.Fatal("failed to run AggregationJob: %v", err) - } - s := gocron.NewScheduler(time.Local) s.Every(1).Day().At(srv.config.App.AggregationTime).Do(srv.Run, map[string]bool{}) s.StartBlocking() diff --git a/services/summary.go b/services/summary.go index 8a3edb0..b3daea5 100644 --- a/services/summary.go +++ b/services/summary.go @@ -312,8 +312,17 @@ func (srv *SummaryService) getMissingIntervals(from, to time.Time, summaries []* } // round to end of day / start of day, assuming that summaries are always generated on a per-day basis + // we assume that, if summary for any time range within a day is present, no further heartbeats exist on that day before 'from' and after 'to' time of that summary + // this requires that a summary exists for every single day in a year and none is skipped, which shouldn't ever happen td1 := time.Date(t1.Year(), t1.Month(), t1.Day()+1, 0, 0, 0, 0, t1.Location()) td2 := time.Date(t2.Year(), t2.Month(), t2.Day(), 0, 0, 0, 0, t2.Location()) + + // we always want to jump to beginning of next day + // however, if left summary ends already at midnight, we would instead jump to beginning of second-next day -> go back again + if td1.Sub(t1) == 24*time.Hour { + td1 = td1.Add(-1 * time.Hour) + } + // one or more day missing in between? if td1.Before(td2) { intervals = append(intervals, &models.Interval{summaries[i].ToTime.T(), summaries[i+1].FromTime.T()}) diff --git a/services/summary_test.go b/services/summary_test.go index b6c068e..5eb7968 100644 --- a/services/summary_test.go +++ b/services/summary_test.go @@ -235,6 +235,60 @@ func (suite *SummaryServiceTestSuite) TestSummaryService_Retrieve() { assert.Equal(suite.T(), 150*time.Second+90*time.Minute, result.TotalTime()) assert.Equal(suite.T(), 150*time.Second+45*time.Minute, result.TotalTimeByKey(models.SummaryProject, TestProject1)) assert.Equal(suite.T(), 45*time.Minute, result.TotalTimeByKey(models.SummaryProject, TestProject2)) + suite.HeartbeatService.AssertNumberOfCalls(suite.T(), "GetAllWithin", 2+1) + + /* TEST 3 */ + from = time.Date(suite.TestStartTime.Year(), suite.TestStartTime.Month(), suite.TestStartTime.Day()+1, 0, 0, 0, 0, suite.TestStartTime.Location()) // start of next day + to = time.Date(from.Year(), from.Month(), from.Day()+2, 13, 30, 0, 0, from.Location()) // noon of third-next day + summaries = []*models.Summary{ + { + ID: uint(rand.Uint32()), + UserID: TestUserId, + FromTime: models.CustomTime(from), + ToTime: models.CustomTime(from.Add(24 * time.Hour)), + Projects: []*models.SummaryItem{ + { + Type: models.SummaryProject, + Key: TestProject1, + Total: 45 * time.Minute / time.Second, // hack + }, + }, + Languages: []*models.SummaryItem{}, + Editors: []*models.SummaryItem{}, + OperatingSystems: []*models.SummaryItem{}, + Machines: []*models.SummaryItem{}, + }, + { + ID: uint(rand.Uint32()), + UserID: TestUserId, + FromTime: models.CustomTime(to.Add(-2 * time.Hour)), + ToTime: models.CustomTime(to), + Projects: []*models.SummaryItem{ + { + Type: models.SummaryProject, + Key: TestProject2, + Total: 45 * time.Minute / time.Second, // hack + }, + }, + Languages: []*models.SummaryItem{}, + Editors: []*models.SummaryItem{}, + OperatingSystems: []*models.SummaryItem{}, + Machines: []*models.SummaryItem{}, + }, + } + + suite.SummaryRepository.On("GetByUserWithin", suite.TestUser, from, to).Return(summaries, nil) + suite.HeartbeatService.On("GetAllWithin", summaries[0].ToTime.T(), summaries[1].FromTime.T(), suite.TestUser).Return(filter(summaries[0].ToTime.T(), summaries[1].FromTime.T(), suite.TestHeartbeats), nil) + + result, err = sut.Retrieve(from, to, suite.TestUser) + + assert.Nil(suite.T(), err) + assert.NotNil(suite.T(), result) + assert.Len(suite.T(), result.Projects, 2) + assert.Equal(suite.T(), 90*time.Minute, result.TotalTime()) + assert.Equal(suite.T(), 45*time.Minute, result.TotalTimeByKey(models.SummaryProject, TestProject1)) + assert.Equal(suite.T(), 45*time.Minute, result.TotalTimeByKey(models.SummaryProject, TestProject2)) + suite.HeartbeatService.AssertNumberOfCalls(suite.T(), "GetAllWithin", 2+1+1) } func (suite *SummaryServiceTestSuite) TestSummaryService_Aliased() {