collector

package
v0.10.2 Latest Latest
Warning

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

Go to latest
Published: May 11, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collector added in v0.10.2

type Collector struct {
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, target string, modules []string, apiKey string) *Collector

func (Collector) Collect added in v0.10.2

func (c Collector) Collect(ch chan<- prometheus.Metric)

Collect implements Prometheus.Collector.

func (Collector) Describe added in v0.10.2

func (c Collector) Describe(ch chan<- *prometheus.Desc)

Describe implements Prometheus.Collector.

type MoonrakerDirecotryInfoQueryResponse added in v0.3.0

type MoonrakerDirecotryInfoQueryResponse struct {
	Result struct {
		DiskUsage struct {
			Total int64 `json:"total"`
			Used  int64 `json:"used"`
			Free  int64 `json:"free"`
		} `json:"disk_usage"`
	} `json:"result"`
}

type MoonrakerHistoryCurrentPrintResponse added in v0.10.0

type MoonrakerHistoryCurrentPrintResponse struct {
	Result struct {
		Count int `json:"count"`
		Jobs  []struct {
			EndTime      float64 `json:"end_time"`
			FilamentUsed float64 `json:"filament_used"`
			Filename     string  `json:"filename"`
			Metadata     struct {
				Size             int     `json:"size"`
				Modified         float64 `json:"modified"`
				Slicer           string  `json:"slicer"`
				SlicerVersion    string  `json:"slicer_version"`
				LayerHeight      float64 `json:"layer_height"`
				FirstLayerHeight float64 `json:"first_layer_height"`
				ObjectHeight     float64 `json:"object_height"`
				FilamentTotal    float64 `json:"filament_total"`
				EstimatedTime    float64 `json:"estimated_time"`
				Thumbnails       []struct {
					Width        int    `json:"width"`
					Height       int    `json:"height"`
					Size         int    `json:"size"`
					RelativePath string `json:"relative_path"`
				} `json:"thumbnails"`
				FirstLayerBedTemp  float64 `json:"first_layer_bed_temp"`
				FirstLayerExtrTemp float64 `json:"first_layer_extr_temp"`
				GcodeStartByte     int     `json:"gcode_start_byte"`
				GcodeEndByte       int     `json:"gcode_end_byte"`
			} `json:"metadata"`
			PrintDuration float64 `json:"print_duration"`
			Status        string  `json:"status"`
			StartTime     float64 `json:"start_time"`
			TotalDuration float64 `json:"total_duration"`
			JobID         string  `json:"job_id"`
			Exists        bool    `json:"exists"`
		} `json:"jobs"`
	} `json:"result"`
}

type MoonrakerHistoryResponse added in v0.7.1

type MoonrakerHistoryResponse struct {
	Result struct {
		JobTotals struct {
			Jobs         int64   `json:"total_jobs"`
			TotalTime    float64 `json:"total_time"`
			PrintTime    float64 `json:"total_print_time"`
			FilamentUsed float64 `json:"total_filament_used"`
			LongestJob   float64 `json:"longest_job"`
			LongestPrint float64 `json:"longest_print"`
		} `json:"job_totals"`
	} `json:"result"`
}

type MoonrakerJobQueueResponse added in v0.3.0

type MoonrakerJobQueueResponse struct {
	Result struct {
		QueuedJobs []MoonrakerQueuedJob `json:"queued_jobs"`
		QueueState string               `json:"queue_state"`
	} `json:"result"`
}

type MoonrakerNetworkStats

type MoonrakerNetworkStats struct {
	RxBytes   int64   `json:"rx_bytes"`
	TxBytes   int64   `json:"tx_bytes"`
	RxPackets int64   `json:"rx_packets"`
	TxPackets int64   `json:"tx_packets"`
	RxErrs    int     `json:"rx_errs"`
	TxErrs    int     `json:"tx_errs"`
	RxDrop    int     `json:"rx_drop"`
	TxDrop    int     `json:"tx_drop"`
	Bandwidth float64 `json:"bandwidth"`
}

type MoonrakerProcStats

