Documentation
¶
Index ¶
- func PrepareCPUTimeSeriesChartData(processData map[int64][]*process.Process) (string, error)
- func PrepareCommandCategoriesExecutionTimeChartData(commands []*collector.Command) (string, error)
- func PrepareCommandsExecutionTimeChartData(commands []collector.Command) (string, error)
- func PrepareMemoryTimeSeriesChartData(processData map[int64][]*process.Process) (string, error)
- func PrepareProcessesResourceUsageChartData(processes []*process.Process) (string, error)
- func Serve()
- type ChartAxisOptions
- type ChartAxisTitle
- type ChartData
- type ChartDataData
- type ChartDataDataset
- type ChartLegendOptions
- type ChartOptions
- type ChartPlugins
- type ChartScales
- type ChartTimeOptions
- type ChartTooltipOptions
- type DataPoint
- type LegendLabelOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PrepareCPUTimeSeriesChartData ¶
PrepareCPUTimeSeriesChartData prepares the data for the CPU Time Series chart.
func PrepareCommandCategoriesExecutionTimeChartData ¶
PrepareCommandCategoriesExecutionTimeChartData prepares and returns the chart data for the command's execution time distribution.
func PrepareCommandsExecutionTimeChartData ¶
PrepareCommandsExecutionTimeChartData prepares and returns the chart data for the command's execution time distribution.
func PrepareMemoryTimeSeriesChartData ¶
PrepareMemoryTimeSeriesChartData prepares and returns the chart data for memory usage as a JSON string.
func PrepareProcessesResourceUsageChartData ¶
PrepareProcessesResourceUsageChartData prepares and returns the chart data for processes' resource usage.
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 ¶
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.