mirror of
https://github.com/prometheus/prometheus
synced 2024-12-26 08:33:06 +00:00
Additional logging in compact.go - logged time needed for writing blocks (#505)
* Additional logging in compact.go - logged time needed for writing blocks to disk Signed-off-by: Radoslaw Lesniewski <Radoslaw.Lesniewski@sabre.com> * Additional logging in compact.go - code formatted Signed-off-by: Radoslaw Lesniewski <Radoslaw.Lesniewski@sabre.com>
This commit is contained in:
parent
a29ab50a20
commit
eb5034d5b0
10
compact.go
10
compact.go
@ -414,6 +414,8 @@ func (c *LeveledCompactor) Compact(dest string, dirs []string, open []*Block) (u
|
||||
}
|
||||
|
||||
func (c *LeveledCompactor) Write(dest string, b BlockReader, mint, maxt int64, parent *BlockMeta) (ulid.ULID, error) {
|
||||
start := time.Now()
|
||||
|
||||
entropy := rand.New(rand.NewSource(time.Now().UnixNano()))
|
||||
uid := ulid.MustNew(ulid.Now(), entropy)
|
||||
|
||||
@ -440,7 +442,13 @@ func (c *LeveledCompactor) Write(dest string, b BlockReader, mint, maxt int64, p
|
||||
return ulid.ULID{}, nil
|
||||
}
|
||||
|
||||
level.Info(c.logger).Log("msg", "write block", "mint", meta.MinTime, "maxt", meta.MaxTime, "ulid", meta.ULID)
|
||||
level.Info(c.logger).Log(
|
||||
"msg", "write block",
|
||||
"mint", meta.MinTime,
|
||||
"maxt", meta.MaxTime,
|
||||
"ulid", meta.ULID,
|
||||
"duration", time.Since(start),
|
||||
)
|
||||
return uid, nil
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user