internal Header(RrdDb parentDb, RrdDef rrdDef) { this.parentDb = parentDb; signature = new RrdString(SIGNATURE, this); step = new RrdLong(rrdDef.Step, this); dsCount = new RrdInt(rrdDef.DsCount, this); arcCount = new RrdInt(rrdDef.ArcCount, this); lastUpdateTime = new RrdLong(rrdDef.StartTime, this); }
internal Header(RrdDb parentDb) { this.parentDb = parentDb; signature = new RrdString(this); if(!signature.Get().Equals(SIGNATURE)) { throw new RrdException("Not an RRDSharp file"); } step = new RrdLong(this); dsCount = new RrdInt(this); arcCount = new RrdInt(this); lastUpdateTime = new RrdLong(this); }
/// <summary> /// /// </summary> /// <param name="parentArc"></param> public ArcState(Archive parentArc) { this.parentArc = parentArc; if(RrdFile.RrdMode == RrdFile.MODE_CREATE) { // should initialize Header header = parentArc.ParentDb.Header; long step = header.Step; long lastUpdateTime = header.LastUpdateTime; long arcStep = parentArc.ArcStep; long nan = (Util.Normalize(lastUpdateTime, step) - Util.Normalize(lastUpdateTime, arcStep)) / step; accumValue = new RrdDouble(Double.NaN, this); nanSteps = new RrdLong(nan, this); } else { accumValue = new RrdDouble(this); nanSteps = new RrdLong(this); } }