db

package
v0.0.0-...-4785ff0 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2018 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigDB

type ConfigDB struct {
	Url                          string
	User                         string
	Password                     string
	Database                     string
	ApplicationsCollection       string
	BenchmarksCollection         string
	DeploymentCollection         string
	NodeTypeCollection           string
	PreviousGenerationCollection string
}

func NewConfigDB

func NewConfigDB(config *viper.Viper) *ConfigDB

func (*ConfigDB) GetApplicationConfig

func (configDb *ConfigDB) GetApplicationConfig(name string) (*models.ApplicationConfig, error)

func (*ConfigDB) GetBenchmarks

func (configDb *ConfigDB) GetBenchmarks() ([]models.Benchmark, error)

func (*ConfigDB) GetDeploymentConfig

func (configDb *ConfigDB) GetDeploymentConfig(name string) (*deployer.Deployment, error)

func (*ConfigDB) GetNodeTypeConfig

func (configDb *ConfigDB) GetNodeTypeConfig(region string) (*models.AWSRegionNodeTypeConfig, error)

func (*ConfigDB) GetPreviousGenerationConfig

func (configDb *ConfigDB) GetPreviousGenerationConfig(region string) (*models.AWSRegionNodeTypeConfig, error)

type MetricsDB

type MetricsDB struct {
	Url                   string
	User                  string
	Password              string
	Database              string
	CalibrationCollection string
	ProfilingCollection   string
	SizingCollection      string
	AllInstanceCollection string
}

func NewMetricsDB

func NewMetricsDB(config *viper.Viper) *MetricsDB

func (*MetricsDB) GetMetric

func (metricsDb *MetricsDB) GetMetric(dataType string, appName string, metric interface{}) (interface{}, error)

TODO: Need to support use of filter when one collection contains multiple documents

func (*MetricsDB) UpsertMetrics

func (metricsDb *MetricsDB) UpsertMetrics(dataType string, appName string, obj interface{}) error

func (*MetricsDB) WriteMetrics

func (metricsDb *MetricsDB) WriteMetrics(dataType string, obj interface{}) error

Jump to

Keyboard shortcuts

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