Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename collectmetrics back to livemetrics #855

Merged
merged 1 commit into from
Sep 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion documentation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ When running a dotnet application, differences in diverse local and production e
- [`/gcdump`](./api/gcdump.md)
- [`/trace`](./api/trace.md)
- [`/metrics`](./api/metrics.md)
- [`/collectmetrics`](./api/collectmetrics.md)
- [`/livemetrics`](./api/livemetrics.md)
- [`/logs`](./api/logs.md)
- [`/info`](./api/info.md)
- [`/operations`](.api/operations.md)
Expand Down
6 changes: 0 additions & 6 deletions documentation/api/collectmetrics.md

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Collectmetrics - Get Custom
# Livemetrics - Get Custom

Captures metrics for a process, with the ability to specify custom metrics.

## HTTP Route

```http
POST /collectmetrics?pid={pid}&uid={uid}&name={name}&metricsIntervalSeconds={metricsIntervalSeconds}&durationSeconds={durationSeconds}&egressProvider={egressProvider} HTTP/1.1
POST /livemetrics?pid={pid}&uid={uid}&name={name}&metricsIntervalSeconds={metricsIntervalSeconds}&durationSeconds={durationSeconds}&egressProvider={egressProvider} HTTP/1.1
```

> **NOTE:** Process information (IDs, names, environment, etc) may change between invocations of these APIs. Processes may start or stop between API invocations, causing this information to change.
Expand Down Expand Up @@ -58,7 +58,7 @@ The expected content type is `application/json`.
### Sample Request

```http
GET /collectmetrics?pid=21632&metricsIntervalSeconds=10&durationSeconds=60 HTTP/1.1
GET /livemetrics?pid=21632&metricsIntervalSeconds=10&durationSeconds=60 HTTP/1.1
Host: localhost:52323
Authorization: Bearer fffffffffffffffffffffffffffffffffffffffffff=

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Collectmetrics - Get
# Livemetrics - Get

Captures metrics for a chosen process.

Expand All @@ -7,7 +7,7 @@ Captures metrics for a chosen process.
## HTTP Route

```http
GET /collectmetrics?pid={pid}&uid={uid}&name={name}&metricsIntervalSeconds={metricsIntervalSeconds}&durationSeconds={durationSeconds}&egressProvider={egressProvider} HTTP/1.1
GET /livemetrics?pid={pid}&uid={uid}&name={name}&metricsIntervalSeconds={metricsIntervalSeconds}&durationSeconds={durationSeconds}&egressProvider={egressProvider} HTTP/1.1
```

> **NOTE:** Process information (IDs, names, environment, etc) may change between invocations of these APIs. Processes may start or stop between API invocations, causing this information to change.
Expand Down Expand Up @@ -54,7 +54,7 @@ Allowed schemes:
### Sample Request

```http
GET /collectmetrics?pid=21632&metricsIntervalSeconds=10&durationSeconds=60 HTTP/1.1
GET /livemetrics?pid=21632&metricsIntervalSeconds=10&durationSeconds=60 HTTP/1.1
Host: localhost:52323
Authorization: Bearer fffffffffffffffffffffffffffffffffffffffffff=
```
Expand Down
6 changes: 6 additions & 0 deletions documentation/api/livemetrics.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Live Metrics

| Operation | Description |
|---|---|
| [Live Metrics](livemetrics-get.md) | Captures metrics using the default metric providers. |
| [Live Custom Metrics](livemetrics-custom.md) | Captures metrics using custom metric providers. |
2 changes: 1 addition & 1 deletion documentation/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,7 @@
}
}
},
"/collectmetrics": {
"/livemetrics": {
"get": {
"tags": [
"Diag"
Expand Down
2 changes: 1 addition & 1 deletion documentation/releaseNotes/releaseNotes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Today we are releasing the next official preview of the `dotnet-monitor` tool. This release includes:

- Added a new HTTP route (`/collectmetrics`) to collect metrics on demand. (#68)
- Added a new HTTP route (`/livemetrics`) to collect metrics on demand. (#68)

\*⚠️ **_indicates a breaking change_**
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ partial class DiagController
/// <param name="durationSeconds">The duration of the metrics session (in seconds).</param>
/// <param name="metricsIntervalSeconds">The reporting interval (in seconds) for event counters.</param>
/// <param name="egressProvider">The egress provider to which the metrics are saved.</param>
[HttpGet("collectmetrics", Name = nameof(CaptureMetrics))]
[HttpGet("livemetrics", Name = nameof(CaptureMetrics))]
[ProducesWithProblemDetails(ContentTypes.ApplicationJsonSequence)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status429TooManyRequests)]
[ProducesResponseType(typeof(void), StatusCodes.Status202Accepted)]
Expand Down Expand Up @@ -91,7 +91,7 @@ public Task<ActionResult> CaptureMetrics(
/// <param name="durationSeconds">The duration of the metrics session (in seconds).</param>
/// <param name="metricsIntervalSeconds">The reporting interval (in seconds) for event counters.</param>
/// <param name="egressProvider">The egress provider to which the metrics are saved.</param>
[HttpPost("collectmetrics", Name = nameof(CaptureMetricsCustom))]
[HttpPost("livemetrics", Name = nameof(CaptureMetricsCustom))]
[ProducesWithProblemDetails(ContentTypes.ApplicationJsonSequence)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status429TooManyRequests)]
[ProducesResponseType(typeof(void), StatusCodes.Status202Accepted)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public partial class DiagController : ControllerBase
public const string ArtifactType_GCDump = "gcdump";
public const string ArtifactType_Logs = "logs";
public const string ArtifactType_Trace = "trace";
public const string ArtifactType_Metrics = "collectmetrics";
public const string ArtifactType_Metrics = "livemetrics";

private const Models.TraceProfile DefaultTraceProfiles = Models.TraceProfile.Cpu | Models.TraceProfile.Http | Models.TraceProfile.Metrics;
private static readonly MediaTypeHeaderValue NdJsonHeader = new MediaTypeHeaderValue(ContentTypes.ApplicationNdJson);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ public Task<ResponseStreamHolder> CaptureMetricsAsync(int processId, int duratio

private async Task<ResponseStreamHolder> CaptureMetricsAsync(int processId, int durationSeconds, int refreshInterval, HttpMethod method, HttpContent content, CancellationToken token)
{
string uri = FormattableString.Invariant($"/collectmetrics?pid={processId}&durationSeconds={durationSeconds}&metricsIntervalSeconds={refreshInterval}");
string uri = FormattableString.Invariant($"/livemetrics?pid={processId}&durationSeconds={durationSeconds}&metricsIntervalSeconds={refreshInterval}");

using HttpRequestMessage request = new(method, uri);
request.Headers.Add(HeaderNames.Accept, ContentTypes.ApplicationJsonSequence);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@
namespace Microsoft.Diagnostics.Monitoring.Tool.FunctionalTests
{
[Collection(DefaultCollectionFixture.Name)]
public class CollectMetricsTests
public class LiveMetricsTests
{
private readonly IHttpClientFactory _httpClientFactory;
private readonly ITestOutputHelper _outputHelper;

public CollectMetricsTests(ITestOutputHelper outputHelper, ServiceProviderFixture serviceProviderFixture)
public LiveMetricsTests(ITestOutputHelper outputHelper, ServiceProviderFixture serviceProviderFixture)
{
_httpClientFactory = serviceProviderFixture.ServiceProvider.GetService<IHttpClientFactory>();
_outputHelper = outputHelper;
Expand Down