type MoonrakerProcStats struct {
	Time     float64 `json:"time"`
	CpuUsage float64 `json:"cpu_usage"`
	Memory   int     `json:"memory"`
	MemUnits string  `json:"mem_units"`
}

type MoonrakerProcessStatsQueryResponse

type MoonrakerProcessStatsQueryResponse struct {
	Result struct {
		MoonrakerStats       []MoonrakerProcStats             `json:"moonraker_stats"`
		CpuTemp              float64                          `json:"cpu_temp"`
		Network              map[string]MoonrakerNetworkStats `json:"network"`
		SystemCpuUsage       MoonrakerSystemCpuUsage          `json:"system_cpu_usage"`
		SystemMemory         MoonrakerSystemMemory            `json:"system_memory"`
		SystemUptime         float64                          `json:"system_uptime"`
		WebsocketConnections int                              `json:"websocket_connectsions"`
	} `json:"result"`
}

type MoonrakerQueuedJob added in v0.3.0

type MoonrakerQueuedJob struct {
	TimeInQueue float64 `json:"time_in_queue"`
}

type MoonrakerSystemCpuUsage

type MoonrakerSystemCpuUsage struct {
	Cpu  float64 `json:"cpu"`
	Cpu0 float64 `json:"cpu0"`
	Cpu1 float64 `json:"cpu1"`
	Cpu2 float64 `json:"cpu2"`
	Cpu3 float64 `json:"cpu3"`
}

type MoonrakerSystemInfoQueryResponse added in v0.3.0

type MoonrakerSystemInfoQueryResponse struct {
	Result struct {
		SystemInfo struct {
			CpuInfo struct {
				CpuCount    int    `json:"cpu_count"`
				TotalMemory int    `json:"total_memory"`
				MemoryUnits string `json:"memory_units"`
			} `json:"cpu_info"`
		} `json:"system_info"`
	} `json:"result"`
}

type MoonrakerSystemMemory

type MoonrakerSystemMemory struct {
	Total     int `json:"total"`
	Available int `json:"available"`
	Used      int `json:"used"`
}

type PrinterObjectDisplayStatus added in v0.5.0

type PrinterObjectDisplayStatus struct {
	Progress float64 `json:"progress"`
}

type PrinterObjectExtruder added in v0.4.0

type PrinterObjectExtruder struct {
	Temperature     float64 `json:"temperature"`
	Target          float64 `json:"target"`
	Power           float64 `json:"power"`
	PressureAdvance float64 `json:"pressure_advance"`
	SmoothTime      float64 `json:"smooth_time"`
}

type PrinterObjectFan added in v0.4.0

type PrinterObjectFan struct {
	Speed float64 `json:"speed"`
	Rpm   float64 `json:"rpm"`
}

type PrinterObjectGcodeMove added in v0.4.0

type PrinterObjectGcodeMove struct {
	SpeedFactor   float64   `json:"speed_factor"`
	Speed         float64   `json:"speed"`
	ExtrudeFactor float64   `json:"extrude_factor"`
	GcodePosition []float64 `json:"gcode_position"`
}

type PrinterObjectHeaterBed added in v0.4.0

type PrinterObjectHeaterBed struct {
	Temperature float64 `json:"temperature"`
	Target      float64 `json:"target"`
	Power       float64 `json:"power"`
}

type PrinterObjectIdleTimeout added in v0.5.0

type PrinterObjectIdleTimeout struct {
	State        string  `json:"state"`
	PrintingTime float64 `json:"printing_time"`
}

type PrinterObjectMcu added in v0.9.0

type PrinterObjectMcu struct {
	LastStats struct {
		McuAwake float64 `json:"mcu_awake"`
		// McuTaskAvg float64 `json:"mcu_task_avg"` // value returned in the format 1.5e-05
		// McuTaskStddev float64 `json:"mcu_task_stddev"` // value returned in the formate 1e-05
		BytesWrite      float64 `json:"bytes_write"`
		BytesRead       float64 `json:"bytes_read"`
		BytesRetransmit float64 `json:"bytes_retransmit"`
		BytesInvalid    float64 `json:"bytes_invalid"`
		SendSeq         float64 `json:"send_seq"`
		ReceiveSeq      float64 `json:"receive_seq"`
		RetransmitSeq   float64 `json:"retransmit_seq"`
		Srtt            float64 `json:"srtt"`
		Rttvar          float64 `json:"rttvar"`
		Rto             float64 `json:"rto"`
		ReadyBytes      float64 `json:"ready_bytes"`
		StalledBytes    float64 `json:"stalled_bytes"`
		Freq            float64 `json:"freq"`
	} `json:"last_stats"`
}

