2016-01-06 18:24:20 +00:00
|
|
|
// Copyright 2016 DigitalOcean
|
|
|
|
//
|
|
|
|
// 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.
|
|
|
|
|
2022-02-23 23:43:46 +00:00
|
|
|
package ceph
|
2016-01-06 18:24:20 +00:00
|
|
|
|
2020-10-28 18:42:52 +00:00
|
|
|
// Conn interface implements only necessary methods that are used in this
|
|
|
|
// repository on top of *rados.Conn. This keeps rest of the implementation
|
|
|
|
// clean and *rados.Conn doesn't need to show up everywhere (it being more of
|
|
|
|
// an implementation detail in reality). Also it makes mocking easier for
|
|
|
|
// unit-testing the collectors.
|
2016-01-06 18:24:20 +00:00
|
|
|
type Conn interface {
|
|
|
|
MonCommand([]byte) ([]byte, string, error)
|
2020-10-29 17:27:05 +00:00
|
|
|
MgrCommand([][]byte) ([]byte, string, error)
|
2022-02-24 20:12:52 +00:00
|
|
|
GetPoolStats(string) (*PoolStat, error)
|
2016-01-06 18:24:20 +00:00
|
|
|
}
|
|
|
|
|
2022-02-24 20:12:52 +00:00
|
|
|
// PoolStats contains data for a single pool.
|
|
|
|
// We currently only use one field but may add more from co-ceph/rados.PoolStat
|
|
|
|
type PoolStat struct {
|
|
|
|
ObjectsUnfound uint64
|
2020-09-10 18:32:03 +00:00
|
|
|
}
|