mirror of
https://github.com/prometheus/prometheus.git
synced 2025-09-20 21:31:02 +02:00
Merge pull request #17074 from prymitive/logs
TSDB: Log when GC / block write starts
This commit is contained in:
commit
aa12c0d4c3
@ -648,6 +648,7 @@ func (db *DB) keepSeriesInWALCheckpointFn(last int) func(id chunks.HeadSeriesRef
|
||||
}
|
||||
|
||||
func (db *DB) truncate(mint int64) error {
|
||||
db.logger.Info("series GC started")
|
||||
db.mtx.RLock()
|
||||
defer db.mtx.RUnlock()
|
||||
|
||||
|
@ -562,6 +562,7 @@ func (c *LeveledCompactor) Write(dest string, b BlockReader, mint, maxt int64, b
|
||||
start := time.Now()
|
||||
|
||||
uid := ulid.MustNew(ulid.Now(), rand.Reader)
|
||||
c.logger.Info("write block started", "mint", mint, "maxt", maxt, "ulid", uid)
|
||||
|
||||
meta := &BlockMeta{
|
||||
ULID: uid,
|
||||
@ -596,7 +597,7 @@ func (c *LeveledCompactor) Write(dest string, b BlockReader, mint, maxt int64, b
|
||||
}
|
||||
|
||||
c.logger.Info(
|
||||
"write block",
|
||||
"write block completed",
|
||||
"mint", meta.MinTime,
|
||||
"maxt", meta.MaxTime,
|
||||
"ulid", meta.ULID,
|
||||
|
@ -1420,6 +1420,7 @@ func (db *DB) compactOOOHead(ctx context.Context) error {
|
||||
// Each ULID in the result corresponds to a block in a unique time range.
|
||||
// The db.cmtx mutex should be held before calling this method.
|
||||
func (db *DB) compactOOO(dest string, oooHead *OOOCompactionHead) (_ []ulid.ULID, err error) {
|
||||
db.logger.Info("out-of-order compaction started")
|
||||
start := time.Now()
|
||||
|
||||
blockSize := oooHead.ChunkRange()
|
||||
|
@ -1415,6 +1415,7 @@ func (h *Head) truncateOOO(lastWBLFile int, newMinOOOMmapRef chunks.ChunkDiskMap
|
||||
// truncateSeriesAndChunkDiskMapper is a helper function for truncateMemory and truncateOOO.
|
||||
// It runs GC on the Head and truncates the ChunkDiskMapper accordingly.
|
||||
func (h *Head) truncateSeriesAndChunkDiskMapper(caller string) error {
|
||||
h.logger.Info("Head GC started", "caller", caller)
|
||||
start := time.Now()
|
||||
headMaxt := h.MaxTime()
|
||||
actualMint, minOOOTime, minMmapFile := h.gc()
|
||||
|
Loading…
x
Reference in New Issue
Block a user