counters

package
v0.0.0-...-2b92083 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CncFile                 = "cnc.dat"
	CurrentCncVersion int32 = 15
)
View Source
const COUNTER_LENGTH = util.CacheLineLength * 2
View Source
const FULL_LABEL_LENGTH = util.CacheLineLength * 6
View Source
const LABEL_OFFSET = util.CacheLineLength * 2
View Source
const METADATA_LENGTH = LABEL_OFFSET + FULL_LABEL_LENGTH
View Source
const RECORD_ALLOCATED int32 = 1
View Source
const RECORD_UNUSED int32 = 0

Variables

This section is empty.

Functions

This section is empty.

Types

type Counter

type Counter struct {
	Id     int32
	TypeId int32
	Value  int64
	Label  string
}

type MetaDataFlyweight

type MetaDataFlyweight struct {
	flyweight.FWBase

	CncVersion flyweight.Int32Field

	ToDriverBufLen flyweight.Int32Field
	ToClientBufLen flyweight.Int32Field

	ClientLivenessTo flyweight.Int64Field

	ToDriverBuf  flyweight.RawDataField
	ToClientsBuf flyweight.RawDataField
	MetaDataBuf  flyweight.RawDataField
	ValuesBuf    flyweight.RawDataField
	ErrorBuf     flyweight.RawDataField
	// contains filtered or unexported fields
}

*

  • Description of the command and control file used between driver and clients.
  • <p>
  • File Layout
  • <pre>
  • +-----------------------------+
  • | Meta Data |
  • +-----------------------------+
  • | to-driver Buffer |
  • +-----------------------------+
  • | to-clients Buffer |
  • +-----------------------------+
  • | Counters Metadata Buffer |
  • +-----------------------------+
  • | Counters Values Buffer |
  • +-----------------------------+
  • | Error Log |
  • +-----------------------------+
  • </pre>
  • <p>
  • Meta Data Layout (CnC Version 7)
  • <pre>
  • 0 1 2 3
  • 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  • +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  • | Aeron CnC Version |
  • +---------------------------------------------------------------+
  • | to-driver buffer length |
  • +---------------------------------------------------------------+
  • | to-clients buffer length |
  • +---------------------------------------------------------------+
  • | Counters Metadata buffer length |
  • +---------------------------------------------------------------+
  • | Counters Values buffer length |
  • +---------------------------------------------------------------+
  • | Error Log buffer length |
  • +---------------------------------------------------------------+
  • | Client Liveness Timeout |
  • | |
  • +---------------------------------------------------------------+
  • </pre>

func MapFile

func MapFile(filename string) (*MetaDataFlyweight, *memmap.File, error)

func (*MetaDataFlyweight) Wrap

func (m *MetaDataFlyweight) Wrap(buf *atomic.Buffer, offset int) flyweight.Flyweight

type Reader

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

func NewReader

func NewReader(values, metaData *atomic.Buffer) *Reader

func (*Reader) Scan

func (reader *Reader) Scan(cb func(Counter))

Jump to

Keyboard shortcuts

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