mirror of
https://github.com/hoernschen/dendrite.git
synced 2024-12-27 23:48:27 +00:00
Metric fixes
Squashed commit of the following: commitc6eb4d8bbf
Author: Neil Alexander <neilalexander@users.noreply.github.com> Date: Mon Jul 19 16:52:57 2021 +0100 Fix bug commitd420966d9a
Author: Neil Alexander <neilalexander@users.noreply.github.com> Date: Mon Jul 19 16:46:12 2021 +0100 Update metric commit0ad6e37846
Author: Neil Alexander <neilalexander@users.noreply.github.com> Date: Mon Jul 19 16:30:14 2021 +0100 Fix observe for calculateStateDurations
This commit is contained in:
parent
eb2a8e4c0b
commit
09d3bab838
1 changed files with 4 additions and 5 deletions
|
@ -428,12 +428,12 @@ var calculateStateDurations = prometheus.NewHistogramVec(
|
||||||
prometheus.HistogramOpts{
|
prometheus.HistogramOpts{
|
||||||
Namespace: "dendrite",
|
Namespace: "dendrite",
|
||||||
Subsystem: "roomserver",
|
Subsystem: "roomserver",
|
||||||
Name: "calculate_state_duration_microseconds",
|
Name: "calculate_state_duration_milliseconds",
|
||||||
Help: "How long it takes to calculate the state after a list of events",
|
Help: "How long it takes to calculate the state after a list of events",
|
||||||
Buckets: []float64{ // milliseconds
|
Buckets: []float64{ // milliseconds
|
||||||
5, 10, 25, 50, 75, 100, 250, 500,
|
5, 10, 25, 50, 75, 100, 200, 300, 400, 500,
|
||||||
1000, 2000, 3000, 4000, 5000, 6000,
|
1000, 2000, 3000, 4000, 5000, 6000,
|
||||||
7000, 8000, 9000, 10000, 15000, 20000,
|
7000, 8000, 9000, 10000, 15000, 20000, 30000,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// Takes two labels:
|
// Takes two labels:
|
||||||
|
@ -501,9 +501,8 @@ func (c *calculateStateMetrics) stop(stateNID types.StateSnapshotNID, err error)
|
||||||
} else {
|
} else {
|
||||||
outcome = "failure"
|
outcome = "failure"
|
||||||
}
|
}
|
||||||
endTime := time.Now()
|
|
||||||
calculateStateDurations.WithLabelValues(c.algorithm, outcome).Observe(
|
calculateStateDurations.WithLabelValues(c.algorithm, outcome).Observe(
|
||||||
float64(endTime.Sub(c.startTime).Nanoseconds()) / 1000.,
|
float64(time.Since(c.startTime).Milliseconds()),
|
||||||
)
|
)
|
||||||
calculateStatePrevEventLength.WithLabelValues(c.algorithm, outcome).Observe(
|
calculateStatePrevEventLength.WithLabelValues(c.algorithm, outcome).Observe(
|
||||||
float64(c.prevEventLength),
|
float64(c.prevEventLength),
|
||||||
|
|
Loading…
Reference in a new issue