Ejemplo n.º 1
0
        // stores single value
        public void store(double newValue)
        {
            int position = pointer.get();

            values.set(position, newValue);
            pointer.set((position + 1) % rows);
        }
Ejemplo n.º 2
0
 public Archive(RrdDb parentDb, ArcDef arcDef)
 {
    bool shouldInitialize = arcDef != null;
    this.parentDb = parentDb;
    consolFun = new RrdString(this, true);  // constant, may be cached
    xff = new RrdDouble(this);
    steps = new RrdInt(this, true);            // constant, may be cached
    rows = new RrdInt(this, true);            // constant, may be cached
    if (shouldInitialize)
    {
       consolFun.set(arcDef.getConsolFun().Name);
       xff.set(arcDef.getXff());
       steps.set(arcDef.getSteps());
       rows.set(arcDef.getRows());
    }
    int n = parentDb.getHeader().getDsCount();
    states = new ArcState[n];
    robins = new Robin[n];
    for (int i = 0; i < n; i++)
    {
       states[i] = new ArcState(this, shouldInitialize);
       int numRows = rows.get();
       robins[i] = new Robin(this, numRows, shouldInitialize);
    }
 }
Ejemplo n.º 3
0
        public Archive(RrdDb parentDb, ArcDef arcDef)
        {
            bool shouldInitialize = arcDef != null;

            this.parentDb = parentDb;
            consolFun     = new RrdString(this, true); // constant, may be cached
            xff           = new RrdDouble(this);
            steps         = new RrdInt(this, true);    // constant, may be cached
            rows          = new RrdInt(this, true);    // constant, may be cached
            if (shouldInitialize)
            {
                consolFun.set(arcDef.getConsolFun().Name);
                xff.set(arcDef.getXff());
                steps.set(arcDef.getSteps());
                rows.set(arcDef.getRows());
            }
            int n = parentDb.getHeader().getDsCount();

            states = new ArcState[n];
            robins = new Robin[n];
            for (int i = 0; i < n; i++)
            {
                states[i] = new ArcState(this, shouldInitialize);
                int numRows = rows.get();
                robins[i] = new Robin(this, numRows, shouldInitialize);
            }
        }
Ejemplo n.º 4
0
 public Robin(Archive parentArc, int rows, bool shouldInitialize) {
     this.parentArc = parentArc;
     this.pointer = new RrdInt(this);
     this.values = new RrdDoubleArray(this, rows);
     this.rows = rows;
     if (shouldInitialize) {
         pointer.set(0);
         values.set(0, Double.NaN, rows);
     }
 }
Ejemplo n.º 5
0
 public Robin(Archive parentArc, int rows, bool shouldInitialize)
 {
     this.parentArc = parentArc;
     this.pointer   = new RrdInt(this);
     this.values    = new RrdDoubleArray(this, rows);
     this.rows      = rows;
     if (shouldInitialize)
     {
         pointer.set(0);
         values.set(0, Double.NaN, rows);
     }
 }
Ejemplo n.º 6
0
        public Header(RrdDb parentDb, DataImporter reader)
            : this(parentDb, (RrdDef)null)
        {
            String version = reader.getVersion();

            if (RRDTOOL_VERSION.CompareTo(version) != 0)
            {
                throw new ArgumentException("Could not unserialize xml version " + version);
            }
            signature.set(DEFAULT_SIGNATURE);
            step.set(reader.getStep());
            dsCount.set(reader.getDsCount());
            arcCount.set(reader.getArcCount());
            lastUpdateTime.set(reader.getLastUpdateTime());
        }
Ejemplo n.º 7
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());
            }
        }
Ejemplo n.º 8
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());
            }
        }