Ejemplo n.º 1
0
        public IEnumerable<Flot> GetFlotSnapshot()
        {
            var tObjects = new List<Flot>();

            var snapshot = Business.Helper.Snapshots.GenerateSnapshot();
            for (int a = 1; a <= Snapshot.SnapshotCount; a++)
            {
                var value = (SnapshotValue)a;
                var obj = new Flot
                {
                    Data = new[] {new[] {snapshot.Get(SnapshotValue.Timestamp), snapshot.Get(value)}},
                    Type = a
                };

                tObjects.Add(obj);
            }

            return tObjects.ToArray();
        }
Ejemplo n.º 2
0
        IEnumerable<Flot> GetFlotData(DateTime aStart, DateTime aEnd)
        {
            var tObjects = new List<Flot>();

            FetchData data = Helper.RrdDb.createFetchRequest(ConsolFuns.CF_AVERAGE, aStart.ToTimestamp(), aEnd.ToTimestamp(), 1).fetchData();
            Int64[] times = data.getTimestamps();
            double[][] values = data.getValues();

            for (int a = 1; a <= Snapshot.SnapshotCount; a++)
            {
                var obj = new Flot();

                var list = new List<double[]>();
                for (int b = 0; b < times.Length; b++)
                {
                    double[] current = { times[b] * 1000, values[a][b] };
                    list.Add(current);
                }
                obj.Data = list.ToArray();
                obj.Type = a;

                tObjects.Add(obj);
            }

            return tObjects.ToArray();
        }