X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=api%2Fstats.go;h=e254eae45d99c9da1cefe6a1388e5e4887090376;hb=bde85d422c7949ec32fb067e9c36320ccc47fb9e;hp=9c3a16fc17153d539b525935764f19142a5e95b6;hpb=df1b888a2bfadefadc7dbfce59d34f811ff002ec;p=govpp.git diff --git a/api/stats.go b/api/stats.go index 9c3a16f..e254eae 100644 --- a/api/stats.go +++ b/api/stats.go @@ -1,3 +1,17 @@ +// Copyright (c) 2019 Cisco and/or its affiliates. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at: +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package api // SystemStats represents global system statistics. @@ -68,10 +82,24 @@ type ErrorCounter struct { Value uint64 } +// BufferStats represents statistics per buffer pool. +type BufferStats struct { + Buffer map[string]BufferPool +} + +// BufferPool represents buffer pool. +type BufferPool struct { + PoolName string + Cached float64 + Used float64 + Available float64 +} + // StatsProvider provides the methods for getting statistics. type StatsProvider interface { GetSystemStats() (*SystemStats, error) GetNodeStats() (*NodeStats, error) GetInterfaceStats() (*InterfaceStats, error) GetErrorStats(names ...string) (*ErrorStats, error) + GetBufferStats() (*BufferStats, error) }