storagenode/console: use bandwidth monthly summary (#3183)

This commit is contained in:
Yaroslav Vorobiov 2019-10-04 09:29:25 -06:00 committed by GitHub
parent 4824ecdb8d
commit a11619e7f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -153,7 +153,7 @@ func (s *Service) GetDashboardData(ctx context.Context) (_ *Dashboard, err error
return nil, SNOServiceErr.Wrap(err) return nil, SNOServiceErr.Wrap(err)
} }
bandwidthUsage, err := s.bandwidthDB.Summary(ctx, time.Time{}, time.Now()) bandwidthUsage, err := s.bandwidthDB.MonthSummary(ctx)
if err != nil { if err != nil {
return nil, SNOServiceErr.Wrap(err) return nil, SNOServiceErr.Wrap(err)
} }
@ -164,7 +164,7 @@ func (s *Service) GetDashboardData(ctx context.Context) (_ *Dashboard, err error
} }
data.Bandwidth = BandwidthInfo{ data.Bandwidth = BandwidthInfo{
Used: bandwidthUsage.Total(), Used: bandwidthUsage,
Available: s.allocatedBandwidth.Int64(), Available: s.allocatedBandwidth.Int64(),
} }