Skip to content

Commit

Permalink
Pull request 2115: ADG-7924-stats-interval
Browse files Browse the repository at this point in the history
Squashed commit of the following:

commit 2c7ee92
Merge: 67313ec 4698579
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Wed Dec 20 19:04:44 2023 +0300

    Merge branch 'master' into ADG-7924-stats-interval

commit 67313ec
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Tue Dec 19 20:02:31 2023 +0300

    all: imp docs

commit f073dc4
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Tue Dec 19 18:33:51 2023 +0300

    upd: chlog

commit 109dbb1
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Tue Dec 19 17:23:58 2023 +0300

    stats: interval
  • Loading branch information
schzhn committed Dec 20, 2023
1 parent 4698579 commit 4bc5c34
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -33,6 +33,7 @@ NOTE: Add new changes BELOW THIS COMMENT.

### Fixed

- Statistics for 7 days displayed as 168 hours on the dashboard.
- Pre-filling the Edit static lease window with data ([#6534]).
- Names defined in the `/etc/hosts` for a single address family wrongly
considered undefined for another family ([#6541]).
Expand Down
6 changes: 5 additions & 1 deletion internal/stats/unit.go
Expand Up @@ -484,7 +484,7 @@ func (s *StatsCtx) fillCollectedStats(data *StatsResp, units []*unitDB, curID ui
data.TimeUnits = timeUnitsHours

daysCount := size / 24
if daysCount > 7 {
if daysCount >= 7 {
size = daysCount
data.TimeUnits = timeUnitsDays
}
Expand All @@ -510,6 +510,10 @@ func (s *StatsCtx) fillCollectedStats(data *StatsResp, units []*unitDB, curID ui

// fillCollectedStatsDaily fills data with collected daily statistics. units
// must contain data for the count of days.
//
// TODO(s.chzhen): Improve collection of statistics for frontend. Dashboard
// cards should contain statistics for the whole interval without rounding to
// days.
func (s *StatsCtx) fillCollectedStatsDaily(
data *StatsResp,
units []*unitDB,
Expand Down

0 comments on commit 4bc5c34

Please sign in to comment.