Ejemplo n.º 1
0
        public void Apply(StatisticReceived @event, bool active)
        {
            if (active)
            {
                LastActive = Latest(LastActive, @event.Timestamp);
            }
            else
            {
                LastInactive = Latest(LastInactive, @event.Timestamp);
            }

            var groupTime = Truncate(@event.Timestamp);

            QueryGraph.TryGetValue(groupTime, out var queryCount);
            QueryGraph[groupTime] = ++queryCount;

            if (active)
            {
                ActiveGraph.TryGetValue(groupTime, out var activeCount);
                ActiveGraph[groupTime] = ++activeCount;
            }
            else
            {
                InactiveGraph.TryGetValue(groupTime, out var inactiveCount);
                InactiveGraph[groupTime] = ++inactiveCount;
            }
        }
Ejemplo n.º 2
0
        private void UpdateGraphs(StatisticReceived @event)
        {
            var groupTime = Truncate(@event.Timestamp);

            QueryGraph.TryGetValue(groupTime, out var queryCount);
            QueryGraph[groupTime] = ++queryCount;

            if (@event.Active)
            {
                ActiveGraph.TryGetValue(groupTime, out var activeCount);
                ActiveGraph[groupTime] = ++activeCount;
            }
            else
            {
                InactiveGraph.TryGetValue(groupTime, out var inactiveCount);
                InactiveGraph[groupTime] = ++inactiveCount;
            }
        }