码迷,mamicode.com
首页 > 其他好文 > 详细

Protocol Buffer 时间类型定义

时间:2017-05-04 01:35:34      阅读:153      评论:0      收藏:0      [点我收藏+]

标签:val   meta   tor   bsp   服务   moni   字典   节点   定义   

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

 

Protocol Buffer 时间类型定义

标签:val   meta   tor   bsp   服务   moni   字典   节点   定义   

原文地址:http://www.cnblogs.com/liugh/p/6804832.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!