MM-58281 Change performance timestamps to be floats (#27046)
* MM-58281 Change performance timestamps to be floats * Commit missed line
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
3e734ee949
Коммит
b9f7d38cb1
@@ -36,7 +36,7 @@ var (
|
||||
type MetricSample struct {
|
||||
Metric MetricType `json:"metric"`
|
||||
Value float64 `json:"value"`
|
||||
Timestamp int64 `json:"timestamp,omitempty"`
|
||||
Timestamp float64 `json:"timestamp,omitempty"`
|
||||
Labels map[string]string `json:"labels,omitempty"`
|
||||
}
|
||||
|
||||
@@ -45,8 +45,8 @@ type PerformanceReport struct {
|
||||
Version string `json:"version"`
|
||||
ClientID string `json:"client_id"`
|
||||
Labels map[string]string `json:"labels"`
|
||||
Start int64 `json:"start"`
|
||||
End int64 `json:"end"`
|
||||
Start float64 `json:"start"`
|
||||
End float64 `json:"end"`
|
||||
Counters []*MetricSample `json:"counters"`
|
||||
Histograms []*MetricSample `json:"histograms"`
|
||||
}
|
||||
@@ -70,8 +70,8 @@ func (r *PerformanceReport) IsValid() error {
|
||||
}
|
||||
|
||||
now := time.Now().UnixMilli()
|
||||
if r.End < now-performanceReportTTLMilliseconds {
|
||||
return fmt.Errorf("report is outdated: %d", r.End)
|
||||
if r.End < float64(now-performanceReportTTLMilliseconds) {
|
||||
return fmt.Errorf("report is outdated: %f", r.End)
|
||||
}
|
||||
|
||||
return nil
|
||||
|
||||
Ссылка в новой задаче
Block a user