Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion pkg/collector/handler_clb_private.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ func (h *ClbPrivateHandler) GetSeriesByCustom(m *metric.TcmMetric) ([]*metric.Tc
}
return slist, nil
}

func (h *ClbPrivateHandler) getSeriesByMetricType(m *metric.TcmMetric, ins instance.TcInstance) ([]*metric.TcmSeries, error) {
var dimensions []string
for _, v := range m.Meta.SupportDimensions {
Expand Down
3 changes: 2 additions & 1 deletion pkg/metric/metric.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,11 @@ func (m *TcmMetric) GetLatestPromMetrics(repo TcmMetricRepository) (pms []promet
et := int64(0)
now := time.Now().Unix()
if m.Conf.StatDelaySeconds > 0 {
st = now - m.Conf.StatPeriodSeconds - m.Conf.StatDelaySeconds
st = now - m.Conf.StatNumSamples*m.Conf.StatPeriodSeconds - m.Conf.StatDelaySeconds
et = now - m.Conf.StatDelaySeconds
} else {
st = now - m.Conf.StatNumSamples*m.Conf.StatPeriodSeconds
et = now
}

samplesList, err := repo.ListSamples(m, st, et)
Expand Down
6 changes: 1 addition & 5 deletions pkg/util/time.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ import "time"
func FormatTime(t time.Time, format string) string {
var local time.Time
_, offset := t.Zone()
if offset == 0 {
local = t.Add(8 * time.Hour)
} else {
local = t
}
local = t.Add(time.Duration(8*3600-offset) * time.Second)
return local.Format(format)
}