Esempio n. 1
0
func NewProvider(fs boshsys.FileSystem) (p provider) {
	runner := boshsys.ExecCmdRunner{}
	ubuntuDiskManager := boshdisk.NewUbuntuDiskManager(runner, fs)
	sigarStatsCollector := boshstats.NewSigarStatsCollector()

	p.platforms = map[string]Platform{
		"ubuntu": newUbuntuPlatform(sigarStatsCollector, fs, runner, ubuntuDiskManager),
		"dummy":  newDummyPlatform(),
	}
	return
}
Esempio n. 2
0
// There is a reason the runner is not injected.
// Other entities should not use a runner, they should go through the platform
func NewProvider(logger boshlog.Logger, dirProvider boshdirs.DirectoriesProvider) (p provider) {
	runner := boshsys.NewExecCmdRunner(logger)
	fs := boshsys.NewOsFileSystem(logger, runner)
	sigarStatsCollector := boshstats.NewSigarStatsCollector()
	ubuntuDiskManager := boshdisk.NewUbuntuDiskManager(logger, runner, fs)
	compressor := boshcmd.NewTarballCompressor(runner, fs)

	p.platforms = map[string]Platform{
		"ubuntu": newUbuntuPlatform(sigarStatsCollector, fs, runner, ubuntuDiskManager, compressor, dirProvider),
		"dummy":  newDummyPlatform(),
	}
	return
}
Esempio n. 3
0
func NewProvider(fs boshsys.FileSystem) (p provider) {
	// There is a reason the runner is not injected.
	// Other entities should not use a runner, they should go through the platform
	runner := boshsys.ExecCmdRunner{}

	ubuntuDiskManager := boshdisk.NewUbuntuDiskManager(runner, fs)
	sigarStatsCollector := boshstats.NewSigarStatsCollector()

	p.platforms = map[string]Platform{
		"ubuntu": newUbuntuPlatform(sigarStatsCollector, fs, runner, ubuntuDiskManager),
		"dummy":  newDummyPlatform(),
	}
	return
}
Esempio n. 4
0
// There is a reason the runner is not injected.
// Other entities should not use a runner, they should go through the platform
func NewProvider(logger boshlog.Logger, dirProvider boshdirs.DirectoriesProvider) (p provider) {
	runner := boshsys.NewExecCmdRunner(logger)
	fs := boshsys.NewOsFileSystem(logger, runner)
	sigarStatsCollector := boshstats.NewSigarStatsCollector()
	ubuntuDiskManager := boshdisk.NewUbuntuDiskManager(logger, runner, fs)
	centosDiskManager := boshdisk.NewCentosDiskManager(logger, runner, fs)

	p.platforms = map[string]Platform{
		"ubuntu": NewUbuntuPlatform(sigarStatsCollector, fs, runner, ubuntuDiskManager, dirProvider, 500*time.Millisecond, 10*time.Second, 3*time.Minute),
		"centos": NewCentosPlatform(sigarStatsCollector, fs, runner, centosDiskManager, dirProvider, 500*time.Millisecond, 10*time.Second, 3*time.Minute),
		"dummy":  NewDummyPlatform(sigarStatsCollector, fs, runner, dirProvider),
	}
	return
}
Esempio n. 5
0
func NewProvider(logger boshlog.Logger) (p provider) {
	fs := boshsys.NewOsFileSystem(logger)

	// There is a reason the runner is not injected.
	// Other entities should not use a runner, they should go through the platform
	runner := boshsys.NewExecCmdRunner(logger)
	sigarStatsCollector := boshstats.NewSigarStatsCollector()
	ubuntuDiskManager := boshdisk.NewUbuntuDiskManager(logger, runner, fs)
	compressor := boshdisk.NewTarballCompressor(runner, fs)

	p.platforms = map[string]Platform{
		"ubuntu": newUbuntuPlatform(sigarStatsCollector, fs, runner, ubuntuDiskManager, compressor),
		"dummy":  newDummyPlatform(),
	}
	return
}