ronething commented on code in PR #2480:
URL: 
https://github.com/apache/apisix-ingress-controller/pull/2480#discussion_r2214724306


##########
internal/provider/adc/adc.go:
##########
@@ -380,24 +381,49 @@ func (d *adcClient) sync(ctx context.Context, task Task) 
error {
                return nil
        }
 
+       // Record file I/O duration
+       fileIOStart := time.Now()
        syncFilePath, cleanup, err := prepareSyncFile(task.Resources)
        if err != nil {
+               pkgmetrics.RecordFileIODuration("prepare_sync_file", "failure", 
time.Since(fileIOStart).Seconds())
                return err
        }
+       pkgmetrics.RecordFileIODuration("prepare_sync_file", "success", 
time.Since(fileIOStart).Seconds())
        defer cleanup()
 
        args := BuildADCExecuteArgs(syncFilePath, task.Labels, 
task.ResourceTypes)
 
        var errs types.ADCExecutionErrors
        for _, config := range task.configs {
-               if err := d.executor.Execute(ctx, d.BackendMode, config, args); 
err != nil {
+               // Record sync duration for each config
+               startTime := time.Now()
+               resourceType := strings.Join(task.ResourceTypes, ",")
+               if resourceType == "" {
+                       resourceType = "all"
+               }
+
+               err := d.executor.Execute(ctx, d.BackendMode, config, args)
+               duration := time.Since(startTime).Seconds()
+               log.Infof("synced %s in %f seconds, service list length: %d", 
config.Name, duration, len(task.Resources.Services))

Review Comment:
   i will remove it later. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to