resources

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrepareCPUTimeSeriesChartData

func PrepareCPUTimeSeriesChartData(processData map[int64][]*process.Process) (string, error)

PrepareCPUTimeSeriesChartData prepares the data for the CPU Time Series chart.

func PrepareCommandCategoriesExecutionTimeChartData

func PrepareCommandCategoriesExecutionTimeChartData(commands []*collector.Command) (string, error)

PrepareCommandCategoriesExecutionTimeChartData prepares and returns the chart data for the command's execution time distribution.

func PrepareCommandsExecutionTimeChartData

func PrepareCommandsExecutionTimeChartData(commands []collector.Command) (string, error)

PrepareCommandsExecutionTimeChartData prepares and returns the chart data for the command's execution time distribution.

func PrepareMemoryTimeSeriesChartData

func PrepareMemoryTimeSeriesChartData(processData map[int64][]*process.Process) (string, error)

PrepareMemoryTimeSeriesChartData prepares and returns the chart data for memory usage as a JSON string.

func PrepareProcessesResourceUsageChartData

func PrepareProcessesResourceUsageChartData(processes []*process.Process) (string, error)

PrepareProcessesResourceUsageChartData prepares and returns the chart data for processes' resource usage.

func Serve

func Serve()

Serve registers the HTTP handlers for the application

Types

type ChartAxisOptions

type ChartAxisOptions struct {
	Type        string            `json:"type,omitempty"`
	Position    string            `json:"position,omitempty"`
	Time        *ChartTimeOptions `json:"time,omitempty"`
	Title       *ChartAxisTitle   `json:"title,omitempty"`
	BeginAtZero bool              `json:"beginAtZero"`
}

ChartAxisOptions represents configuration options for a single axis in the chart.

type ChartAxisTitle

type ChartAxisTitle struct {
	Display bool   `json:"display"`
	Text    string `json:"text"`
}

ChartAxisTitle defines the title for an axis, including whether it is displayed.

type ChartData

type ChartData struct {
	Type    string        `json:"type"`
	Data    ChartDataData `json:"data"`
	Options ChartOptions  `json:"options"`
}

ChartData represents the overall structure for a Chart.js chart configuration.

type ChartDataData

type ChartDataData struct {
	Ids      []int              `json:"ids"`
	Datasets []ChartDataDataset `json:"datasets"`
	Labels   []string           `json:"labels,omitempty"`
}

ChartDataData holds the datasets and labels for the chart.

type ChartDataDataset

type ChartDataDataset struct {
	Label           string      `json:"label"`
	Data            interface{} `json:"data"`
	BackgroundColor string      `json:"backgroundColor,omitempty"`
	BorderColor     string      `json:"borderColor,omitempty"`
	Fill            bool        `json:"fill"`
	Tension         float64     `json:"tension,omitempty"`
	PointStyle      string      `json:"pointStyle,omitempty"`
	PointRadius     interface{} `json:"pointRadius,omitempty"` // Can be a static value or an array
	BorderWidth     int         `json:"borderWidth,omitempty"`
}

ChartDataDataset represents a dataset within a Chart.js chart, including its data points and styling.

type ChartLegendOptions

type ChartLegendOptions struct {
	Display  bool                `json:"display"`
	Position string              `json:"position,omitempty"`
	Align    string              `json:"align,omitempty"`
	Label    *LegendLabelOptions `json:"labels,omitempty"`
}

ChartLegendOptions configures the chart's legend.

type ChartOptions

type ChartOptions struct {
	Scales              *ChartScales  `json:"scales,omitempty"`
	Plugins             *ChartPlugins `json:"plugins,omitempty"`
	MaintainAspectRatio bool          `json:"maintainAspectRatio"`
	Responsive          bool          `json:"responsive"`
	AspectRatio         int           `json:"aspectRatio,omitempty"`
}

ChartOptions encapsulates all configuration options for the chart, such as scales and plugins.

type ChartPlugins

type ChartPlugins struct {
	Legend  *ChartLegendOptions  `json:"legend,omitempty"`
	Tooltip *ChartTooltipOptions `json:"tooltip,omitempty"`
}

ChartPlugins allows for the configuration of various Chart.js plugins, such as legends and tooltips.

type ChartScales

type ChartScales struct {
	XAxes ChartAxisOptions `json:"x,omitempty"`
	YAxes ChartAxisOptions `json:"y,omitempty"`
}

ChartScales defines the axes of the chart, including their types and specific configurations.

type ChartTimeOptions

type ChartTimeOptions struct {
	Unit string `json:"unit,omitempty"`
}

ChartTimeOptions is used for axes that represent time, allowing for the specification of time units and formats.

type ChartTooltipOptions

type ChartTooltipOptions struct {
	Enabled bool `json:"enabled"`
}

ChartTooltipOptions configures the chart's tooltips.

type DataPoint

type DataPoint struct {
	X           interface{} `json:"x"` // Can be a string or numeric type, depending on the chart type
	Y           interface{} `json:"y"` // Can be a string or numeric type, depending on the chart type
	ProcessName string      `json:"processName,omitempty"`
	R           float64     `json:"r,omitempty"`
}

DataPoint represents an individual data point in the dataset, used for charts that plot points on axes.

type LegendLabelOptions

type LegendLabelOptions struct {
	BoxWidth  int    `json:"boxWidth"`
	BoxHeight int    `json:"boxHeight"`
	Color     string `json:"color"`
	Padding   int    `json:"padding"`
}

LegendLabelOptions configures the chart's legend label.

Jump to

Keyboard shortcuts

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