mirror of
https://github.com/tendermint/tendermint.git
synced 2026-07-31 20:36:13 +00:00
rename diff function
This commit is contained in:
@@ -59,16 +59,16 @@ func main() {
|
||||
if err != nil {
|
||||
log.Fatalf("Unable to open file %s: %v", os.Args[2], err)
|
||||
}
|
||||
md, err := MetricsDiffFromReaders(fa, fb)
|
||||
md, err := DiffFromReaders(fa, fb)
|
||||
if err != nil {
|
||||
log.Fatalf("Generating diff: %v", err)
|
||||
}
|
||||
fmt.Printf("%s", md)
|
||||
}
|
||||
|
||||
// MetricsDiffFromReaders parses the metrics present in the readers a and b and
|
||||
// DiffFromReaders parses the metrics present in the readers a and b and
|
||||
// determines which metrics were added and removed in b.
|
||||
func MetricsDiffFromReaders(a, b io.Reader) (Diff, error) {
|
||||
func DiffFromReaders(a, b io.Reader) (Diff, error) {
|
||||
parser := expfmt.TextParser{}
|
||||
amf, err := parser.TextToMetricFamilies(a)
|
||||
if err != nil {
|
||||
|
||||
@@ -56,7 +56,7 @@ func TestDiff(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
_, err = io.WriteString(bufB, tc.bContents)
|
||||
require.NoError(t, err)
|
||||
md, err := metricsdiff.MetricsDiffFromReaders(bufA, bufB)
|
||||
md, err := metricsdiff.DiffFromReaders(bufA, bufB)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, tc.want, md)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user