ProtoBuf3中新增了TimeStamp类型,使用示例如下:
syntax = "proto3";
import public "google/protobuf/timestamp.proto";

message MonitorData { 
google.protobuf.Timestamp Time = 1;//收集时间
int64 LongValue = 2;//监控值--长整型
string MetaData = 3;//监控元数据ID
string Ins = 4;//监控元数据实例
string Host = 5;//应用节点ApplicationNode
string ServiceHost = 6;//服务宿主ApplicationHost
string StringValue = 7;//监控值--字符串
double DoubleValue = 8;//监控值--浮点型
map<string, string> Tags = 9;//监控数据维度字典 
map<string, string> Ext = 10;//扩展属性
string Cluster = 11;//集群
string RowKey = 12;//RowKey
}

 根据.proto文件生成对应的Java类:

D:\tmp>protoc.exe -I=d:/tmp --java_out=d:/tmp d:/tmp/monitordata.proto

 注:protoc下载:

http://repo1.maven.org/maven2/com/google/protobuf/protoc/

相关文章:

  • 2022-12-23
  • 2021-06-27
  • 2021-07-13
  • 2022-12-23
  • 2022-12-23
  • 2021-10-15
猜你喜欢
  • 2022-12-23
  • 2022-02-14
  • 2021-08-30
  • 2022-02-18
相关资源
相似解决方案