Skip to content

Commit

Permalink
Add F5 memory stats
Browse files Browse the repository at this point in the history
  • Loading branch information
msummers-nr committed May 29, 2018
1 parent bf325fb commit f17894c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
17 changes: 16 additions & 1 deletion f5/sys/memory_stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,20 @@ type MemoryInnerStatsList struct {
}

type MemoryStatsEntries struct {
NestedMemoryStats MemoryStats `json:"nestedStats,omitempty"`
NestedStats MemoryStats `json:"nestedStats,omitempty"`
}

type MemoryStats struct {
Entries struct {
Allocated struct {
Value int `json:"value"`
} `json:"allocated,omitempty"`
HostId struct {
Value string `json:"description"`
} `json:"hostId,omitempty"`
MaxAllocated struct{
Value int `json:"value"`
} `json maxAllocated,omitempty"`
MemoryFree struct {
Value int `json:"value"`
} `json:"memoryFree,omitempty"`
Expand All @@ -47,6 +53,9 @@ type MemoryStats struct {
OtherMemoryUsed struct {
Value int `json:"value"`
} `json:"otherMemoryUsed,omitempty"`
Size struct {
Value int `json:"value"`
} `json:"size,omitempty"`
SwapFree struct {
Value int `json:"value"`
} `json:"swapFree,omitempty"`
Expand All @@ -56,6 +65,9 @@ type MemoryStats struct {
SwapUsed struct {
Value int `json:"value"`
} `json:"swapUsed,omitempty"`
TmmId struct {
Value string `json:"description"`
} `json:"tmmId,omitempty"`
TmmMemoryFree struct {
Value int `json:"value"`
} `json:"tmmMemoryFree,omitempty"`
Expand All @@ -65,6 +77,9 @@ type MemoryStats struct {
TmmMemoryUsed struct {
Value int `json:"value"`
} `json:"tmmMemoryUsed,omitempty"`
TmName struct {
Value string `json:"description"`
} `json:"tmName,omitempty"`
} `json:"entries,omitempty"`
}

Expand Down
6 changes: 6 additions & 0 deletions f5/sys/sys.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ type Sys struct {
managementIP ManagementIPResource
managementOVSDB ManagementOVSDBResource
managementRoute ManagementRouteResource
memoryStats MemoryStatsResource
nTP NTPResource
nTPRestrict NTPRestrictResource
outboundSMTP OutboundSMTPResource
Expand Down Expand Up @@ -238,6 +239,7 @@ func New(c *f5.Client) Sys {
managementIP: ManagementIPResource{c: c},
managementOVSDB: ManagementOVSDBResource{c: c},
managementRoute: ManagementRouteResource{c: c},
memoryStats: MemoryStatsResource{c: c},
nTP: NTPResource{c: c},
nTPRestrict: NTPRestrictResource{c: c},
outboundSMTP: OutboundSMTPResource{c: c},
Expand Down Expand Up @@ -738,6 +740,10 @@ func (sys Sys) ManagementRoute() *ManagementRouteResource {
return &sys.managementRoute
}

func (sys Sys) MemoryStats() *MemoryStatsResource {
return &sys.memoryStats
}

// nTP returns a configured NTPResource.
func (sys Sys) NTP() *NTPResource {
return &sys.nTP
Expand Down

0 comments on commit f17894c

Please sign in to comment.