summaryrefslogtreecommitdiff
path: root/rrdformat/format.go
diff options
context:
space:
mode:
Diffstat (limited to 'rrdformat/format.go')
-rw-r--r--rrdformat/format.go27
1 files changed, 21 insertions, 6 deletions
diff --git a/rrdformat/format.go b/rrdformat/format.go
index 7ea15b7..4e68b93 100644
--- a/rrdformat/format.go
+++ b/rrdformat/format.go
@@ -12,6 +12,8 @@ import (
const XMLNS = "https://oss.oetiker.ch/rrdtool/rrdtool-dump.xml"
+type RRDValue = rrdbinary.Float
+
// rrdtool:
// rrd_format.h: stat_head_t -- static header of the database
//
@@ -39,16 +41,30 @@ type RRADef struct {
PDPCnt rrdBinary.Uint
}
-type LiveHead struct {
-
+type PDPPrep struct {
+ LastDS rrdbinary.String `rrdbinary:"size=30"`
+ Scratch [10]rrdbinary.Unival
+}
+
+type CDPPrep struct {
+ Scratch [10]rrdbinary.Unival
+}
+
+type RRAPtr struct {
+ CurRow rrdbinary.Uint
}
// rrdtool:
// rrd_format.h: rrd_t One single struct to hold all the others.
type RRD struct {
- DSDefs []DSDef
- RRADefs []RRADef
- LiveHead LiveHead
+ Header Header
+ DSDefs []DSDef
+ RRADefs []RRADef
+ LastUpdated rrdbinary.Timesstamp
+ PDPPrep TODO
+ CPDPrep TODO
+ RRAPtr TODO
+ Values []RRDValue
}
type Header struct {
@@ -102,7 +118,6 @@ func (h *Header) UnmarshalBinary(data []byte) error {
// Assume IEEE 754 doubles. C doesn't assume 754 doubles, but anything that doesn't use 754 doubles is exotic
// enough that I'm OK saying "you're going to need to use `rrdtool dump`". This lets us assume that:
// - a 'double' is 8 bytes wide
-
// - the value will be exactly equal, and we don't need to worry about weird rounding.
h.FloatWidth = 8
magicFloat := float64(8.642135e130)