Exemplo n.º 1
0
 public Datasource(RrdDb parentDb, DsDef dsDef)
 {
     bool shouldInitialize = dsDef != null;
     this.parentDb = parentDb;
     dsName = new RrdString(this);
     dsTypeName = new RrdString(this);
     if (!shouldInitialize) 
        dsType = new DsType(dsTypeName.get());
     heartbeat = new RrdLong(this);
     minValue = new RrdDouble(this);
     maxValue = new RrdDouble(this);
     lastValue = new RrdDouble(this);
     accumValue = new RrdDouble(this);
     nanSeconds = new RrdLong(this);
     if (shouldInitialize)
     {
         dsName.set(dsDef.getDsName());
         dsType = dsDef.getDsType();
         dsTypeName.set(dsType.Name);
         heartbeat.set(dsDef.getHeartbeat());
         minValue.set(dsDef.getMinValue());
         maxValue.set(dsDef.getMaxValue());
         lastValue.set(Double.NaN);
         accumValue.set(0.0);
         Header header = parentDb.getHeader();
         nanSeconds.set(header.getLastUpdateTime() % header.getStep());
     }
 }
Exemplo n.º 2
0
        public Datasource(RrdDb parentDb, DsDef dsDef)
        {
            bool shouldInitialize = dsDef != null;

            this.parentDb = parentDb;
            dsName        = new RrdString(this);
            dsTypeName    = new RrdString(this);
            if (!shouldInitialize)
            {
                dsType = new DsType(dsTypeName.get());
            }
            heartbeat  = new RrdLong(this);
            minValue   = new RrdDouble(this);
            maxValue   = new RrdDouble(this);
            lastValue  = new RrdDouble(this);
            accumValue = new RrdDouble(this);
            nanSeconds = new RrdLong(this);
            if (shouldInitialize)
            {
                dsName.set(dsDef.getDsName());
                dsType = dsDef.getDsType();
                dsTypeName.set(dsType.Name);
                heartbeat.set(dsDef.getHeartbeat());
                minValue.set(dsDef.getMinValue());
                maxValue.set(dsDef.getMaxValue());
                lastValue.set(Double.NaN);
                accumValue.set(0.0);
                Header header = parentDb.getHeader();
                nanSeconds.set(header.getLastUpdateTime() % header.getStep());
            }
        }
Exemplo n.º 3
0
	public ArcState(Archive parentArc, bool shouldInitialize) {
		this.parentArc = parentArc;
		accumValue = new RrdDouble(this);
		nanSteps = new RrdLong(this);
		if(shouldInitialize) {
			Header header = parentArc.getParentDb().getHeader();
			long step = header.getStep();
			long lastUpdateTime = header.getLastUpdateTime();
			long arcStep = parentArc.getArcStep();
			long initNanSteps = (Util.normalize(lastUpdateTime, step) -
				Util.normalize(lastUpdateTime, arcStep)) / step;
			accumValue.set(Double.NaN);
			nanSteps.set(initNanSteps);
		}
	}
Exemplo n.º 4
0
 public ArcState(Archive parentArc, bool shouldInitialize)
 {
     this.parentArc = parentArc;
     accumValue     = new RrdDouble(this);
     nanSteps       = new RrdLong(this);
     if (shouldInitialize)
     {
         Header header         = parentArc.getParentDb().getHeader();
         long   step           = header.getStep();
         long   lastUpdateTime = header.getLastUpdateTime();
         long   arcStep        = parentArc.getArcStep();
         long   initNanSteps   = (Util.normalize(lastUpdateTime, step) -
                                  Util.normalize(lastUpdateTime, arcStep)) / step;
         accumValue.set(Double.NaN);
         nanSteps.set(initNanSteps);
     }
 }
Exemplo n.º 5
0
        public Header(RrdDb parentDb, RrdDef rrdDef, String initSignature)
        {
            this.parentDb = parentDb;

            signature = new RrdString(this);	 		// NOT constant, may be cached
            step = new RrdLong(this, true); 			// constant, may be cached
            dsCount = new RrdInt(this, true); 			// constant, may be cached
            arcCount = new RrdInt(this, true); 			// constant, may be cached
            lastUpdateTime = new RrdLong(this);

            if (rrdDef != null)
            {
                signature.set(initSignature);
                step.set(rrdDef.getStep());
                dsCount.set(rrdDef.getDsCount());
                arcCount.set(rrdDef.getArcCount());
                lastUpdateTime.set(rrdDef.getStartTime());
            }
        }
Exemplo n.º 6
0
        public Header(RrdDb parentDb, RrdDef rrdDef, String initSignature)
        {
            this.parentDb = parentDb;

            signature      = new RrdString(this);               // NOT constant, may be cached
            step           = new RrdLong(this, true);           // constant, may be cached
            dsCount        = new RrdInt(this, true);            // constant, may be cached
            arcCount       = new RrdInt(this, true);            // constant, may be cached
            lastUpdateTime = new RrdLong(this);

            if (rrdDef != null)
            {
                signature.set(initSignature);
                step.set(rrdDef.getStep());
                dsCount.set(rrdDef.getDsCount());
                arcCount.set(rrdDef.getArcCount());
                lastUpdateTime.set(rrdDef.getStartTime());
            }
        }