obj

package
v0.0.0-...-32ebda9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 1, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dump

type Dump struct {
	FilePath string
	Index    []*string
	Entries  map[string]*Entry
}

Dump contains all relevant data for a single heap dump.

func NewDump

func NewDump(filePath string) *Dump

NewDump returns a *Dump instance populated with the specified file path.

func (*Dump) PrintEntryAddress

func (s *Dump) PrintEntryAddress(indexes []*string)

PrintEntryAddress prints the memory addresses in hex (0x...) format of the entries for the list of given indexes.

func (*Dump) PrintEntryJSON

func (s *Dump) PrintEntryJSON(indexes []*string) error

PrintEntryJSON prints the full JSON blob from the input file for the entries with the given indexes. It does this by using the Offset value of the entries to avoid having to load up the whole dump file in memory.

func (*Dump) Process

func (s *Dump) Process() error

Process processes the heap dump

type Entry

type Entry struct {
	Object *Object
	Offset int64
	Index  string
}

Entry is a parsed heap item object

func NewEntry

func NewEntry(inputJSON []byte) (*Entry, error)

NewEntry returns a new *Entry instance initialized with a *Object of the given input JSON data.

func (*Entry) Address

func (s *Entry) Address() string

Address returns the Address property of the entry's Object.

type Object

type Object struct {
	Address string `json:"address"`
	Type    string `json:"type"`
}

Object is a minimal representation of a Ruby heap object as exported from Ruby via `ObjectSpace.dump_all`.

func NewObject

func NewObject(inputJSON []byte) (*Object, error)

NewObject returns a new *Object instance with it's attributes populated from the given input JSON data.

func (*Object) Index

func (s *Object) Index() string

Index returns a unique index for the given Object.

func (Object) MarshalEasyJSON

func (v Object) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Object) MarshalJSON

func (v Object) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Object) UnmarshalEasyJSON

func (v *Object) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Object) UnmarshalJSON

func (v *Object) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL