Beispiel #1
0
        public static void RecordedBulkByChunks(
            AFTimeRange timeRange,
            int pointsChunkSize,
            bool insertNoData,
            Action <List <AFValue> > insertData,
            PIPointsProvider provider,
            int sleep,
            CancellationToken cancellationToken
            )
        {
            int i = 0;

            foreach (var pointsChunk in provider.GetPointsByChunks(pointsChunkSize))
            {
                i++;
                _logger.InfoFormat("Processing tag chunk {0} - (tag chunk size: {1})", i, pointsChunkSize);
                var pointsList = new PIPointList(pointsChunk);

                RecordedBulk(pointsList, timeRange, pointsChunkSize, insertNoData, insertData); // todo needs a different setting here

                if (sleep > 0)
                {
                    Thread.Sleep(sleep);
                }
            }
        }
Beispiel #2
0
        public static void RecordedBulkParallelByChunks(
            AFTimeRange timeRange,
            int maxDegOfParallel,
            int bulkParallelChunkSize,
            int bulkPageSize,
            bool insertNoData,
            Action <List <AFValue> > insertData,
            PIPointsProvider provider,
            int sleep,
            CancellationToken cancelToken
            )
        {
            int i = 0;

            foreach (var pointsChunk in provider.GetPointsByChunks(bulkParallelChunkSize))
            {
                i++;
                _logger.InfoFormat("Processing tag chunk {0} - (tag chunk size: {1})", i, bulkParallelChunkSize);
                var pointsList = new PIPointList(pointsChunk);

                RecordedBulkParallel(pointsList, timeRange, 4, bulkParallelChunkSize, bulkPageSize, insertNoData, insertData, cancelToken);

                if (sleep > 0)
                {
                    Thread.Sleep(sleep);
                }
            }
        }