Skip to content

Commit

Permalink
feat(types): time relevant info for proctree (#3712)
Browse files Browse the repository at this point in the history
Add a time relevant info object for proctree queries.
This will give the query answer the time context it is relevant for.
  • Loading branch information
AlonZivony authored Nov 28, 2023
1 parent 91b1818 commit cfe4d64
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion types/datasource/proctree.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ import (
"time"
)

// TimeRelevantInfo is the returned value of all the time specific process tree queries.
// It envelopes the information from the tree with the time it is relevant for.
type TimeRelevantInfo[T any] struct {
Timestamp time.Time
Info T
}

// ProcessInfo is the user facing representation of a process data at a specific time.
type ProcessInfo struct {
EntityId uint32
Expand Down Expand Up @@ -51,7 +58,7 @@ type FileInfo struct {
// ProcessLineage is a representation of a process and its ancestors until the oldest ancestor
// known in the tree.
// The lineage is only relevant for the container the process resides in.
type ProcessLineage []ProcessInfo
type ProcessLineage []TimeRelevantInfo[ProcessInfo]

// ProcKey is a key to the process tree data source, which will result receiving ProcessInfo in the
// response for the matching process in the given time.
Expand Down

0 comments on commit cfe4d64

Please sign in to comment.