cpuinfo

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 13, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package cpuinfo (flat) handles Flatbuffer based processing of /proc/cpuinfo. Instead of returning a Go struct, it returns Flatbuffer serialized bytes. A function to deserialize the Flatbuffer serialized bytes into a cpuinfo.CPUInfo struct is provided.

Note: the package name is cpuinfo and not the final element of the import path (flat).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Deserialize

func Deserialize(p []byte) *info.CPUInfo

Deserialize takes some Flatbuffer serialized bytes and deserializes them as cpuinfo.CPUInfo.

func Get

func Get() (p []byte, err error)

Get returns the current cpuinfo as Flatbuffer serialized bytes using the package's global profiler.

func Serialize

func Serialize(inf *info.CPUInfo) (p []byte, err error)

Serialize cpuinfo.CPUInfo using the package global profiler.

Types

type Profiler

type Profiler struct {
	*info.Profiler
	*fb.Builder
}

Profiler is used to process the /proc/cpuinfo file as Flatbuffers serialized bytes.

func NewProfiler

func NewProfiler() (p *Profiler, err error)

Initializes and returns a cpuinfo profiler.

func (*Profiler) Get

func (p *Profiler) Get() ([]byte, error)

Get returns the current cpuinfo as Flatbuffer serialized bytes.

func (*Profiler) Serialize

func (p *Profiler) Serialize(inf *info.CPUInfo) []byte

Serialize serializes cpuinfo using Flatbuffers.

func (*Profiler) SerializeCPU

func (p *Profiler) SerializeCPU(cpu *info.CPU) fb.UOffsetT

Serialize serializes a CPU using flatbuffers and returns the resulting UOffsetT.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL