You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

resourcePricing.go 822 B

12345678910111213141516171819202122232425262728293031323334
  1. package param
  2. import (
  3. "gitlink.org.cn/JointCloud/pcm-coordinator/internal/scheduler/algorithm/providerPricing"
  4. "strconv"
  5. )
  6. type ResourcePricingParams struct {
  7. Replicas int32
  8. task *providerPricing.Task
  9. *Params
  10. }
  11. func (r *ResourcePricingParams) GetReplicas() int32 {
  12. return r.Replicas
  13. }
  14. func (r *ResourcePricingParams) GetTask() *providerPricing.Task {
  15. return r.task
  16. }
  17. func (r *ResourcePricingParams) GetProviders() []*providerPricing.Provider {
  18. var providerList []*providerPricing.Provider
  19. for _, resource := range r.Resources {
  20. id, _ := strconv.ParseInt(resource.ClusterId, 10, 64)
  21. provider := providerPricing.NewProvider(
  22. id,
  23. float64(resource.CpuCoreAvail),
  24. resource.MemAvail,
  25. resource.DiskAvail, 0.0, 0.0, 0.0)
  26. providerList = append(providerList, provider)
  27. }
  28. return providerList
  29. }

PCM is positioned as Software stack over Cloud, aiming to build the standards and ecology of heterogeneous cloud collaboration for JCC in a non intrusive and autonomous peer-to-peer manner.