Remove per measurement stats collection
The stats setup ends up creating a lot of lock contention which signifcantly impacts write throughput when a large number of measurements are used. Fixes #6131pull/6168/head
parent
f1bb87d4f8
commit
40c4973423
19
tsdb/meta.go
19
tsdb/meta.go
|
@ -374,8 +374,6 @@ func (d *DatabaseIndex) DropMeasurement(name string) {
|
|||
delete(d.series, s.Key)
|
||||
}
|
||||
|
||||
m.drop()
|
||||
|
||||
d.statMap.Add(statDatabaseSeries, int64(-len(m.seriesByID)))
|
||||
d.statMap.Add(statDatabaseMeasurements, -1)
|
||||
}
|
||||
|
@ -417,8 +415,6 @@ type Measurement struct {
|
|||
measurement *Measurement
|
||||
seriesByTagKeyValue map[string]map[string]SeriesIDs // map from tag key to value to sorted set of series ids
|
||||
seriesIDs SeriesIDs // sorted list of series IDs in this measurement
|
||||
|
||||
statMap *expvar.Map
|
||||
}
|
||||
|
||||
// NewMeasurement allocates and initializes a new Measurement.
|
||||
|
@ -431,12 +427,6 @@ func NewMeasurement(name string, idx *DatabaseIndex) *Measurement {
|
|||
seriesByID: make(map[uint64]*Series),
|
||||
seriesByTagKeyValue: make(map[string]map[string]SeriesIDs),
|
||||
seriesIDs: make(SeriesIDs, 0),
|
||||
|
||||
statMap: influxdb.NewStatistics(
|
||||
fmt.Sprintf("measurement:%s.%s", name, idx.name),
|
||||
"measurement",
|
||||
map[string]string{"database": idx.name, "measurement": name},
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -529,7 +519,6 @@ func (m *Measurement) AddSeries(s *Series) bool {
|
|||
valueMap[v] = ids
|
||||
}
|
||||
|
||||
m.statMap.Add(statMeasurementSeries, 1)
|
||||
return true
|
||||
}
|
||||
|
||||
|
@ -577,17 +566,9 @@ func (m *Measurement) DropSeries(seriesID uint64) {
|
|||
}
|
||||
}
|
||||
|
||||
m.statMap.Add(statMeasurementSeries, -1)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// drop handles any cleanup for when a measurement is dropped.
|
||||
// Currently only cleans up stats.
|
||||
func (m *Measurement) drop() {
|
||||
m.statMap.Add(statMeasurementSeries, int64(-len(m.seriesIDs)))
|
||||
}
|
||||
|
||||
// filters walks the where clause of a select statement and returns a map with all series ids
|
||||
// matching the where clause and any filter expression that should be applied to each
|
||||
func (m *Measurement) filters(condition influxql.Expr) (map[uint64]influxql.Expr, error) {
|
||||
|
|
Loading…
Reference in New Issue