processor

package
v0.0.0-...-8b5a9de Latest Latest
Warning

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

Go to latest
Published: May 22, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RequiredHeaders = []string{
	"report_period_start", "report_period_end", "interval_start", "interval_end",
	"node", "namespace", "pod", "pod_usage_cpu_core_seconds",
	"pod_request_cpu_core_seconds", "pod_limit_cpu_core_seconds",
	"pod_usage_memory_byte_seconds", "pod_request_memory_byte_seconds",
	"pod_limit_memory_byte_seconds", "node_capacity_cpu_cores",
	"node_capacity_cpu_core_seconds", "node_capacity_memory_bytes",
	"node_capacity_memory_byte_seconds", "node_role", "resource_id",
	"pod_labels",
}

RequiredHeaders is the subset of CSV headers that must be present

Functions

func ProcessCSV

func ProcessCSV(ctx context.Context, repo *db.Repository, reader *csv.Reader, clusterID string) error

ProcessCSV processes a CSV reader, extracting distinct node data and inserting into data tables

func ProcessTar

func ProcessTar(ctx context.Context, tarPath string, repo *db.Repository) error

ProcessTar processes a tar.gz archive, extracting manifest.json and valid CSVs

Types

type Manifest

type Manifest struct {
	ClusterID string   `json:"cluster_id"`
	Files     []string `json:"files"`
	CRStatus  struct {
		ClusterID string `json:"clusterID"`
		Source    struct {
			Name string `json:"name"`
		} `json:"source"`
	} `json:"cr_status"`
}

Manifest represents the structure of manifest.json

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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