https://github.com/kfrancis/k6-aspire-hosting
k6 functionality for .NET Aspire
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (10.7%) to scientific vocabulary
Repository
k6 functionality for .NET Aspire
Basic Info
- Host: GitHub
- Owner: kfrancis
- License: mit
- Language: C#
- Default Branch: main
- Size: 385 KB
Statistics
- Stars: 9
- Watchers: 2
- Forks: 1
- Open Issues: 1
- Releases: 3
Metadata Files
README.md
k6-aspire-hosting
A suite of .NET libraries for integrating Grafana k6 load testing into .NET Aspire applications.
Overview
This repository contains a collection of libraries designed to seamlessly integrate Grafana k6 load testing into .NET Aspire applications. It enables developers to define, run, and visualize load tests as part of their Aspire application infrastructure.
Packages
| Package | Description | NuGet | Status |
| ------- | ----------- | ----- | ------ |
| CSS.K6.Hosting.Core | Core components for k6 integration | | Functional |
| CSS.K6.Hosting.Aspire | Main integration for k6 in Aspire |
| Functional |
| CSS.K6.Hosting.Outputs.Grafana | Grafana dashboards for visualizing metrics |
| Functional |
| CSS.K6.Hosting.Outputs.InfluxDB | InfluxDB support for storing metrics |
| Functional |
| CSS.K6.Hosting.Outputs.Aspire | Aspire support for storing metrics |
| WIP |
Quick Start
1. Install the package
bash
dotnet add package CSS.K6.Hosting.Aspire
2. Add k6 to your Aspire application
Create a k6 test script file in your project (e.g., scripts/load-test.js):
```javascript import http from "k6/http"; import { check, sleep } from "k6";
export default function () {
// Get API information from environment
const apiHost = __ENV.APP_HOST;
const apiScheme = __ENV.APP_ENDPOINT_SCHEME;
// Construct the base URL
const baseUrl = `${apiScheme}://${apiHost}`;
console.log(`Testing API at: ${baseUrl}`);
const response = http.get(`${baseUrl}/weatherforecast`);
check(response, {
'status is 200': (r) => r.status === 200
});
sleep(10);
} ```
Add k6 to your Aspire host application:
```csharp var builder = DistributedApplication.CreateBuilder(args);
// Add your API project
var apiProject = builder.AddProject
// Add k6 for load testing builder.AddK6("k6") .WithScript("./scripts/test.js") .WithApiEndpoint(api) .WaitFor(api);
await builder.Build().RunAsync(); ```
Then simply run k6 on the Aspire dashboard:

Features
- Simple Integration: Add k6 load testing to .NET Aspire with minimal configuration
- API Testing: Automatically test APIs defined in your Aspire application
- Visualization: Built-in support for Grafana dashboards
- Metric Storage: Store test results in InfluxDB for analysis
- Docker-based: Leverages Docker containers for consistent testing environments
Requirements
- .NET 8.0 or .NET 9.0
- .NET Aspire
- Docker (for running containers)
Documentation
For more detailed documentation, see the README files in each package directory:
- K6.Hosting.Core
- K6.Hosting.Aspire
- K6.Hosting.Outputs.Grafana
- K6.Hosting.Outputs.InfluxDB
- K6.Hosting.Outputs.InfluxDB
Examples
See the samples directory for sample applications demonstrating how to use these libraries.
For visualization with Grafana:
bash
dotnet add package CSS.K6.Hosting.Outputs.Grafana
For metrics storage with InfluxDB:
bash
dotnet add package CSS.K6.Hosting.Outputs.InfluxDB
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
References
License
This project is licensed under the MIT License - see the LICENSE file for details.
Owner
- Name: Kori Francis
- Login: kfrancis
- Kind: user
- Location: Kingston, Ontario
- Company: Clinical Support Systems
- Twitter: djbyter
- Repositories: 127
- Profile: https://github.com/kfrancis
CTO of Clinical Support Systems, father and musician. Message me @kori@c.im npub1rtf5az4zvh04h4ssddzntf4gy55pg8hasq97kddkgy7h4q5cws0sv9fttd
GitHub Events
Total
- Create event: 7
- Issues event: 1
- Release event: 3
- Watch event: 6
- Issue comment event: 1
- Member event: 1
- Push event: 21
- Fork event: 1
Last Year
- Create event: 7
- Issues event: 1
- Release event: 3
- Watch event: 6
- Issue comment event: 1
- Member event: 1
- Push event: 21
- Fork event: 1
Committers
Last synced: 12 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Kori Francis | k****s@c****m | 21 |
| Tomonobu Fukuhara | f****r@g****m | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 10 months ago
All Time
- Total issues: 1
- Total pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Total issue authors: 1
- Total pull request authors: 0
- Average comments per issue: 1.0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 1
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 1
- Pull request authors: 0
- Average comments per issue: 1.0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- anddrzejb (1)
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 4
- Total downloads: unknown
-
Total dependent packages: 0
(may contain duplicates) -
Total dependent repositories: 0
(may contain duplicates) - Total versions: 8
nuget.org: css.k6.hosting.outputs.influxdb
InfluxDB output provider for storing and querying k6 load test metrics in .NET Aspire applications.
- Homepage: https://github.com/kfrancis/k6-aspire-hosting
- License: MIT
-
Latest release: 0.1.2-beta
published over 1 year ago
Rankings
nuget.org: css.k6.hosting.outputs.grafana
Grafana dashboard integration for visualizing k6 load test results in .NET Aspire applications.
- Homepage: https://github.com/kfrancis/k6-aspire-hosting
- License: MIT
-
Latest release: 0.1.2-beta
published over 1 year ago
Rankings
nuget.org: css.k6.hosting.aspire
Integration for running Grafana k6 load tests within .NET Aspire applications.
- Homepage: https://github.com/kfrancis/k6-aspire-hosting
- License: MIT
-
Latest release: 0.1.2-beta
published over 1 year ago
Rankings
nuget.org: css.k6.hosting.core
Core components for integrating Grafana k6 load testing into .NET Aspire applications.
- Homepage: https://github.com/kfrancis/k6-aspire-hosting
- License: MIT
-
Latest release: 0.1.2-beta
published over 1 year ago
Rankings
Dependencies
- actions/checkout v4.2.2 composite
- actions/download-artifact v4.1.8 composite
- actions/setup-dotnet v4.2.0 composite
- actions/upload-artifact v4.6.0 composite
- Aspire.Hosting.AppHost 9.1.0
- Microsoft.Extensions.Http.Resilience 9.2.0
- Microsoft.Extensions.ServiceDiscovery 9.1.0
- OpenTelemetry.Exporter.OpenTelemetryProtocol 1.11.1
- OpenTelemetry.Extensions.Hosting 1.11.1
- OpenTelemetry.Instrumentation.AspNetCore 1.11.0
- OpenTelemetry.Instrumentation.Http 1.11.0
- OpenTelemetry.Instrumentation.Runtime 1.11.0
- Aspire.Hosting.AppHost 9.1.0
- Microsoft.Extensions.Http.Resilience 9.2.0
- Microsoft.Extensions.ServiceDiscovery 9.1.0
- OpenTelemetry.Exporter.OpenTelemetryProtocol 1.11.1
- OpenTelemetry.Extensions.Hosting 1.11.1
- OpenTelemetry.Instrumentation.AspNetCore 1.11.0
- OpenTelemetry.Instrumentation.Http 1.11.0
- OpenTelemetry.Instrumentation.Runtime 1.11.0
- DotNet.ReproducibleBuilds 1.2.25 development
- MinVer 6.0.0 development
- DotNet.ReproducibleBuilds 1.2.25 development
- MinVer 6.0.0 development
- Aspire.Hosting 9.1.0
- DotNet.ReproducibleBuilds 1.2.25 development
- MinVer 6.0.0 development
- DotNet.ReproducibleBuilds 1.2.25 development
- MinVer 6.0.0 development
- OpenTelemetry.Exporter.OpenTelemetryProtocol 1.11.2