예제 #1
0
        public void AddPoints(List <DataPoint> resultPoints, string dbName)
        {
            //resultPoints.RemoveAt(0);
            //resultPoints.ForEach( x => new DataPoint(x.X-100,x.Y));
            ClearPoints(dbName);
            switch (dbName)
            {
            case "MongoDB":
                foreach (var r in resultPoints)
                {
                    PointsMongo.Add(r);
                }
                break;

            case "RiakKV":
                foreach (var r in resultPoints)
                {
                    PointsRiak.Add(r);
                }
                break;

            case "Redis":
                foreach (var r in resultPoints)
                {
                    PointsRedis.Add(r);
                }
                break;

            case "Memcached":
                foreach (var r in resultPoints)
                {
                    PointsMemcached.Add(r);
                }
                break;

            case "CouchBase":
                foreach (var r in resultPoints)
                {
                    PointsCouchBase.Add(r);
                }
                break;

            case "OrientDB":
                foreach (var r in resultPoints)
                {
                    PointsOrient.Add(r);
                }
                break;
            }
        }
예제 #2
0
        private void ClearPoints(string dbName)
        {
            switch (dbName)
            {
            case "MongoDB":
                while (PointsMongo.Count > 0)
                {
                    PointsMongo.RemoveAt(PointsMongo.Count - 1);
                }
                break;

            case "RiakKV":
                while (PointsRiak.Count > 0)
                {
                    PointsRiak.RemoveAt(PointsRiak.Count - 1);
                }
                break;

            case "Redis":
                while (PointsRedis.Count > 0)
                {
                    PointsRedis.RemoveAt(PointsRedis.Count - 1);
                }
                break;

            case "Memcached":
                while (PointsMemcached.Count > 0)
                {
                    PointsMemcached.RemoveAt(PointsMemcached.Count - 1);
                }
                break;

            case "CouchBase":
                while (PointsCouchBase.Count > 0)
                {
                    PointsCouchBase.RemoveAt(PointsCouchBase.Count - 1);
                }
                break;

            case "OrientDB":
                while (PointsOrient.Count > 0)
                {
                    PointsOrient.RemoveAt(PointsOrient.Count - 1);
                }
                break;
            }
        }