Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrProfileNotFound = errors.New("profile not found")
)
Functions ¶
func BuildTimeKey ¶
func CompareKey ¶
Types ¶
type LabelFilter ¶
type LabelFilter struct {
Label
// contains filtered or unexported fields
}
func (LabelFilter) Policy ¶
func (f LabelFilter) Policy(slice1, slice2 []string) []string
type ProfileMeta ¶
type ProfileMeta struct {
ProfileID string `json:"profile_id"`
ProfileType string `json:"profile_type"`
SampleType string `json:"sample_type"`
TargetName string `json:"target_name"`
Instance string `json:"instance"`
SampleTypeUnit string `json:"sample_type_unit"`
Value int64 `json:"value"`
Timestamp int64 `json:"timestamp"`
Duration int64 `json:"duration"`
Labels []Label `json:"labels"`
}
func (*ProfileMeta) Decode ¶
func (meta *ProfileMeta) Decode(v []byte) error
func (*ProfileMeta) Encode ¶
func (meta *ProfileMeta) Encode() ([]byte, error)
type ProfileMetaByTarget ¶
type ProfileMetaByTarget struct {
Key string `json:"key"`
ProfileMetas []*ProfileMeta `json:"profile_metas"`
}
type Store ¶
type Store interface {
// GetProfile Get profile binaries by profile id, return profile binaries
GetProfile(id string) (string, []byte, error)
// SaveProfile Save profile,return profile id
// data: binary profile data
// ttl: profile expiration time
SaveProfile(name string, data []byte, ttl time.Duration) (string, error)
// SaveProfileMeta Save profile meta data
SaveProfileMeta(metas []*ProfileMeta, ttl time.Duration) error
// ListProfileMeta Get profile mete data list
ListProfileMeta(sampleType string, startTime, endTime time.Time, filters ...LabelFilter) ([]*ProfileMetaByTarget, error)
// ListSampleType Get collected sample types list (heap_alloc_objects ,heap_alloc_space ,heap_inuse_objects ,heap_inuse_space...)
ListSampleType() ([]string, error)
// ListTarget Get collection target list
ListTarget() ([]string, error)
// ListLabel Get collection target labels list
ListLabel() ([]Label, error)
// Release Store
Release()
}
Click to show internal directories.
Click to hide internal directories.