@@ -316,21 +316,16 @@ These correspond to some fields of the [ContainerStats](#summary-container-stats
316316= // The amount of working set memory in bytes.
317317+ // Corresponds to Stats Summary API MemoryStats WorkingSetBytes field
318318= UInt64Value working_set_bytes = 2;
319- + // Available memory for use. This is defined as the memory limit = workingSetBytes.
320- + // If memory limit is undefined, the available bytes is omitted.
319+ + // Available memory for use. This is defined as the memory limit - workingSetBytes.
321320+ UInt64Value available_bytes = 3;
322321+ // Total memory in use. This includes all memory regardless of when it was accessed.
323- + UInt64Value usage_bytes
324- + // The amount of working set memory. This includes recently accessed memory,
325- + // dirty memory, and kernel memory. WorkingSetBytes is <= UsageBytes
326- + UInt64Value working_set_bytes = 4;
327- + // The amount of anonymous and swap cache memory (includes transparent
328- + // hugepages).
322+ + UInt64Value usage_bytes = 4;
323+ + // The amount of anonymous and swap cache memory (includes transparent hugepages).
329324+ UInt64Value rss_bytes = 5;
330325+ // Cumulative number of minor page faults.
331- + Uint64Value page_faults = 6;
326+ + UInt64Value page_faults = 6;
332327+ // Cumulative number of major page faults.
333- + Uint64Value major_page_faults = 6 ;
328+ + UInt64Value major_page_faults = 7 ;
334329=}
335330```
336331
@@ -353,49 +348,45 @@ They will be defined as follows:
353348// Runtime service defines the public APIs for remote pod runtimes
354349service RuntimeService {
355350 ...
356- // PodSandboxStats returns stats of the pod. If the pod does not
351+ // PodSandboxStats returns stats of the pod. If the pod sandbox does not
357352 // exist, the call returns an error.
358353 rpc PodSandboxStats(PodSandboxStatsRequest) returns (PodSandboxStatsResponse) {}
359- // ListPodSandboxStats returns stats of all running pods.
354+ // ListPodSandboxStats returns stats of the pods matching a filter .
360355 rpc ListPodSandboxStats(ListPodSandboxStatsRequest) returns (ListPodSandboxStatsResponse) {}
361356 ...
362357}
363358...
364-
365- message PodSandboxStatsRequest{
366- // ID of the pod for which to retrieve stats.
367- string pod_id = 1;
359+ message PodSandboxStatsRequest {
360+ // ID of the pod sandbox for which to retrieve stats.
361+ string pod_sandbox_id = 1;
368362}
369363
370364message PodSandboxStatsResponse {
371- // Stats of the pod.
372365 PodSandboxStats stats = 1;
373366}
374367
375-
376- // PodSandboxStatsFilter is used to filter containers.
377- // All those fields are combined with 'AND'
368+ // PodSandboxStatsFilter is used to filter the list of pod sandboxes to retrieve stats for.
369+ // All those fields are combined with 'AND'.
378370message PodSandboxStatsFilter {
379- // ID of the container .
371+ // ID of the pod sandbox .
380372 string id = 1;
381373 // LabelSelector to select matches.
382374 // Only api.MatchLabels is supported for now and the requirements
383375 // are ANDed. MatchExpressions is not supported yet.
384376 map<string, string> label_selector = 2;
385377}
386378
387- message ListPodSandboxStatsRequest{
379+ message ListPodSandboxStatsRequest {
388380 // Filter for the list request.
389381 PodSandboxStatsFilter filter = 1;
390382}
391383
392384message ListPodSandboxStatsResponse {
393- // Stats of the pod.
385+ // Stats of the pod sandbox .
394386 repeated PodSandboxStats stats = 1;
395387}
396388
397-
398- // PodSandboxAttributes provides basic information of the container.
389+ // PodSandboxAttributes provides basic information of the pod sandbox.
399390message PodSandboxAttributes {
400391 // ID of the pod.
401392 string id = 1;
@@ -421,53 +412,55 @@ message PodSandboxStats {
421412 WindowsPodSandboxStats windows = 3;
422413}
423414
424- // LinuxPodSandboxStats provides the resource usage statistics for a pod on linux
415+ // LinuxPodSandboxStats provides the resource usage statistics for a pod sandbox on linux.
425416message LinuxPodSandboxStats {
426- // CPU usage gathered from the pod.
417+ // CPU usage gathered for the pod sandbox .
427418 CpuUsage cpu = 1;
428- // Memory usage gathered from the pod.
419+ // Memory usage gathered for the pod sandbox .
429420 MemoryUsage memory = 2;
430- // Stats pertaining to CPU resources consumed by pod cgroup (which includes all containers' resource usage and pod overhead).
421+ // Network usage gathered for the pod sandbox
431422 NetworkUsage network = 3;
432- // Stats pertaining to processes in the pod.
423+ // Stats pertaining to processes in the pod sandbox .
433424 ProcessUsage process = 4;
434- // Stats of containers in the measured pod.
425+ // Stats of containers in the measured pod sandbox .
435426 repeated ContainerStats containers = 5;
436427}
437428
438- // WindowsPodSandboxStats provides the resource usage statistics for a pod on windows
429+ // WindowsPodSandboxStats provides the resource usage statistics for a pod sandbox on windows
439430message WindowsPodSandboxStats {
440- // TODO: Add stats relevant to windows
431+ // TODO: Add stats relevant to windows.
441432}
442433
443434// NetworkUsage contains data about network resources.
444435message NetworkUsage {
445436 // The time at which these stats were updated.
446437 int64 timestamp = 1;
447- // Stats for the default interface, if found
438+ // Stats for the default network interface.
448439 NetworkInterfaceUsage default_interface = 2;
449- // Stats for all found interfaces
440+ // Stats for all found network interfaces, excluding the default.
450441 repeated NetworkInterfaceUsage interfaces = 3;
451442}
452443
453444// NetworkInterfaceUsage contains resource value data about a network interface.
454- type NetworkInterfaceUsage struct {
455- // The name of the interface
445+ message NetworkInterfaceUsage {
446+ // The name of the network interface.
456447 string name = 1;
457448 // Cumulative count of bytes received.
458- Uint64Value rx_bytes = 2;
449+ UInt64Value rx_bytes = 2;
459450 // Cumulative count of receive errors encountered.
460- Uint64Value rx_errors = 2 ;
451+ UInt64Value rx_errors = 3 ;
461452 // Cumulative count of bytes transmitted.
462- Uint64Value tx_bytes = 2 ;
453+ UInt64Value tx_bytes = 4 ;
463454 // Cumulative count of transmit errors encountered.
464- Uint64Value tx_errors = 2 ;
455+ UInt64Value tx_errors = 5 ;
465456}
466457
467458// ProcessUsage are stats pertaining to processes.
468459message ProcessUsage {
469- // Number of processes in the pod.
470- Uint64Value process_count = 1;
460+ // The time at which these stats were updated.
461+ int64 timestamp = 1;
462+ // Number of processes.
463+ UInt64Value process_count = 2;
471464}
472465```
473466
0 commit comments