Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
sbueringer committed Oct 29, 2018
1 parent 6eaf6a7 commit f0fe6b0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cmd/thanos-inspect/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,13 @@ func downloadMetadata(c *config) ([]*block.Meta, error) {
if strings.Contains(objInfo.Key, "meta.json") {
obj, err := client.GetObject(*bucket, objInfo.Key, minio.GetObjectOptions{})
if err != nil {
return nil, err
fmt.Printf("ERROR: cannot download block: %s\n", objInfo.Key)
}

blockMeta := &block.Meta{}
err = json.NewDecoder(obj).Decode(blockMeta)
if err != nil {
return nil, err
fmt.Printf("ERROR: cannot download block: %s\n", objInfo.Key)
}
blockMetas = append(blockMetas, blockMeta)
}
Expand All @@ -117,7 +117,7 @@ func downloadMetadata(c *config) ([]*block.Meta, error) {

func printTable(blockMetas []*block.Meta) error {

header := []string{"ULID", "FROM", "UNTIL", "RANGE", "UNTIL-COMP", "~SIZE", "#SERIES", "#SAMPLES", "#CHUNKS", "COMP-LEVEL", "REPLICA", "RESOLUTION", "SOURCE"}
header := []string{"ULID", "FROM", "UNTIL", "RANGE", "UNTIL-COMP", "~SIZE", "#SERIES", "#SAMPLES", "#CHUNKS", "COMP-LEVEL", "COMP-FAILED", "REPLICA", "RESOLUTION", "SOURCE"}

var lines [][]string
p := message.NewPrinter(language.English)
Expand Down Expand Up @@ -146,6 +146,7 @@ func printTable(blockMetas []*block.Meta) error {
line = append(line, p.Sprintf("%d", blockMeta.Stats.NumSamples))
line = append(line, p.Sprintf("%d", blockMeta.Stats.NumChunks))
line = append(line, p.Sprintf("%d", blockMeta.Compaction.Level))
line = append(line, p.Sprintf("%t", blockMeta.Compaction.Failed))
line = append(line, blockMeta.Thanos.Labels["replica"])
line = append(line, time.Duration(blockMeta.Thanos.Downsample.Resolution * 1000000).String())
line = append(line, string(blockMeta.Thanos.Source))
Expand Down

0 comments on commit f0fe6b0

Please sign in to comment.