// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements.  See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership.  The ASF licenses this file
// to you 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.

syntax="proto2";
option cc_generic_services=true;

package brpc;

// The request sent to -trackme_server
message TrackMeRequest {
  // the svn revision when baidu-rp being compiled, which will be checked
  // by server to tell if the version contains bugs
  optional int64 rpc_version = 1;
  optional string server_addr = 2;    
};

enum TrackMeSeverity {
  TrackMeOK = 0;
  TrackMeWarning = 1;
  TrackMeFatal = 2;
};

// The response from -trackme_server
message TrackMeResponse {
  // Print an ERROR log with error_text when severity=TrackMeFatal
  // Print a WARNING log with error_text when severity=TrackMeWarning
  // Do nothing when severity=TrackMeOk
  optional TrackMeSeverity severity = 1; 
  optional string error_text = 2;
  // If this field is set, send trackme requests with this interval.
  optional int32 new_interval = 3;
};

service TrackMeService {
  rpc TrackMe(TrackMeRequest) returns (TrackMeResponse);
}
