timescale

package
v0.0.0-...-0335673 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Timescale

type Timescale struct {
	Conn    *pgx.Conn
	Timeout time.Duration
}

Timescale struct to manage the database connection and settings

func New

func New(url string, timeout time.Duration) (*Timescale, error)

New initializes a new TimescaleDB connection

func (*Timescale) BenchmarkRead

func (t *Timescale) BenchmarkRead(queries int)

BenchmarkRead executes multiple queries to benchmark the read speed.

func (*Timescale) BenchmarkWrite

func (t *Timescale) BenchmarkWrite(dataPoints, sensorsAmount float32)

BenchmarkWrite inserts data into the TimescaleDB using multiple goroutines.

func (*Timescale) Close

func (t *Timescale) Close()

Close closes the TimescaleDB connection.

func (*Timescale) WritePoints

func (t *Timescale) WritePoints(dataPoints int, sensorID int)

WritePoints inserts multiple data points for a given sensor.

Jump to

Keyboard shortcuts

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