Skip to content

Commit

Permalink
Merge pull request #117 from datalust/dev
Browse files Browse the repository at this point in the history
2023.1.0 Release
  • Loading branch information
nblumhardt authored Jan 20, 2023
2 parents 4b8e1b4 + 8f1f184 commit 3399980
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 115 deletions.
32 changes: 5 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Seq HTTP API Client [![Build status](https://ci.appveyor.com/api/projects/status/bhtx25hyqmmdqhvt?svg=true)](https://ci.appveyor.com/project/datalust/seq-api) [![NuGet Pre Release](https://img.shields.io/nuget/vpre/Seq.Api.svg)](https://nuget.org/packages/seq.api) [![Join the chat at https://gitter.im/datalust/seq](https://img.shields.io/gitter/room/datalust/seq.svg)](https://gitter.im/datalust/seq)
# Seq HTTP API Client [![Build status](https://ci.appveyor.com/api/projects/status/bhtx25hyqmmdqhvt?svg=true)](https://ci.appveyor.com/project/datalust/seq-api) [![NuGet Pre Release](https://img.shields.io/nuget/vpre/Seq.Api.svg)](https://nuget.org/packages/seq.api)

This library includes:

Expand Down Expand Up @@ -49,37 +49,15 @@ See the [signal-copy app](https://github.com/datalust/seq-api/blob/main/example/

Seq internally limits the resources a query is allowed to consume. The query methods on `SeqConnection.Events` include a _status_ with each result set - a `Partial` status indicates that further results must be retrieved.

The snippet below demonstrates paging through results to retrieve the complete set.
The snippet below demonstrates lazily enumerating through results to retrieve the complete set.

```csharp
string lastReadEventId = null;

while(true)
{
var resultSet = await connection.Events.InSignalAsync(
filter: "Environment = 'Test'",
render: true,
afterId: lastReadEventId);

foreach (var evt in resultSet.Events)
Console.WriteLine(evt.RenderedMessage);

if (resultSet.Statistics.Status == ResultSetStatus.Complete)
break;

lastReadEventId = resultSet.Statistics.LastReadEventId;
}
```

If the result set is expected to be small, `ListAsync()` will buffer results and return a complete list:

```csharp
var resultSet = await connection.Events.ListAsync(
var resultSet = await connection.Events.EnumerateAsync(
filter: "Environment = 'Test'",
render: true,
count: 1000);
foreach (var evt in resultSet)

await foreach (var evt in resultSet)
Console.WriteLine(evt.RenderedMessage);
```

Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ artifacts:
deploy:
- provider: NuGet
api_key:
secure: 29fNPaMVCbTVioV8D4/8PbTWEU3xwAuN4iFxqDcI8T60kfNzE4YvrvCPdXO9gl2q
secure: lfUaaMDeL9aQf/rG4TLmWWYBF1oj1uaJtWnmXoy3QNyauOuJIkKRjX7ZH9p/TGKM
skip_symbols: true
on:
branch: /^(main|dev)$/
Expand Down
18 changes: 1 addition & 17 deletions src/Seq.Api/Model/Data/QueryExecutionStatisticsPart.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,9 @@ namespace Seq.Api.Model.Data
/// </summary>
public class QueryExecutionStatisticsPart
{
/// <summary>
/// The number of events inspected in the course of computing the query result. This will
/// not include events that could be skipped based on index information or text pre-filtering.
/// </summary>
public ulong ScannedEventCount { get; set; }

/// <summary>
/// The number of events that contributed to the query result.
/// </summary>
public ulong MatchingEventCount { get; set; }

/// <summary>
/// Whether the query needed to search disk-backed storage.
/// </summary>
public bool UncachedSegmentsScanned { get; set; }

/// <summary>
/// The server-side elapsed time taken to compute the query result.
/// </summary>
public double ElapsedMilliseconds { get; set; }
}
}
}
32 changes: 1 addition & 31 deletions src/Seq.Api/Model/Diagnostics/ServerMetricsEntity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,26 +28,6 @@ public class ServerMetricsEntity : Entity
public ServerMetricsEntity()
{
}

/// <summary>
/// The start time in UTC of the events in the memory cache.
/// </summary>
public DateTime? EventStoreCacheStart { get; set; }

/// <summary>
/// The end time in UTC of the events in the memory cache.
/// </summary>
public DateTime? EventStoreCacheEnd { get; set; }

/// <summary>
/// The number of days of events able to fit in the memory cache.
/// </summary>
public double EventStoreDaysCached { get; set; }

/// <summary>
/// The number of events able to fit in the memory cache.
/// </summary>
public int EventStoreEventsCached { get; set; }

/// <summary>
/// Bytes of free space remaining on the disk used for event storage.
Expand Down Expand Up @@ -100,18 +80,8 @@ public ServerMetricsEntity()
public double SystemMemoryUtilization { get; set; }

/// <summary>
/// The number of SQL-style queries executed in the past minute.
/// The number of queries and searches executed in the past minute.
/// </summary>
public int QueriesPerMinute { get; set; }

/// <summary>
/// The number of time slices from SQL-style queries that could be read from cache in the past minute.
/// </summary>
public int QueryCacheTimeSliceHitsPerMinute { get; set; }

/// <summary>
/// The number of cached SQL query time slices invalidated in the past minute.
/// </summary>
public int QueryCacheInvalidationsPerMinute { get; set; }
}
}
11 changes: 0 additions & 11 deletions src/Seq.Api/Model/Shared/StatisticsPart.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,6 @@ public class StatisticsPart
/// </summary>
public TimeSpan Elapsed { get; set; }