type PrinterObjectOutputPin added in v0.6.0

type PrinterObjectOutputPin struct {
	Value float64 `mapstructure:"value"`
}

type PrinterObjectPrintStats added in v0.5.0

type PrinterObjectPrintStats struct {
	TotalDuration float64 `json:"total_duration"`
	PrintDuration float64 `json:"print_duration"`
	FilamentUsed  float64 `json:"filament_used"`
}

type PrinterObjectResponse added in v0.6.0

type PrinterObjectResponse struct {
	Result struct {
		Status PrinterObjectStatus `json:"status"`
	} `json:"result"`
}

type PrinterObjectStatus added in v0.6.0

type PrinterObjectStatus struct {
	GcodeMove     PrinterObjectGcodeMove     `json:"gcode_move"`
	Toolhead      PrinterObjectToolhead      `json:"toolhead"`
	Extruder      PrinterObjectExtruder      `json:"extruder"`
	HeaterBed     PrinterObjectHeaterBed     `json:"heater_bed"`
	Fan           PrinterObjectFan           `json:"fan"`
	IdleTimeout   PrinterObjectIdleTimeout   `json:"idle_timeout"`
	VirtualSdCard PrinterObjectVirtualSdCard `json:"virtual_sdcard"`
	PrintStats    PrinterObjectPrintStats    `json:"print_stats"`
	DisplayStatus PrinterObjectDisplayStatus `json:"display_status"`
	Mcu           PrinterObjectMcu           `json:"mcu"`
	// dynamic sensor attributes populated using custom unmarsaling
	TemperatureSensors map[string]PrinterObjectTemperatureSensor
	TemperatureFans    map[string]PrinterObjectTemperatureFan
	OutputPins         map[string]PrinterObjectOutputPin
}

func (*PrinterObjectStatus) UnmarshalJSON added in v0.6.0

func (f *PrinterObjectStatus) UnmarshalJSON(bs []byte) (err error)

type PrinterObjectTemperatureFan added in v0.6.0

type PrinterObjectTemperatureFan struct {
	Speed       float64 `mapstructure:"speed"`
	Temperature float64 `mapstructure:"temperature"`
	Target      float64 `mapstructure:"target"`
}

type PrinterObjectTemperatureSensor added in v0.6.0

type PrinterObjectTemperatureSensor struct {
	Temperature     float64 `mapstructure:"temperature"`
	MeasuredMinTemp float64 `mapstructure:"measured_min_temp"`
	MeasuredMaxTemp float64 `mapstructure:"measured_max_temp"`
}

type PrinterObjectToolhead added in v0.4.0

type PrinterObjectToolhead struct {
	PrintTime            float64 `json:"print_time"`
	EstimatedPrintTime   float64 `json:"estimated_print_time"`
	MaxVelocity          float64 `json:"max_velocity"`
	MaxAccel             float64 `json:"max_accel"`
	MaxAccelToDecel      float64 `json:"max_accel_to_decel"`
	SquareCornerVelocity float64 `json:"square_corner_velocity"`
}

type PrinterObjectVirtualSdCard added in v0.5.0

type PrinterObjectVirtualSdCard struct {
	Progress     float64 `json:"progress"`
	IsActive     bool    `json:"is_active"`
	FilePosition float64 `json:"file_position"`
}

type PrinterObjectsList added in v0.6.0

type PrinterObjectsList struct {
	Result struct {
		Objects []string `json:"objects"`
	} `json:"result"`
}

type TemperatureDataQueryResponse added in v0.4.0

type TemperatureDataQueryResponse struct {
	Result map[string]interface{} `json:"result"`
}

Jump to

Keyboard shortcuts

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