/* ========================= eCAL LICENSE =================================
 *
 * Copyright (C) 2016 - 2019 Continental Corporation
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * ========================= eCAL LICENSE =================================
*/

syntax = "proto3";

package eCAL.pb;

enum eProcessSeverity                                     // process severity
{
  proc_sev_unknown  = 0;                                  // condition unknown
  proc_sev_healthy  = 1;                                  // process healthy
  proc_sev_warning  = 2;                                  // process warning level
  proc_sev_critical = 3;                                  // process critical
  proc_sev_failed   = 4;                                  // process failed
}

enum eProcessSeverityLevel                                // process severity level
{
  proc_sev_level_unknown = 0;                             // condition unknown
  proc_sev_level1        = 1;                             // default severity level 1
  proc_sev_level2        = 2;                             // severity level 2
  proc_sev_level3        = 3;                             // severity level 3
  proc_sev_level4        = 4;                             // severity level 4
  proc_sev_level5        = 5;                             // severity level 5
}

message ProcessState                                      // process state
{
  eProcessSeverity          severity             =  1;    // severity
  eProcessSeverityLevel     severity_level       =  3;    // severity level
  string                    info                 =  2;    // info string
}

enum eTSyncState                                          // time synchronisation
{
  tsync_none     = 0;                                     // not synchronized
  tsync_realtime = 1;                                     // real time sync mode
  tsync_replay   = 2;                                     // replay time sync mode
}

message Process                                           // process
{
  int32                     rclock               =  1;    // registration clock
  string                    hname                =  2;    // host name
  string                    hgname               = 18;    // host group name
  int32                     pid                  =  3;    // process id
  string                    pname                =  4;    // process name
  string                    uname                =  5;    // unit name
  string                    pparam               =  6;    // process parameter
  int64                     pmemory              =  7;    // process memory
  float                     pcpu                 =  8;    // process cpu usage
  float                     usrptime             =  9;    // process user time
  int64                     datawrite            = 10;    // data write bytes per sec
  int64                     dataread             = 11;    // data read bytes per sec
  ProcessState              state                = 12;    // process state info
  eTSyncState               tsync_state          = 13;    // time synchronization state
  string                    tsync_mod_name       = 14;    // time synchronization module name
  int32                     component_init_state = 15;    // eCAL component initialization state (eCAL::Initialize(..))
  string                    component_init_info  = 16;    // like comp_init_state as human readable string (pub|sub|srv|mon|log|time|proc)
  string                    ecal_runtime_version = 17;    // loaded / runtime eCAL version of a component
}
