Exemplo n.º 1
0
        public void TrackViewModelCacheMiss(string routeName, int diffJsonLength)
        {
            if (routeName == options.RouteName)
            {
                return;
            }

            lock (fullPostBackEntriesLocker)
            {
                if (!fullPostBackEntries.TryGetValue(routeName, out var entry))
                {
                    entry = new FullPostBackStatsEntry()
                    {
                        RouteName              = routeName,
                        CacheMissDiffBytes     = diffJsonLength,
                        CacheMissPostBackCount = 1
                    };
                    fullPostBackEntries.Add(routeName, entry);
                }
                else
                {
                    entry.CacheMissDiffBytes += diffJsonLength;
                    entry.CacheMissPostBackCount++;
                }
            }
        }
Exemplo n.º 2
0
        public void TrackFullPostBack(string routeName, int jsonLength)
        {
            if (routeName == options.RouteName)
            {
                return;
            }

            lock (fullPostBackEntriesLocker)
            {
                if (!fullPostBackEntries.TryGetValue(routeName, out var entry))
                {
                    entry = new FullPostBackStatsEntry()
                    {
                        RouteName         = routeName,
                        FullPostBackBytes = jsonLength,
                        FullPostBackCount = 1
                    };
                    fullPostBackEntries.Add(routeName, entry);
                }
                else
                {
                    entry.FullPostBackBytes += jsonLength;
                    entry.FullPostBackCount++;
                }
            }
        }