/// <summary>
/// The number of events that were scanned in the search (and were not
/// able to be excluded based on index information or pre-filtering).
/// </summary>
public ulong ScannedEventCount { get; set; }

/// <summary>
/// The id of the last event inspected in the search.
/// </summary>
Expand All @@ -46,10 +40,5 @@ public class StatisticsPart
/// Status of the result set.
/// </summary>
public ResultSetStatus Status { get; set; }

/// <summary>
/// Whether it was necessary to read from disk in processing this request.
/// </summary>
public bool UncachedSegmentsScanned { get; set; }
}
}
2 changes: 1 addition & 1 deletion src/Seq.Api/Model/Users/SearchHistoryItemPart.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ public class SearchHistoryItemPart
/// </summary>
public SearchHistoryItemAction Action { get; set; }
}
}
}
22 changes: 0 additions & 22 deletions src/Seq.Api/ResourceGroups/AppsResourceGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,6 @@ public async Task<AppEntity> TemplateAsync(CancellationToken cancellationToken =
return await GroupGetAsync<AppEntity>("Template", cancellationToken: cancellationToken).ConfigureAwait(false);
}

/// <summary>
/// Add a new app.
/// </summary>
/// <param name="entity">The app to add.</param>
/// <param name="cancellationToken">A <see cref="CancellationToken"/> allowing the operation to be canceled.</param>
/// <returns>The app, with server-allocated properties such as <see cref="Entity.Id"/> initialized.</returns>
public async Task<AppEntity> AddAsync(AppEntity entity, CancellationToken cancellationToken = default)
{
return await GroupCreateAsync<AppEntity, AppEntity>(entity, cancellationToken: cancellationToken).ConfigureAwait(false);
}

/// <summary>
/// Remove an existing app.
/// </summary>
Expand All @@ -85,17 +74,6 @@ public async Task RemoveAsync(AppEntity entity, CancellationToken cancellationTo
await Client.DeleteAsync(entity, "Self", entity, cancellationToken: cancellationToken).ConfigureAwait(false);
}

/// <summary>
/// Update an existing app.
/// </summary>
/// <param name="entity">The app to update.</param>
/// <param name="cancellationToken">A <see cref="CancellationToken"/> allowing the operation to be canceled.</param>
/// <returns>A task indicating completion.</returns>
public async Task UpdateAsync(AppEntity entity, CancellationToken cancellationToken = default)
{
await Client.PutAsync(entity, "Self", entity, cancellationToken: cancellationToken).ConfigureAwait(false);
}

/// <summary>
/// Create a new app by installing a NuGet package.
/// </summary>
Expand Down
12 changes: 7 additions & 5 deletions src/Seq.Api/Seq.Api.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Description>Client library for the Seq HTTP API.</Description>
<VersionPrefix>2022.1.0</VersionPrefix>
<VersionPrefix>2023.1.0</VersionPrefix>
<Authors>Datalust;Contributors</Authors>
<TargetFrameworks>netstandard2.0;net6.0</TargetFrameworks>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
Expand All @@ -15,13 +15,15 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="Tavis.UriTemplates" Version="1.1.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
<PackageReference Include="Tavis.UriTemplates" Version="2.0.0" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="6.0.0" />
<PackageReference Include="Nullable" Version="1.3.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="7.0.0" />
<PackageReference Include="Nullable" Version="1.3.1" PrivateAssets="all">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit 3399980

Please sign in to comment.