read_logs

package
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseReadLogsFromLogFile

func ParseReadLogsFromLogFile(reader io.Reader) (map[int64]*StructuredReadLogEntry, error)

ParseReadLogsFromLogFile is originally written for read cache logs parsing for functional tests. This method takes gcsfuse logs file path (json format) as input and parses it into map of following structure:

{
  "25"(file handle): {
    "handle": 25,
    "StartTime": 1704444226937309952,
    "ProcessID": 2270282,
    "InodeID": 2,
    "BucketName": "bucket_name",
    "ObjectName": "object/name",
    "Chunks": [
      {
        "StartTime": 1704444226937457664,
        "StartOffset": 0,
        "Size": 26214,
        "CacheHit": false,
        "IsSequential": true,
        "OpID": "310f589d-20bf",
        "ExecutionTime": "1.907320375s"
      },
			...
    ]
	},
	...
}

Types

type ReadChunkData

type ReadChunkData struct {
	StartTimeSeconds int64
	StartTimeNanos   int64
	StartOffset      int64
	Size             int64
	CacheHit         bool
	IsSequential     bool
	OpID             string
	ExecutionTime    string
}

ReadChunkData stores the format of chunk to be stored StructuredReadLogEntry.

type StructuredReadLogEntry

type StructuredReadLogEntry struct {
	Handle           int64
	StartTimeSeconds int64
	StartTimeNanos   int64
	ProcessID        int64
	InodeID          int64
	BucketName       string
	ObjectName       string
	// It can be safely assumed that the Chunks will be sorted on timestamp as logs
	// are parsed in the order of timestamps.
	Chunks []ReadChunkData
}

StructuredReadLogEntry stores the structured format to be created from logs.

func GetStructuredLogsSortedByTimestamp

func GetStructuredLogsSortedByTimestamp(logFilePath string, t *testing.T) []*StructuredReadLogEntry

GetStructuredLogsSortedByTimestamp is originally written for read cache logs parsing for functional tests. This method takes gcsfuse logs file path (json format) as input and parses it into array of structured log entries sorted by timestamp.

Jump to

Keyboard shortcuts

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