Esempio n. 1
0
 public void UpdateArchive(string command)
 {
    RrdDbParser parser = new RrdDbParser("");
    ArcDef arcDef = parser.parseRra(command);
    if (!model.EditingDatabaseData.Definition.ContainsArchive(arcDef))
       throw new ArgumentException("Archive don't exist");
    model.UpdateArchive(arcDef);
 }
Esempio n. 2
0
 public void SetDatabaseDefinition(string command)
 {
    RrdDbParser parser = new RrdDbParser(command);
    RrdDef rrdDef = parser.CreateDatabaseDef();
    if (model.DatabaseExist(rrdDef.Path))
       throw new ApplicationException("Datbase " + rrdDef.Path + " already exist!");
    model.CreateDatabase(rrdDef);
 }
Esempio n. 3
0
      static RrdDb BuildRRd(string filePath, DateTime startTime)
      {
         //rrdtool create net_test.rrd --start 920804400 DS:speed:COUNTER:600:U:U RRA:AVERAGE:0.5:1:24 RRA:AVERAGE:0.5:6:10

         RrdDef rrdDef;// = new RrdDef(filePath, startTime, 300);
         //rrdDef.addDatasource("speed", new DsType(DsType.DsTypes.COUNTER), 600, Double.NaN, Double.NaN);
         //rrdDef.addArchive(new ConsolFun(ConsolFun.ConsolFunTypes.AVERAGE), 0.5, 1, 24);
         //rrdDef.addArchive(new ConsolFun(ConsolFun.ConsolFunTypes.AVERAGE), 0.5, 6, 10);
         //Console.WriteLine(rrdDef.dump());
         DateTime startDateTime = rrd4n.Common.Util.getDate(920804400);
         RrdDbParser parser = new RrdDbParser("net_test.rrd --start \"" + startDateTime.ToString() + "\" DS:speed:COUNTER:600:U:U RRA:AVERAGE:0,5:1:24 RRA:AVERAGE:0,5:6:10");
         rrdDef = parser.CreateDatabaseDef();
         Console.WriteLine(rrdDef.dump());
         Console.WriteLine("Estimated file size: " + rrdDef.getEstimatedSize());
         return new RrdDb(rrdDef);
      }
Esempio n. 4
0
 public void UpdateDataSource(string command, DsDef originalDsDef)
 {
    RrdDbParser parser = new RrdDbParser("");
    model.UpdateDataSource(SrcDatabase, parser.parseDef(command), originalDsDef);
 }
Esempio n. 5
0
 public void AddDataSource(string command)
 {
    RrdDbParser parser = new RrdDbParser("");
    model.AddDataSource(parser.parseDef(command));
 }