Fix double pct replacement in sysstat input (#6001)
This commit is contained in:
parent
049d364917
commit
29c3d42e7e
|
@ -335,6 +335,7 @@ func (s *Sysstat) sadfOptions(activityOption string) []string {
|
||||||
// escape removes % and / chars in field names
|
// escape removes % and / chars in field names
|
||||||
func escape(dirty string) string {
|
func escape(dirty string) string {
|
||||||
var fieldEscaper = strings.NewReplacer(
|
var fieldEscaper = strings.NewReplacer(
|
||||||
|
`%%`, "pct_",
|
||||||
`%`, "pct_",
|
`%`, "pct_",
|
||||||
`/`, "_per_",
|
`/`, "_per_",
|
||||||
)
|
)
|
||||||
|
|
|
@ -225,6 +225,10 @@ func TestEscape(t *testing.T) {
|
||||||
"%util",
|
"%util",
|
||||||
"pct_util",
|
"pct_util",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"%%util",
|
||||||
|
"pct_util",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"bread/s",
|
"bread/s",
|
||||||
"bread_per_s",
|
"bread_per_s",
|
||||||
|
|
Loading…
Reference in New Issue