cadvisor: github.com/google/cadvisor/devicemapper Index | Files | Directories

package devicemapper

import "github.com/google/cadvisor/devicemapper"

Copyright 2016 Google Inc. All Rights Reserved.

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 devicemapper contains code for working with devicemapper

Copyright 2016 Google Inc. All Rights Reserved.

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.

Copyright 2016 Google Inc. All Rights Reserved.

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.

Copyright 2016 Google Inc. All Rights Reserved.

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.

Index

Package Files

dmsetup_client.go doc.go thin_ls_client.go thin_pool_watcher.go util.go

func ThinLsBinaryPresent Uses

func ThinLsBinaryPresent() (string, error)

ThinLsBinaryPresent returns the location of the thin_ls binary in the mount namespace cadvisor is running in or an error. The locations checked are:

- /sbin/ - /bin/ - /usr/sbin/ - /usr/bin/

The thin_ls binary is provided by the device-mapper-persistent-data package.

type DmsetupClient Uses

type DmsetupClient interface {
    // Table runs `dmsetup table` on the given device name and returns the
    // output or an error.
    Table(deviceName string) ([]byte, error)
    // Message runs `dmsetup message` on the given device, passing the given
    // message to the given sector, and returns the output or an error.
    Message(deviceName string, sector int, message string) ([]byte, error)
    // Status runs `dmsetup status` on the given device and returns the output
    // or an error.
    Status(deviceName string) ([]byte, error)
}

DmsetupClient is a low-level client for interacting with device mapper via the `dmsetup` utility, which is provided by the `device-mapper` package.

func NewDmsetupClient Uses

func NewDmsetupClient() DmsetupClient

NewDmSetupClient returns a new DmsetupClient.

type ThinPoolWatcher Uses

type ThinPoolWatcher struct {
    // contains filtered or unexported fields
}

ThinPoolWatcher maintains a cache of device name -> usage stats for a devicemapper thin-pool using thin_ls.

func NewThinPoolWatcher Uses

func NewThinPoolWatcher(poolName, metadataDevice string) (*ThinPoolWatcher, error)

NewThinPoolWatcher returns a new ThinPoolWatcher for the given devicemapper thin pool name and metadata device or an error.

func (*ThinPoolWatcher) GetUsage Uses

func (w *ThinPoolWatcher) GetUsage(deviceID string) (uint64, error)

GetUsage gets the cached usage value of the given device.

func (*ThinPoolWatcher) Refresh Uses

func (w *ThinPoolWatcher) Refresh() error

Refresh performs a `thin_ls` of the pool being watched and refreshes the cached data with the result.

func (*ThinPoolWatcher) Start Uses

func (w *ThinPoolWatcher) Start()

Start starts the ThinPoolWatcher.

func (*ThinPoolWatcher) Stop Uses

func (w *ThinPoolWatcher) Stop()

Stop stops the ThinPoolWatcher.

Directories

PathSynopsis
fake

Package devicemapper imports 11 packages (graph) and is imported by 138 packages. Updated 2020-04-28. Refresh now. Tools for package owners.