reports

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

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

Go to latest
Published: Feb 12, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

README

Package cloudeng.io/cmd/idu/internal/reports

CircleCI Go Report Card

import cloudeng.io/cmd/idu/internal/reports

Functions

Func PopN
func PopN[T comparable](heap *heap.MinMax[int64, T], n int) (keys []int64, vals []T)

Types

Type AllStats
type AllStats struct {
	MaxN     int
	Prefix   *Heaps[string]
	PerUser  PerIDStats
	PerGroup PerIDStats
	ByUser   *Heaps[int64]
	ByGroup  *Heaps[int64]
	// contains filtered or unexported fields
}

AllStats is a collection of statistics for a given prefix and includes:

  • the top N values for each statistic by prefix - the total for each statistic - the top N values for/per each statistic by user/group - the topN user/groups by each statistic
Functions
func NewAllStats(prefix string, n int) *AllStats
Methods
func (s *AllStats) Finalize()
func (s *AllStats) PushPerGroupStats(prefix string, ug stats.PerIDTotals)
func (s *AllStats) PushPerUserStats(prefix string, us stats.PerIDTotals)
func (s *AllStats) Update(prefix string, pi prefixinfo.T, calc diskusage.Calculator, matcher boolexpr.Matcher) error
Type Heaps
type Heaps[T comparable] struct {
	MaxN                          int
	Prefix                        string
	TotalBytes, TotalStorageBytes int64
	TotalFiles, TotalPrefixes     int64
	TotalPrefixBytes              int64
	TotalHardlinks                int64
	TotalHardlinkDirs             int64
	Bytes                         *heap.MinMax[int64, T]
	StorageBytes                  *heap.MinMax[int64, T]
	PrefixBytes                   *heap.MinMax[int64, T]
	Files                         *heap.MinMax[int64, T]
	Prefixes                      *heap.MinMax[int64, T]
}

Heaps is a collection of heap data structures for determining the top N values for a set of statistics and also for computing the total for those statistics. The Prefix refers to the root of the hierarchy for which the statistics are being computed.

Methods
func (h *Heaps[T]) Merge(n int) map[T]MergedStats
func (h *Heaps[T]) Push(item T, bytes, storageBytes, prefixBytes, files, prefixes, children int64)
Type MergedStats
type MergedStats struct {
	Prefix      string `json:"prefix,omitempty"`
	ID          int64  `json:"id,omitempty"`
	IDName      string `json:"name,omitempty"`
	Bytes       int64  `json:"bytes"`
	Storage     int64  `json:"storage,omitempty"`
	Files       int64  `json:"files"`
	Prefixes    int64  `json:"prefixes"`
	PrefixBytes int64  `json:"prefix_bytes"`
}
Type PerIDStats
type PerIDStats struct {
	Prefix   string
	MaxN     int
	ByPrefix map[int64]*Heaps[string]
}

PerIDStats is a collection of statistics on a per user/group basis.

Methods
func (s *PerIDStats) Push(id int64, prefix string, size, storageBytes, prefixBytes, files, prefixCount, children int64)
Type Zipped
type Zipped[T comparable] struct {
	K int64
	V T
}
Functions
func ZipN[T comparable](h *heap.MinMax[int64, T], n int) (z []Zipped[T])

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PopN

func PopN[T comparable](heap *heap.MinMax[int64, T], n int) (keys []int64, vals []T)

Types

type AllStats

type AllStats struct {
	MaxN     int
	Prefix   *Heaps[string]
	PerUser  PerIDStats
	PerGroup PerIDStats
	ByUser   *Heaps[int64]
	ByGroup  *Heaps[int64]
	// contains filtered or unexported fields
}

AllStats is a collection of statistics for a given prefix and includes: - the top N values for each statistic by prefix - the total for each statistic - the top N values for/per each statistic by user/group - the topN user/groups by each statistic

func NewAllStats

func NewAllStats(prefix string, n int) *AllStats

func (*AllStats) Finalize

func (s *AllStats) Finalize()

func (*AllStats) PushPerGroupStats

func (s *AllStats) PushPerGroupStats(prefix string, ug stats.PerIDTotals)

func (*AllStats) PushPerUserStats

func (s *AllStats) PushPerUserStats(prefix string, us stats.PerIDTotals)

func (*AllStats) Update

func (s *AllStats) Update(prefix string, pi prefixinfo.T, calc diskusage.Calculator, matcher boolexpr.Matcher) error

type Heaps

type Heaps[T comparable] struct {
	MaxN                          int
	Prefix                        string
	TotalBytes, TotalStorageBytes int64
	TotalFiles, TotalPrefixes     int64
	TotalPrefixBytes              int64
	TotalHardlinks                int64
	TotalHardlinkDirs             int64
	Bytes                         *heap.MinMax[int64, T]
	StorageBytes                  *heap.MinMax[int64, T]
	PrefixBytes                   *heap.MinMax[int64, T]
	Files                         *heap.MinMax[int64, T]
	Prefixes                      *heap.MinMax[int64, T]
}

Heaps is a collection of heap data structures for determining the top N values for a set of statistics and also for computing the total for those statistics. The Prefix refers to the root of the hierarchy for which the statistics are being computed.

func (*Heaps[T]) Merge

func (h *Heaps[T]) Merge(n int) map[T]MergedStats

func (*Heaps[T]) Push

func (h *Heaps[T]) Push(item T, bytes, storageBytes, prefixBytes, files, prefixes, children int64)

type MergedStats

type MergedStats struct {
	Prefix      string `json:"prefix,omitempty"`
	ID          int64  `json:"id,omitempty"`
	IDName      string `json:"name,omitempty"`
	Bytes       int64  `json:"bytes"`
	Storage     int64  `json:"storage,omitempty"`
	Files       int64  `json:"files"`
	Prefixes    int64  `json:"prefixes"`
	PrefixBytes int64  `json:"prefix_bytes"`
}

type PerIDStats

type PerIDStats struct {
	Prefix   string
	MaxN     int
	ByPrefix map[int64]*Heaps[string]
}

PerIDStats is a collection of statistics on a per user/group basis.

func (*PerIDStats) Push

func (s *PerIDStats) Push(id int64, prefix string, size, storageBytes, prefixBytes, files, prefixCount, children int64)

type Zipped

type Zipped[T comparable] struct {
	K int64
	V T
}

func ZipN

func ZipN[T comparable](h *heap.MinMax[int64, T], n int) (z []Zipped[T])

Jump to

Keyboard shortcuts

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