Documentation
¶
Index ¶
- func NewStorage(clusters Clusters, workerPool pool.ObjectPool) storage.Storage
- type AggregatedClusterNamespaceDefinition
- type ClusterNamespace
- type ClusterNamespaces
- type ClusterStaticConfiguration
- type ClusterStaticNamespaceConfiguration
- type Clusters
- type ClustersStaticConfiguration
- type ClustersStaticConfigurationOptions
- type NewClientFromConfig
- type RetentionResolution
- type UnaggregatedClusterNamespaceDefinition
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewStorage ¶
func NewStorage(clusters Clusters, workerPool pool.ObjectPool) storage.Storage
NewStorage creates a new local Storage instance.
Types ¶
type AggregatedClusterNamespaceDefinition ¶
type AggregatedClusterNamespaceDefinition struct {
NamespaceID ident.ID
Session client.Session
Retention time.Duration
Resolution time.Duration
}
AggregatedClusterNamespaceDefinition is a definition for a cluster namespace that holds aggregated metrics data at a specific retention and resolution.
func (AggregatedClusterNamespaceDefinition) Validate ¶
func (def AggregatedClusterNamespaceDefinition) Validate() error
Validate validates the cluster namespace definition.
type ClusterNamespace ¶
type ClusterNamespace interface {
NamespaceID() ident.ID
Attributes() storage.Attributes
Session() client.Session
}
ClusterNamespace is a local storage cluster namespace.
type ClusterNamespaces ¶
type ClusterNamespaces []ClusterNamespace
ClusterNamespaces is a slice of ClusterNamespace instances.
func (ClusterNamespaces) NumAggregatedClusterNamespaces ¶
func (n ClusterNamespaces) NumAggregatedClusterNamespaces() int
NumAggregatedClusterNamespaces returns the number of aggregated cluster namespaces.
type ClusterStaticConfiguration ¶
type ClusterStaticConfiguration struct {
NewClientFromConfig NewClientFromConfig
Namespaces []ClusterStaticNamespaceConfiguration `yaml:"namespaces"`
Client client.Configuration `yaml:"client"`
}
ClusterStaticConfiguration is a static cluster configuration.
type ClusterStaticNamespaceConfiguration ¶
type ClusterStaticNamespaceConfiguration struct {
Namespace string `yaml:"namespace"`
StorageMetricsType storage.MetricsType `yaml:"storageMetricsType"`
Retention time.Duration `yaml:"retention" validate:"nonzero"`
Resolution time.Duration `yaml:"resolution" validate:"min=0"`
}
ClusterStaticNamespaceConfiguration describes the namespaces in a static cluster.
type Clusters ¶
type Clusters interface {
io.Closer
// ClusterNamespaces returns all known cluster namespaces.
ClusterNamespaces() ClusterNamespaces
// UnaggregatedClusterNamespace returns the valid unaggregated
// cluster namespace.
UnaggregatedClusterNamespace() ClusterNamespace
// AggregatedClusterNamespace returns an aggregated cluster namespace
// at a specific retention and resolution.
AggregatedClusterNamespace(attrs RetentionResolution) (ClusterNamespace, bool)
}
Clusters is a flattened collection of local storage clusters and namespaces.
func NewClusters ¶
func NewClusters( unaggregatedClusterNamespace UnaggregatedClusterNamespaceDefinition, aggregatedClusterNamespaces ...AggregatedClusterNamespaceDefinition, ) (Clusters, error)
NewClusters instantiates a new Clusters instance.
type ClustersStaticConfiguration ¶
type ClustersStaticConfiguration []ClusterStaticConfiguration
ClustersStaticConfiguration is a set of static cluster configurations.
func (ClustersStaticConfiguration) NewClusters ¶
func (c ClustersStaticConfiguration) NewClusters( opts ClustersStaticConfigurationOptions, ) (Clusters, error)
NewClusters instantiates a new Clusters instance.
type ClustersStaticConfigurationOptions ¶
type ClustersStaticConfigurationOptions struct {
AsyncSessions bool
}
ClustersStaticConfigurationOptions are options to use when constructing clusters from config.
type NewClientFromConfig ¶
type NewClientFromConfig func( cfg client.Configuration, params client.ConfigurationParameters, custom ...client.CustomOption, ) (client.Client, error)
NewClientFromConfig is a method that can be set on ClusterStaticConfiguration to allow overriding the client initialization.
type RetentionResolution ¶
RetentionResolution is a tuple of retention and resolution that describes an aggregated metrics policy.
type UnaggregatedClusterNamespaceDefinition ¶
type UnaggregatedClusterNamespaceDefinition struct {
NamespaceID ident.ID
Session client.Session
Retention time.Duration
}
UnaggregatedClusterNamespaceDefinition is the definition for the cluster namespace that holds unaggregated metrics data.
func (UnaggregatedClusterNamespaceDefinition) Validate ¶
func (def UnaggregatedClusterNamespaceDefinition) Validate() error
Validate will validate the cluster namespace definition.