/// <summary> /// /// </summary> /// <param name="parentDb"></param> public Datasource(RrdDb parentDb) { this.parentDb = parentDb; dsName = new RrdString(this); dsType = new RrdString(this); heartbeat = new RrdLong(this); minValue = new RrdDouble(this); maxValue = new RrdDouble(this); lastValue = new RrdDouble(this); accumValue = new RrdDouble(this); nanSeconds = new RrdLong(this); }
/// <summary> /// /// </summary> /// <param name="parentDb"></param> /// <param name="dsDef"></param> public Datasource(RrdDb parentDb, DsDef dsDef) { this.parentDb = parentDb; dsName = new RrdString(dsDef.DsName, this); dsType = new RrdString(dsDef.DsType, this); heartbeat = new RrdLong(dsDef.Heartbeat, this); minValue = new RrdDouble(dsDef.MinValue, this); maxValue = new RrdDouble(dsDef.MaxValue, this); lastValue = new RrdDouble(Double.NaN, this); accumValue = new RrdDouble(0.0, this); Header header = parentDb.Header; nanSeconds = new RrdLong(header.LastUpdateTime % header.Step, this); }
/// <summary> /// /// </summary> /// <param name="parentDb"></param> public Archive(RrdDb parentDb) { this.parentDb = parentDb; consolFun = new RrdString(this); xff = new RrdDouble(this); steps = new RrdInt(this); rows = new RrdInt(this); int n = parentDb.Header.DsCount; states = new ArcState[n]; robins = new Robin[n]; for (int i = 0; i < n; i++) { states[i] = new ArcState(this); robins[i] = new Robin(this, rows.Get()); } }
/// <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); } }