forked from cockroachdb/pebble
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This change improves the formatting of the Pebble metrics: - we no longer try to artificially fit non-tabular information in a single table - all byte figures end in B/KB/MB/etc - counts and corresponding sizes are grouped together - flushable ingests information moved under ingestions These metrics are periodically logged and can be obtained through the db console as well. Release note: Pebble metrics formatting improvements; tools that parse these logs might need updating. Fixes cockroachdb#1473.
- Loading branch information
1 parent
bf5f4c4
commit 628c410
Showing
13 changed files
with
1,142 additions
and
573 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// Copyright 2023 The LevelDB-Go and Pebble Authors. All rights reserved. Use | ||
// of this source code is governed by a BSD-style license that can be found in | ||
// the LICENSE file. | ||
|
||
package humanize | ||
|
||
import ( | ||
"bytes" | ||
"fmt" | ||
"strconv" | ||
"strings" | ||
"testing" | ||
|
||
"github.com/cockroachdb/datadriven" | ||
) | ||
|
||
func TestHumanize(t *testing.T) { | ||
datadriven.RunTest(t, "testdata/humanize", func(t *testing.T, td *datadriven.TestData) string { | ||
var c config | ||
switch td.Cmd { | ||
case "bytes": | ||
c = Bytes | ||
case "count": | ||
c = Count | ||
default: | ||
td.Fatalf(t, "invalid command %q", td.Cmd) | ||
} | ||
var buf bytes.Buffer | ||
for _, row := range strings.Split(td.Input, "\n") { | ||
val, err := strconv.ParseInt(row, 10, 64) | ||
if err != nil { | ||
td.Fatalf(t, "error parsing %q: %v", row, err) | ||
} | ||
fmt.Fprintf(&buf, "%s\n", c.Int64(val)) | ||
} | ||
return buf.String() | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
bytes | ||
0 | ||
1 | ||
9 | ||
99 | ||
123 | ||
123456 | ||
12345678 | ||
1234567890 | ||
1234567890123 | ||
123456789012345 | ||
123456789012345678 | ||
---- | ||
0B | ||
1B | ||
9B | ||
99B | ||
123B | ||
121KB | ||
12MB | ||
1.1GB | ||
1.1TB | ||
112TB | ||
110PB | ||
|
||
count | ||
0 | ||
1 | ||
9 | ||
99 | ||
123 | ||
123456 | ||
12345678 | ||
1234567890 | ||
1234567890123 | ||
123456789012345 | ||
123456789012345678 | ||
---- | ||
0 | ||
1 | ||
9 | ||
99 | ||
123 | ||
124K | ||
12M | ||
1.2G | ||
1.2T | ||
124T | ||
124P |
Oops, something went wrong.