dataset

package
v0.0.0-...-6ee8545 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

This file and its contents are licensed under the Apache License 2.0. Please see the included NOTICE for copyright information and LICENSE for a copy of the license. +k8s:deepcopy-gen=package

Promscale stores some configuration information in the Postgres database which it is connected to. We call this configuration the Promscale dataset configuration.

The dataset configuration handles config items like retention period, chunk interval, compression, etc. This config options are applied on startup as SQL queries. For more context review the `/docs/dataset.md` page and the `dataset/config.go` file.

+k8s:deepcopy-gen=package

This file and its contents are licensed under the Apache License 2.0. Please see the included NOTICE for copyright information and LICENSE for a copy of the license.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StringToDayDurationHookFunc

func StringToDayDurationHookFunc() mapstructure.DecodeHookFunc

StringToDayDurationHookFunc returns a mapstructure.DecodeHookFunc that converts strings to DayDuration.

Types

type Config

type Config struct {
	Metrics
	Traces
}

Config represents a dataset config.

func NewConfig

func NewConfig(contents string) (cfg Config, err error)

NewConfig creates a new dataset config based on the configuration YAML contents.

func (*Config) Apply

func (c *Config) Apply(conn *pgx.Conn) error

Apply applies the configuration to the database via the supplied DB connection.

func (*Config) DeepCopy

func (in *Config) DeepCopy() *Config

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Config.

func (*Config) DeepCopyInto

func (in *Config) DeepCopyInto(out *Config)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type DayDuration

type DayDuration time.Duration

DayDuration acts like a time.Duration with support for "d" unit which is used for specifying number of days in duration.

func (DayDuration) String

func (d DayDuration) String() string

String returns a string value of DayDuration.

func (*DayDuration) UnmarshalText

func (d *DayDuration) UnmarshalText(s []byte) error

UnmarshalText unmarshals strings into DayDuration values while handling the day unit. It leans heavily into time.ParseDuration.

type Metrics

type Metrics struct {
	ChunkInterval   DayDuration `mapstructure:"default_chunk_interval" yaml:"default_chunk_interval"`
	Compression     *bool       `mapstructure:"compress_data" yaml:"compress_data"` // Using pointer to check if the the value was set.
	HALeaseRefresh  DayDuration `mapstructure:"ha_lease_refresh" yaml:"ha_lease_refresh"`
	HALeaseTimeout  DayDuration `mapstructure:"ha_lease_timeout" yaml:"ha_lease_timeout"`
	RetentionPeriod DayDuration `mapstructure:"default_retention_period" yaml:"default_retention_period"`
}

Metrics contains dataset configuration options for metrics data.

func (*Metrics) DeepCopy

func (in *Metrics) DeepCopy() *Metrics

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Metrics.

func (*Metrics) DeepCopyInto

func (in *Metrics) DeepCopyInto(out *Metrics)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Traces

type Traces struct {
	RetentionPeriod DayDuration `mapstructure:"default_retention_period" yaml:"default_retention_period"`
}

Traces contains dataset configuration options for traces data.

func (*Traces) DeepCopy

func (in *Traces) DeepCopy() *Traces

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Traces.

func (*Traces) DeepCopyInto

func (in *Traces) DeepCopyInto(out *Traces)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Jump to

Keyboard shortcuts

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