5 instantiations of AgentTelemetryHook
Aspire.Cli.Tests (5)
Agents\AgentTelemetryHookTests.cs (5)
84
var hook = new
AgentTelemetryHook
(new TestEnvironment());
103
var hook = new
AgentTelemetryHook
(new TestEnvironment(new Dictionary<string, string?>
152
var hook = new
AgentTelemetryHook
(new TestEnvironment(new Dictionary<string, string?>
226
var hook = new
AgentTelemetryHook
(new TestEnvironment(new Dictionary<string, string?>
250
var hook = new
AgentTelemetryHook
(new TestEnvironment(new Dictionary<string, string?>
46 references to AgentTelemetryHook
aspire (7)
Agents\ClaudeCode\ClaudeCodeAgentClient.cs (2)
180
var (command, args) =
AgentTelemetryHook
.GetCommand(AgentTelemetryProtocol.HookOptionName);
249
var (currentCommand, _) =
AgentTelemetryHook
.GetCommand(AgentTelemetryProtocol.HookOptionName);
Agents\Copilot\CopilotAgentClient.cs (1)
127
var (command, args) =
AgentTelemetryHook
.GetCommand(AgentTelemetryProtocol.HookOptionName);
Commands\AgentTelemetryCommand.cs (2)
36
private readonly
AgentTelemetryHook
_hook;
93
AgentTelemetryHook
hook, IEnvironment environment, ConsoleEnvironment console)
Program.cs (1)
744
builder.Services.AddSingleton<Agents.Hooks.
AgentTelemetryHook
>();
Telemetry\AgentTelemetryUploader.cs (1)
40
var (command, args) =
AgentTelemetryHook
.GetCommand(AgentTelemetryProtocol.DrainOptionName);
Aspire.Cli.Tests (39)
Agents\AgentTelemetryHookTests.cs (32)
21
Assert.Null(
AgentTelemetryHook
.Classify(payload, new TestEnvironment(),
AgentTelemetryHook
.DefaultMaxPayloadCharacters));
31
var args =
AgentTelemetryHook
.Classify($$"""{"{{nameProperty}}":"{{tool}}","{{inputProperty}}":{{input}}}""", new TestEnvironment(),
AgentTelemetryHook
.DefaultMaxPayloadCharacters);
44
var args =
AgentTelemetryHook
.Classify(
47
AgentTelemetryHook
.DefaultMaxPayloadCharacters);
64
var args =
AgentTelemetryHook
.Classify(
67
AgentTelemetryHook
.DefaultMaxPayloadCharacters);
77
Assert.NotNull(
AgentTelemetryHook
.Classify(payload, new TestEnvironment(), payload.Length));
78
Assert.Null(
AgentTelemetryHook
.Classify(payload, new TestEnvironment(), payload.Length - 1));
84
var
hook = new AgentTelemetryHook(new TestEnvironment());
103
var
hook = new AgentTelemetryHook(new TestEnvironment(new Dictionary<string, string?>
120
var args =
AgentTelemetryHook
.Classify("""{"toolName":"aspire-list_resources","toolArgs":"not json"}""", new TestEnvironment(),
AgentTelemetryHook
.DefaultMaxPayloadCharacters);
131
var args =
AgentTelemetryHook
.Classify(
133
new TestEnvironment(),
AgentTelemetryHook
.DefaultMaxPayloadCharacters);
152
var
hook = new AgentTelemetryHook(new TestEnvironment(new Dictionary<string, string?>
183
using var stream = typeof(
AgentTelemetryHook
).Assembly.GetManifestResourceStream("track-telemetry.ps1")!;
198
[InlineData(null,
AgentTelemetryHook
.DefaultMaxPayloadCharacters)]
201
[InlineData("1048576",
AgentTelemetryHook
.MaximumPayloadCharacters)]
204
Assert.Equal(expected,
AgentTelemetryHook
.GetMaxPayloadCharacters(value));
216
var exception = Assert.Throws<ArgumentException>(() =>
AgentTelemetryHook
.GetMaxPayloadCharacters(value));
217
Assert.Contains(
AgentTelemetryHook
.PayloadLimitEnvironmentVariable, exception.Message);
226
var
hook = new AgentTelemetryHook(new TestEnvironment(new Dictionary<string, string?>
228
[
AgentTelemetryHook
.PayloadLimitEnvironmentVariable] = payload.Length.ToString(System.Globalization.CultureInfo.InvariantCulture)
250
var
hook = new AgentTelemetryHook(new TestEnvironment(new Dictionary<string, string?>
252
[
AgentTelemetryHook
.PayloadLimitEnvironmentVariable] = "0"
259
Assert.Contains(
AgentTelemetryHook
.PayloadLimitEnvironmentVariable, error.ToString());
267
var padded = payload.PadRight(
AgentTelemetryHook
.DefaultMaxPayloadCharacters + 1);
268
Assert.Null(
AgentTelemetryHook
.Classify(padded, new TestEnvironment(),
AgentTelemetryHook
.DefaultMaxPayloadCharacters));
269
Assert.NotNull(
AgentTelemetryHook
.Classify(padded, new TestEnvironment(), padded.Length));
Agents\TelemetryHookConfiguratorTests.cs (4)
40
var (command, args) =
AgentTelemetryHook
.GetCommand("--hook");
126
var (command, args) =
AgentTelemetryHook
.GetCommand("--hook");
201
Assert.Equal(
AgentTelemetryHook
.GetCommand("--hook").Args,
272
var (command, args) =
AgentTelemetryHook
.GetCommand("--hook");
Agents\TelemetryHookScriptTests.cs (2)
552
? null :
AgentTelemetryHook
.Classify(payload, nativeEnvironment,
AgentTelemetryHook
.DefaultMaxPayloadCharacters);
Utils\CliTestHelper.cs (1)
146
services.AddSingleton<
AgentTelemetryHook
>();