github.com/google/fleetspeak@v0.1.15-0.20240426164851-4f31f62c1aea/fleetspeak/src/common/proto/fleetspeak_monitoring/resource.proto (about)

     1  syntax = "proto3";
     2  
     3  package fleetspeak.monitoring;
     4  
     5  import "google/protobuf/timestamp.proto";
     6  
     7  option go_package = "github.com/google/fleetspeak/fleetspeak/src/common/proto/fleetspeak_monitoring";
     8  
     9  // Contains resource-usage metrics for Fleetspeak clients. The stats are
    10  // arrived at by aggregating raw data retrieved from the OS.
    11  // CPU-usage is in milliseconds per second, and memory usage is in bytes.
    12  message AggregatedResourceUsage {
    13    double mean_user_cpu_rate = 1;
    14    double max_user_cpu_rate = 2;
    15    double mean_system_cpu_rate = 3;
    16    double max_system_cpu_rate = 4;
    17    double mean_resident_memory = 5;
    18    int64 max_resident_memory = 6;
    19    int32 max_num_fds = 7;
    20    double mean_num_fds = 8;
    21  }
    22  
    23  // A fleetspeak.Message with message type "ResourceUsage" is sent regularly by
    24  // the system and daemon services to the server, to report the performance of
    25  // processes.
    26  //
    27  // Next tag: 9
    28  message ResourceUsageData {
    29    // Name of the client service that resource usage is charged/attributed to
    30    // e.g 'system' for the system Fleetspeak service, or the name of a daemon
    31    // service as specified in its config.
    32    string scope = 1;
    33  
    34    int64 pid = 2;
    35  
    36    // The self reported service/service binary version.
    37    string version = 8;
    38  
    39    // Time when the process was started by Fleetspeak.
    40    google.protobuf.Timestamp process_start_time = 3;
    41  
    42    // Corresponds to when computation of the resource-usage data was finalized.
    43    google.protobuf.Timestamp data_timestamp = 4;
    44  
    45    AggregatedResourceUsage resource_usage = 5;
    46  
    47    // Optional debug info for the process.
    48    string debug_status = 6;
    49  
    50    // If true, indicates that the process has terminated, and that this is
    51    // the final resource-usage report for that process.
    52    bool process_terminated = 7;
    53  }
    54  
    55  // Sent by clients when a service gets killed by Fleetspeak, e.g. for using
    56  // too much memory.
    57  message KillNotification {
    58    string service = 1;
    59  
    60    int64 pid = 2;
    61  
    62    // The self-reported version of the service.
    63    string version = 3;
    64  
    65    // Time when the process was started by Fleetspeak.
    66    google.protobuf.Timestamp process_start_time = 4;
    67  
    68    // Time when the process was killed by Fleetspeak.
    69    google.protobuf.Timestamp killed_when = 5;
    70  
    71    enum Reason {
    72      UNSPECIFIED = 0;
    73      HEARTBEAT_FAILURE = 1;
    74      MEMORY_EXCEEDED = 2;
    75    }
    76    Reason reason = 6;
    77  }