Skip to content

Commit

Permalink
fix(cloudmon): oracle metric collect (#20052)
Browse files Browse the repository at this point in the history
  • Loading branch information
ioito authored Apr 18, 2024
1 parent 48ef202 commit 33348b2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 3 additions & 2 deletions pkg/cloudmon/options/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ type CloudMonOptions struct {
HistoryMetricPullDays int `help:"pull history metrics" default:"-1"`
SupportAzureTableStorageMetric bool `help:"support collect azure memory and disk usage metric, there may be additional charges" default:"false"`

CloudAccountCollectMetricsBatchCount int `help:"Cloud Account Collect Metrics Batch Count" default:"10"`
CloudResourceCollectMetricsBatchCount int `help:"Cloud Resource Collect Metrics BatchC ount" default:"40"`
CloudAccountCollectMetricsBatchCount int `help:"Cloud Account Collect Metrics Batch Count" default:"10"`
CloudResourceCollectMetricsBatchCount int `help:"Cloud Resource Collect Metrics BatchC ount" default:"40"`
OracleCloudResourceCollectMetricsBatchCount int `help:"OracleCloud Resource Collect Metrics BatchC ount" default:"1"`
}

type PingProbeOptions struct {
Expand Down
6 changes: 5 additions & 1 deletion pkg/cloudmon/providerdriver/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,11 @@ func (self *SCollectByResourceIdDriver) CollectDBInstanceMetrics(ctx context.Con
}

func (self *SCollectByResourceIdDriver) CollectServerMetrics(ctx context.Context, manager api.CloudproviderDetails, provider cloudprovider.ICloudProvider, res map[string]api.ServerDetails, start, end time.Time) error {
ch := make(chan struct{}, options.Options.CloudResourceCollectMetricsBatchCount)
cnt := options.Options.CloudResourceCollectMetricsBatchCount
if manager.Provider == api.CLOUD_PROVIDER_ORACLE { // oracle 限速
cnt = options.Options.OracleCloudResourceCollectMetricsBatchCount
}
ch := make(chan struct{}, cnt)
defer close(ch)
metrics := []influxdb.SMetricData{}
var wg sync.WaitGroup
Expand Down

0 comments on commit 33348b2

Please sign in to comment.