Skip to content

Commit

Permalink
Add CloudProvider to the MeasurementConfig.
Browse files Browse the repository at this point in the history
  • Loading branch information
mm4tt committed Apr 16, 2019
1 parent 477754e commit 80b2c5d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ func createConfig(config *measurement.MeasurementConfig, overrides map[string]in
PrometheusFramework: config.PrometheusFramework,
Params: params,
TemplateProvider: config.TemplateProvider,
CloudProvider: config.CloudProvider,
}
}

Expand Down
4 changes: 2 additions & 2 deletions clusterloader2/pkg/measurement/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ type MeasurementConfig struct {
// TemplateProvider provides templated objects.
TemplateProvider *config.TemplateProvider
// Identifier identifies this instance of measurement.
Identifier string
// TODO(krzysied): add CloudProvider.
Identifier string
CloudProvider string
}

// Measurement is an common interface for all measurements methods. It should be implemented by the user to
Expand Down
5 changes: 4 additions & 1 deletion clusterloader2/pkg/measurement/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
// MeasurementManager manages all measurement executions.
type MeasurementManager struct {
clusterFramework *framework.Framework
clusterLoaderConfig *config.ClusterLoaderConfig
prometheusFramework *framework.Framework
templateProvider *config.TemplateProvider

Expand All @@ -37,9 +38,10 @@ type MeasurementManager struct {

// CreateMeasurementManager creates new instance of MeasurementManager.
func CreateMeasurementManager(clusterFramework, prometheusFramework *framework.Framework,
templateProvider *config.TemplateProvider) *MeasurementManager {
templateProvider *config.TemplateProvider, config *config.ClusterLoaderConfig) *MeasurementManager {
return &MeasurementManager{
clusterFramework: clusterFramework,
clusterLoaderConfig: config,
prometheusFramework: prometheusFramework,
templateProvider: templateProvider,
measurements: make(map[string]map[string]Measurement),
Expand All @@ -59,6 +61,7 @@ func (mm *MeasurementManager) Execute(methodName string, identifier string, para
Params: params,
TemplateProvider: mm.templateProvider,
Identifier: identifier,
CloudProvider: mm.clusterLoaderConfig.ClusterConfig.Provider,
}
summaries, err := measurementInstance.Execute(config)
mm.summaries = append(mm.summaries, summaries...)
Expand Down
2 changes: 1 addition & 1 deletion clusterloader2/pkg/test/simple_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func createSimpleContext(c *config.ClusterLoaderConfig, f, p *framework.Framewor
state: s,
templateProvider: templateProvider,
tuningSetFactory: tuningset.NewTuningSetFactory(),
measurementManager: measurement.CreateMeasurementManager(f, p, templateProvider),
measurementManager: measurement.CreateMeasurementManager(f, p, templateProvider, c),
chaosMonkey: chaos.NewMonkey(f.GetClientSets().GetClient(), c.ClusterConfig.Provider),
}
}
Expand Down

0 comments on commit 80b2c5d

Please sign in to comment.