MM-62365: Remove unused field from MetricSample (#30991)
The Timestamp field was not used at all. Therefore removing it. https://mattermost.atlassian.net/browse/MM-62365 ```release-note NONE ```
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
27874fa4e5
Коммит
ad56ab3fdc
@@ -64,16 +64,15 @@ func TestMobileMetrics(t *testing.T) {
|
|||||||
var start float64 = 125
|
var start float64 = 125
|
||||||
end := start + float64(len(ttcc))
|
end := start + float64(len(ttcc))
|
||||||
// Precheck
|
// Precheck
|
||||||
for i, tc := range ttcc {
|
for _, tc := range ttcc {
|
||||||
actualMetric, err := tc.histogramVec.GetMetricWith(prometheus.Labels{"platform": platform})
|
actualMetric, err := tc.histogramVec.GetMetricWith(prometheus.Labels{"platform": platform})
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.NoError(t, actualMetric.(prometheus.Histogram).Write(m))
|
require.NoError(t, actualMetric.(prometheus.Histogram).Write(m))
|
||||||
require.Equal(t, uint64(0), m.Histogram.GetSampleCount())
|
require.Equal(t, uint64(0), m.Histogram.GetSampleCount())
|
||||||
require.Equal(t, 0.0, m.Histogram.GetSampleSum())
|
require.Equal(t, 0.0, m.Histogram.GetSampleSum())
|
||||||
histograms = append(histograms, &model.MetricSample{
|
histograms = append(histograms, &model.MetricSample{
|
||||||
Metric: tc.metricName,
|
Metric: tc.metricName,
|
||||||
Value: tc.elapsed,
|
Value: tc.elapsed,
|
||||||
Timestamp: start + float64(i),
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -84,10 +84,9 @@ var (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type MetricSample struct {
|
type MetricSample struct {
|
||||||
Metric MetricType `json:"metric"`
|
Metric MetricType `json:"metric"`
|
||||||
Value float64 `json:"value"`
|
Value float64 `json:"value"`
|
||||||
Timestamp float64 `json:"timestamp,omitempty"`
|
Labels map[string]string `json:"labels,omitempty"`
|
||||||
Labels map[string]string `json:"labels,omitempty"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *MetricSample) GetLabelValue(name string, acceptedValues map[string]any, defaultValue string) string {
|
func (s *MetricSample) GetLabelValue(name string, acceptedValues map[string]any, defaultValue string) string {
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user