Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 11 for SinceInSeconds (0.36 sec)

  1. staging/src/k8s.io/apiserver/pkg/storage/etcd3/metrics/metrics.go

    }
    
    // Reset resets the etcd_request_duration_seconds metric.
    func Reset() {
    	etcdRequestLatency.Reset()
    }
    
    // sinceInSeconds gets the time since the specified start in seconds.
    //
    // This is a variable to facilitate testing.
    var sinceInSeconds = func(start time.Time) float64 {
    	return time.Since(start).Seconds()
    }
    
    // UpdateEtcdDbSize sets the etcd_db_total_size_in_bytes metric.
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Apr 11 21:15:32 UTC 2024
    - 11K bytes
    - Viewed (0)
  2. pkg/kubelet/kuberuntime/instrumented_services.go

    func recordOperation(operation string, start time.Time) {
    	metrics.RuntimeOperations.WithLabelValues(operation).Inc()
    	metrics.RuntimeOperationsDuration.WithLabelValues(operation).Observe(metrics.SinceInSeconds(start))
    }
    
    // recordError records error for metric if an error occurred.
    func recordError(operation string, err error) {
    	if err != nil {
    		metrics.RuntimeOperationsErrors.WithLabelValues(operation).Inc()
    	}
    }
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Mar 07 10:46:06 UTC 2024
    - 13.1K bytes
    - Viewed (0)
  3. pkg/scheduler/schedule_one.go

    	metrics.PodScheduled(fwk.ProfileName(), metrics.SinceInSeconds(start))
    	metrics.PodSchedulingAttempts.Observe(float64(assumedPodInfo.Attempts))
    	if assumedPodInfo.InitialAttemptTimestamp != nil {
    		metrics.PodSchedulingDuration.WithLabelValues(getAttemptsLabel(assumedPodInfo)).Observe(metrics.SinceInSeconds(*assumedPodInfo.InitialAttemptTimestamp))
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Jun 06 13:28:08 UTC 2024
    - 43.4K bytes
    - Viewed (0)
  4. pkg/proxy/metrics/metrics.go

    		case kubeproxyconfig.ProxyModeKernelspace:
    			// currently no winkernel-specific metrics
    		}
    	})
    }
    
    // SinceInSeconds gets the time since the specified start in seconds.
    func SinceInSeconds(start time.Time) float64 {
    	return time.Since(start).Seconds()
    }
    
    var _ metrics.StableCollector = &nfacctMetricCollector{}
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue May 21 14:39:54 UTC 2024
    - 13.7K bytes
    - Viewed (0)
  5. pkg/scheduler/metrics/metrics.go

    // GatedPods returns the pending pods metrics with the label gated
    func GatedPods() metrics.GaugeMetric {
    	return pendingPods.With(metrics.Labels{"queue": "gated"})
    }
    
    // SinceInSeconds gets the time since the specified start in seconds.
    func SinceInSeconds(start time.Time) float64 {
    	return time.Since(start).Seconds()
    }
    
    func UnschedulableReason(plugin string, profile string) metrics.GaugeMetric {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sat Apr 27 08:22:53 UTC 2024
    - 11.1K bytes
    - Viewed (0)
  6. staging/src/k8s.io/apiserver/pkg/storage/etcd3/metrics/metrics_test.go

    				t.Fatal(err)
    			}
    		})
    	}
    }
    
    func TestRecordEtcdRequest(t *testing.T) {
    	registry := metrics.NewKubeRegistry()
    
    	// modify default sinceInSeconds to constant NOW
    	sinceInSeconds = func(t time.Time) float64 {
    		return time.Unix(0, 300*int64(time.Millisecond)).Sub(t).Seconds()
    	}
    
    	testedMetrics := []metrics.Registerable{
    		etcdRequestCounts,
    		etcdRequestErrorCounts,
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Apr 11 21:15:32 UTC 2024
    - 10.2K bytes
    - Viewed (0)
  7. pkg/kubelet/pleg/generic.go

    	if lastRelistTime := g.getRelistTime(); !lastRelistTime.IsZero() {
    		metrics.PLEGRelistInterval.Observe(metrics.SinceInSeconds(lastRelistTime))
    	}
    
    	timestamp := g.clock.Now()
    	defer func() {
    		metrics.PLEGRelistDuration.Observe(metrics.SinceInSeconds(timestamp))
    	}()
    
    	// Get all the pods.
    	podList, err := g.runtime.GetPods(ctx, true)
    	if err != nil {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Jun 04 06:25:43 UTC 2024
    - 19.3K bytes
    - Viewed (0)
  8. pkg/kubelet/metrics/metrics.go

    // GetGather returns the gatherer. It used by test case outside current package.
    func GetGather() metrics.Gatherer {
    	return legacyregistry.DefaultGatherer
    }
    
    // SinceInSeconds gets the time since the specified start in seconds.
    func SinceInSeconds(start time.Time) float64 {
    	return time.Since(start).Seconds()
    }
    
    // SetNodeName sets the NodeName Gauge to 1.
    func SetNodeName(name types.NodeName) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Feb 22 15:13:25 UTC 2024
    - 45.6K bytes
    - Viewed (0)
  9. pkg/kubelet/eviction/eviction_manager.go

    	for _, t := range thresholds {
    		timeObserved := observations[t.Signal].time
    		if !timeObserved.IsZero() {
    			metrics.EvictionStatsAge.WithLabelValues(string(t.Signal)).Observe(metrics.SinceInSeconds(timeObserved.Time))
    		}
    	}
    
    	// we kill at most a single pod during each eviction interval
    	for i := range activePods {
    		pod := activePods[i]
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Mar 27 18:55:56 UTC 2024
    - 24.6K bytes
    - Viewed (0)
  10. pkg/kubelet/server/server.go

    	startTime := time.Now()
    	defer servermetrics.HTTPRequestsDuration.WithLabelValues(method, path, serverType, longRunning).Observe(servermetrics.SinceInSeconds(startTime))
    
    	handler.ServeHTTP(w, req)
    }
    
    // prometheusHostAdapter adapts the HostInterface to the interface expected by the
    // cAdvisor prometheus collector.
    type prometheusHostAdapter struct {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Jun 04 06:25:43 UTC 2024
    - 40.1K bytes
    - Viewed (0)
Back to top