fix(cloudmon): oracle metric collect (#20052)

This commit is contained in:
屈轩
2024-04-18 11:32:53 +08:00
committed by GitHub
parent 48ef202cbe
commit 33348b2db3
2 changed files with 8 additions and 3 deletions

View File

@@ -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 {

View File

@@ -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