@@ -147,6 +147,7 @@ type Slabs map[string]Slab
147147// Slab represents slab related stats.
148148type Slab struct {
149149 Pages Pages
150+ Slots Slots
150151}
151152
152153// Pages represents the slab memory usage stats.
@@ -155,6 +156,17 @@ type Pages struct {
155156 Free uint64
156157}
157158
159+ // Slots is a map of slots by slot size
160+ type Slots map [string ]Slot
161+
162+ // Slot represents slot related stats.
163+ type Slot struct {
164+ Used uint64
165+ Free uint64
166+ Reqs uint64
167+ Fails uint64
168+ }
169+
158170// HTTPRequests represents HTTP request related stats.
159171type HTTPRequests struct {
160172 Total uint64
@@ -922,12 +934,12 @@ func determineStreamUpdates(updatedServers []StreamUpstreamServer, nginxServers
922934func (client * NginxClient ) GetStats () (* Stats , error ) {
923935 info , err := client .getNginxInfo ()
924936 if err != nil {
925- return nil , fmt .Errorf ("failed to get stats %v" , err )
937+ return nil , fmt .Errorf ("failed to get stats: %v" , err )
926938 }
927939
928940 slabs , err := client .getSlabs ()
929941 if err != nil {
930- return nil , fmt .Errorf ("failed to get stats %v" , err )
942+ return nil , fmt .Errorf ("failed to get stats: %v" , err )
931943 }
932944
933945 cons , err := client .getConnections ()
0 commit comments