Method CreateTimeSeriesRunner
- Namespace
- MVVrus.AspNetCore.ActiveSession.StdRunner
- Assembly
- MVVrus.AspNetCore.ActiveSession.dll
CreateTimeSeriesRunner<TResult>(IActiveSession, TimeSeriesParams<TResult>, HttpContext, IDisposable?)
Creates a TimeSeriesRunner<TResult> instance in the specified Active Session.
public static KeyedRunner<IEnumerable<(DateTime, TResult)>> CreateTimeSeriesRunner<TResult>(this IActiveSession Session, TimeSeriesParams<TResult> SeriesParam, HttpContext Context, IDisposable? ExclusiveServiceAccessor = null)
Parameters
Session
IActiveSession- An interface of Active Session object to work with.
SeriesParam
TimeSeriesParams<TResult>- A structure that contains parameters used for creation of the instance. Fields of the structure contains the same values as the paramemters of the protected constructor with the same names.
Context
HttpContext- Context of the HTTP request from a handler of which the method is called.
ExclusiveServiceAccessor
IDisposable- The accessor for the exlusively accessible service to be used by the runner. This accessor will be disposed after the runner completion and cleanup thus releasing the lock represented by the accessor on the exclusively accessible scoped service from the active session's container. The accesor value may be null (this is the default value), that means the new runner will not use any exclusively accessible service from the active session's DI container.
Returns
- KeyedRunner<IEnumerable<(DateTime, TResult)>>
A structure that contains the reference to the new runner and its number within the active session.
Type Parameters
TResult
Type of the measured values in the series. They are returned as "measured value" parts of pairs ("time of measurement", "measured value") composing the result sequence of the runner. .
CreateTimeSeriesRunner<TResult>(IActiveSession, Func<TResult>, TimeSpan, HttpContext, IDisposable?)
public static KeyedRunner<IEnumerable<(DateTime, TResult)>> CreateTimeSeriesRunner<TResult>(this IActiveSession Session, Func<TResult> Gauge, TimeSpan Interval, HttpContext Context, IDisposable? ExclusiveServiceAccessor = null)
Parameters
Session
IActiveSession- An interface of Active Session object to work with.
Gauge
Func<TResult>- A delegate that returns a result of a measurement.
Interval
TimeSpan- Requested interval between measurements.
Context
HttpContext- Context of the HTTP request from a handler of which the method is called.
ExclusiveServiceAccessor
IDisposable- The accessor for the exlusively accessible service to be used by the runner. This accessor will be disposed after the runner completion and cleanup thus releasing the lock represented by the accessor on the exclusively accessible scoped service from the active session's container. The accesor value may be null (this is the default value), that means the new runner will not use any exclusively accessible service from the active session's DI container.
Returns
- KeyedRunner<IEnumerable<(DateTime, TResult)>>
A structure that contains the reference to the new runner and its number within the active session.
Type Parameters
TResult
Type of the measured values in the series. They are returned as "measured value" parts of pairs ("time of measurement", "measured value") composing the result sequence of the runner. .
CreateTimeSeriesRunner<TResult>(IActiveSession, Func<TResult>, TimeSpan, int, HttpContext, IDisposable?)
public static KeyedRunner<IEnumerable<(DateTime, TResult)>> CreateTimeSeriesRunner<TResult>(this IActiveSession Session, Func<TResult> Gauge, TimeSpan Interval, int Count, HttpContext Context, IDisposable? ExclusiveServiceAccessor = null)
Parameters
Session
IActiveSession- An interface of Active Session object to work with.
Gauge
Func<TResult>- A delegate that returns a result of a measurement.
Interval
TimeSpan- Requested interval between measurements.
Count
int- Maximum number of measurements in the series. May be null to produce a series with unlimited number of measurements.
Context
HttpContext- Context of the HTTP request from a handler of which the method is called.
ExclusiveServiceAccessor
IDisposable- The accessor for the exlusively accessible service to be used by the runner. This accessor will be disposed after the runner completion and cleanup thus releasing the lock represented by the accessor on the exclusively accessible scoped service from the active session's container. The accesor value may be null (this is the default value), that means the new runner will not use any exclusively accessible service from the active session's DI container.
Returns
- KeyedRunner<IEnumerable<(DateTime, TResult)>>
A structure that contains the reference to the new runner and its number within the active session.
Type Parameters
TResult
Type of the measured values in the series. They are returned as "measured value" parts of pairs ("time of measurement", "measured value") composing the result sequence of the runner. .