示例#1
0
 /// <summary>
 ///
 /// </summary>
 /// <returns></returns>
 public string Dump()
 {
     return("== DATASOURCE ==\n" +
            "DS:" + dsName.Get() + ":" + dsType.Get() + ":" +
            heartbeat.Get() + ":" + minValue.Get() + ":" +
            maxValue.Get() + "\nlastValue:" + lastValue.Get() +
            " nanSeconds:" + nanSeconds.Get() +
            " accumValue:" + accumValue.Get() + "\n");
 }
示例#2
0
 private void Accumulate(ArcState state, double data)
 {
     if (Double.IsNaN(data))
     {
         state.NanSteps = (state.NanSteps + 1);
     }
     else
     {
         if (consolFun.Get().Equals("MIN"))
         {
             state.AccumValue = Util.Min(state.AccumValue, data);
         }
         else if (consolFun.Get().Equals("MAX"))
         {
             state.AccumValue = Util.Max(state.AccumValue, data);
         }
         else if (consolFun.Get().Equals("LAST"))
         {
             state.AccumValue = data;
         }
         else if (consolFun.Get().Equals("AVERAGE"))
         {
             state.AccumValue = Util.Sum(state.AccumValue, data);
         }
     }
 }
示例#3
0
 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);
 }