internal IViewData GetView(IViewName viewName, IClock clock, StatsCollectionState state) { lock (this.lck) { MutableViewData view = this.GetMutableViewData(viewName); return(view?.ToViewData(clock.Now, state)); } }
/** Returns a {@link ViewData} corresponding to the given {@link View.Name}. */ internal IViewData GetView(IViewName viewName, IClock clock, StatsCollectionState state) { lock (_lck) { MutableViewData view = GetMutableViewData(viewName); return(view == null ? null : view.ToViewData(clock.Now, state)); } }
internal IViewData GetView(IViewName viewName, StatsCollectionState state) { lock (this.lck) { var view = this.GetMutableViewData(viewName); return(view?.ToViewData(DateTimeOffset.Now, state)); } }
// Sets current state to the given state. Returns true if the current state is changed, false // otherwise. internal bool Set(StatsCollectionState state) { if (isRead) { throw new ArgumentException("State was already read, cannot set state."); } if (state == currentState) { return(false); } else { currentState = state; return(true); } }
internal override IViewData ToViewData(ITimestamp now, StatsCollectionState state) { if (state == StatsCollectionState.ENABLED) { return(ViewData.Create( View, CreateAggregationMap(tagValueAggregationMap, View.Measure), start, now)); } else { // If Stats state is DISABLED, return an empty ViewData. return(ViewData.Create( View, new Dictionary <TagValues, IAggregationData>(), ZERO_TIMESTAMP, ZERO_TIMESTAMP)); } }
internal override IViewData ToViewData(DateTimeOffset now, StatsCollectionState state) { if (state == StatsCollectionState.ENABLED) { return(ViewData.Create( this.View, CreateAggregationMap(this.tagValueAggregationMap, this.View.Measure), this.start, now)); } else { // If Stats state is DISABLED, return an empty ViewData. return(ViewData.Create( this.View, new Dictionary <TagValues, IAggregationData>(), DateTimeOffset.MinValue, DateTimeOffset.MinValue)); } }
/** Convert this {@link MutableViewData} to {@link ViewData}. */ internal abstract IViewData ToViewData(DateTimeOffset now, StatsCollectionState state);
/** Convert this {@link MutableViewData} to {@link ViewData}. */ internal abstract IViewData ToViewData(ITimestamp now, StatsCollectionState state);