コード例 #1
0
        private void AddPageIdsToCache(ICollection <string> notCached)
        {
            if (!notCached.Any())
            {
                return;
            }
            var pageIds = _backend.GetPageIds(notCached.ToArray());

            lock (_writeLock) {
                foreach (var pageIdNamePair in pageIds)
                {
                    _pageIdToNameMap[pageIdNamePair.Value] = pageIdNamePair.Key;
                    _pageNameToIdMap[pageIdNamePair.Key]   = pageIdNamePair.Value;
                }
            }
        }
コード例 #2
0
        private DataTable GetPageDurationTable(CommBus.HttpRequestData[] res)
        {
            var pageNameToIdMap = _pageProvider.GetPageIds(res.Select(r => r.Page).ToArray());

            var pages = res.Select(p => new object[] { pageNameToIdMap[p.Page], p.Duration, p.Timestamp }).ToArray();

            var tbl = new DataTable();

            tbl.Columns.Add("PageId");
            tbl.Columns.Add("Duration");
            tbl.Columns.Add("Timestamp");
            foreach (var page in pages)
            {
                tbl.Rows.Add(page);
            }
            return(tbl);
        }