Implement review feedback

This commit is contained in:
Daniel
2020-10-30 11:54:00 +01:00
parent ed00e1fe83
commit fa3f873c31
7 changed files with 64 additions and 28 deletions

View File

@@ -59,9 +59,29 @@ type Process struct {
// Profile returns the assigned layered profile.
func (p *Process) Profile() *profile.LayeredProfile {
if p == nil {
return nil
}
return p.profile
}
// GetLastSeen returns the unix timestamp when the process was last seen.
func (p *Process) GetLastSeen() int64 {
p.Lock()
defer p.Unlock()
return p.LastSeen
}
// SetLastSeen sets the unix timestamp when the process was last seen.
func (p *Process) SetLastSeen(lastSeen int64) {
p.Lock()
defer p.Unlock()
p.LastSeen = lastSeen
}
// Strings returns a string representation of process.
func (p *Process) String() string {
if p == nil {