Пример #1
0
        /// <summary>
        /// Executes the logs query.
        /// </summary>
        /// <param name="workspace">The workspace to include in the query.</param>
        /// <param name="query">The query text to execute.</param>
        /// <param name="timeRange">The timespan over which to query data. Logs would be filtered to include entries produced starting at <c>Now - timeSpan</c>. </param>
        /// <param name="options">The <see cref="LogsQueryOptions"/> to configure the query.</param>
        /// <param name="cancellationToken">The <see cref="CancellationToken"/> to use.</param>
        /// <returns>Query results mapped to a type <typeparamref name="T"/>.</returns>
        public virtual Response <IReadOnlyList <T> > Query <T>(string workspace, string query, DateTimeRange timeRange, LogsQueryOptions options = null, CancellationToken cancellationToken = default)
        {
            Response <LogsQueryResult> response = Query(workspace, query, timeRange, options, cancellationToken);

            return(Response.FromValue(_rowBinder.BindResults <T>(response.Value.Tables), response.GetRawResponse()));
        }
Пример #2
0
        public virtual Response <IReadOnlyList <T> > Query <T>(string workspaceId, string query, TimeSpan?timeSpan = null, CancellationToken cancellationToken = default)
        {
            Response <LogsQueryResult> response = Query(workspaceId, query, timeSpan, cancellationToken);

            return(Response.FromValue(_rowBinder.BindResults <T>(response), response.GetRawResponse()));
        }