Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion hsperfdata.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,16 @@ func ReadPerfData(filepath string, parserTime bool) (map[string]interface{}, err
return nil, err
}
}

return ParsePerfDataFromBytes(data, parserTime)
}

// ParsePerfDataFromBytes parser hotspot performance data, and return a map represented entries' name and value,
// "ticks" are the unit of measurement of time in the Hotspot JVM.
// when the parserTime is true, tick time value will be parsered to a normal nanoseconds using
// the "sun.os.hrt.frequency" key in the hsperfdata.
func ParsePerfDataFromBytes(data []byte, parserTime bool) (map[string]interface{}, error) {
var err error
buffer := bytes.NewReader(data)

header := perfdataHeader{}
Expand Down Expand Up @@ -337,4 +347,3 @@ func ReadPerfData(filepath string, parserTime bool) (map[string]interface{}, err
}
return entryMap, nil
}