-
Notifications
You must be signed in to change notification settings - Fork 1
/
chunk_protocol_buffers.proto
65 lines (55 loc) · 2.04 KB
/
chunk_protocol_buffers.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*
* Copyright (C) 2015 QAware GmbH
*
* 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.
*/
package serializer;
option java_package = "com.hurence.timeseries.converter.serializer";
option optimize_for = SPEED;
//Our point
message Point {
//The delta as long
optional uint64 tlong = 1;
//Perhaps we can store the delta as int
optional uint32 tint = 2;
//Value
optional double v = 3;
//Or the index of the value
optional uint32 vIndex = 4;
//timestamp base deltas
optional uint64 tlongBP = 5;
optional uint32 tintBP = 6;
}
//The data of a time series is a list of points
message Chunk {
//The list of points
repeated Point p = 1;
//the used ddc threshold
optional uint32 ddc = 2;
//The list of qualities, only saving for each change
repeated Quality q = 3;
optional string name = 4; // metric name
optional uint64 start = 5; // UTC timestamp for start time of the chunk (in ms)
optional uint64 end = 6; // UTC timestamp for end time of the chunk (in ms)
//map<string, double> aggs = 7; // map for precomputed aggs if available
//optional map<string, string> tags = 8; // map for precomputed aggs if available
}
message Quality {
//the index of the first point with this quality, not given for first point
//we will store it each time the quality changes
optional uint32 pointIndex = 1;
//the Value of the quality
optional float v = 2;
//Or the index of the value if it is already stocked
optional uint32 vIndex = 3;
}