-
Notifications
You must be signed in to change notification settings - Fork 4
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
Rephrasing documentation for clariry. #35
Open
letItCurl
wants to merge
2
commits into
agoda-com:master
Choose a base branch
from
letItCurl:rephrase-documentation
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,77 @@ | ||
# Dotnet Build Metrics | ||
|
||
This is a custom MSBuild task that will measure the time to build each project and publishes the information to a datastore. The intent is to measure and improve developer experience on local workstations. | ||
## Overview | ||
|
||
**_Username and hostname are collected as a part of build information_** | ||
Dotnet Build Metrics is a custom MSBuild task that measures the time to build each project and publishes the information to a datastore. The intent is to measure and improve developer experience on local workstations. | ||
|
||
``` | ||
{ | ||
"id": "026fe42b-7888-4a76-81ee-2ab431ae4987", | ||
"userName": "aanand", | ||
"cpuCount": 12, | ||
"hostname": "25BVM13", | ||
"platform": 2, | ||
"os": "Microsoft Windows NT 10.0.19042.0", | ||
"timeTaken": "453", | ||
"branch": "master", | ||
"type": ".Net", | ||
"projectName": "Agoda.Cronos.Accommodation", | ||
"repository": "[email protected]:front-end/dotnet-build-metrics.git", | ||
"date": "2021-06-28T02:53:22.1420552Z" | ||
} | ||
``` | ||
**_The tool collects username and hostname as a part of build information. [See example payload](#data-sent-to-the-datastore)_** | ||
|
||
## Installation | ||
|
||
To use the task simply install the [`Agoda.Builds.Metrics` NuGet package](https://www.nuget.org/packages/Agoda.Builds.Metrics) to all of the projects in your solution, this will automatically enable metrics publication for that project. | ||
To use the task, install the [Agoda.Builds.Metrics NuGet package](https://www.nuget.org/packages/Agoda.Builds.Metrics) to all projects in your solution. This will automatically enable metrics publication for that project. | ||
|
||
Web API URL and the name of the endpoint are taken from environment variables if they are present as per the following table: | ||
## Configuration | ||
|
||
|Parameter |Environment Variable |Default Value | | ||
|-----------------------|-------------------------|-------------------------------------| | ||
|Elastic Search Endpoint|BUILD_METRICS_ES_ENDPOINT|http://compilation-metrics/dotnet | | ||
Web API URL and the name of the endpoint are taken from environment variables. If they are present, they will override the defaults as per the following table: | ||
|
||
We recommend create a CNAME on your internal DNS servers for compilation-metrics to point at an internal API that captures the data and stores it. | ||
| Parameter | Environment Variable | Default Value | | ||
| --- | --- | --- | | ||
| Elastic Search Endpoint | BUILD_METRICS_ES_ENDPOINT | http://compilation-metrics/dotnet | | ||
|
||
Example build log output in Visual Studio using MSBuild. | ||
We recommend creating a CNAME on your internal DNS servers for `compilation-metrics` to point at an internal API that captures the data and stores it. | ||
|
||
## Example Output | ||
|
||
### Visual Studio | ||
|
||
Example build log output in Visual Studio using MSBuild: | ||
|
||
![](doc/img/VSBuildOutput.PNG) | ||
|
||
Example build log output in Dotnet core CLI. | ||
### .NET Core CLI | ||
|
||
Example build log output in .NET Core CLI: | ||
|
||
![](doc/img/DotnetCLIBuildTimeOutput.PNG) | ||
|
||
## Agoda.DevFeedback.AspNetStartup NuGet Package | ||
|
||
### Overview | ||
|
||
### Agoda.DevFeedback.AspNetStartup NuGet package | ||
The goal of the Agoda.DevFeedback.AspNetStartup NuGet package is to measure the application startup time as an additional metric that affects developer feedback besides build time. Monoliths are especially prone to slow startup times on developer laptops, and this provides visibility and tracking of improvements/regressions thereof. | ||
|
||
The goal of this package is to measure the application startup time as an additional metrics that affects developer feedback besides build time. | ||
Monoliths are especially prone to slow startup times on developer laptops and this provides visibility and tracking of improvements/regressions thereof. | ||
### Measurement | ||
|
||
This package measures the ASP.NET application's startup time in two ways. | ||
1) The time from WebHostBuilder ConfigureServices until HostApplicationLifetime OnStarted sent with type '.AspNetStartup'. | ||
2) The time from WebHostBuilder ConfigureServices until the first HTTP Reponse (measured from middleware) sent with type '.AspNetResponse'. | ||
This package measures the [ASP.NET](http://asp.net/) application's startup time in two ways: | ||
|
||
Two environment variables are required to be set to enable the measurements. | ||
1) `ASPNETCORE_ENVIRONMENT` needs to be set as `Development` for the functionality to be added. This is so it's only enabled locally and not on production. | ||
2) `ASPNETCORE_HOSTINGSTARTUPASSEMBLIES` needs to be/include `Agoda.DevFeedback.AspNetStartup`. This is for package activation due to the use of [HostingStartup](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.hosting.hostingstartupattribute?view=aspnetcore-6.0). | ||
1. The time from WebHostBuilder ConfigureServices until HostApplicationLifetime OnStarted sent with type '.AspNetStartup'. | ||
2. The time from WebHostBuilder ConfigureServices until the first HTTP Response (measured from middleware) sent with type '.AspNetResponse'. | ||
|
||
For convenience these environment variables can be set under the lauch profile of the web application's `launchSettings.json` file and committed to the repository. | ||
### Configuration | ||
|
||
Two environment variables are required to be set to enable measurements: | ||
|
||
1. `ASPNETCORE_ENVIRONMENT` needs to be set as `Development` for the functionality to be added. This is so it's only enabled locally and not on production. | ||
2. `ASPNETCORE_HOSTINGSTARTUPASSEMBLIES` needs to include `Agoda.DevFeedback.AspNetStartup`. This is for package activation due to the use of [HostingStartup](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.hosting.hostingstartupattribute?view=aspnetcore-6.0). | ||
|
||
For convenience, these environment variables can be set under the launch profile of the web application's `launchSettings.json` file and committed to the repository. | ||
|
||
### Data sent to the datastore | ||
> This is an example payload sent to the datastore. | ||
|
||
``` | ||
{ | ||
"id": "026fe42b-7888-4a76-81ee-2ab431ae4987", | ||
"userName": "aanand", | ||
"cpuCount": 12, | ||
"hostname": "25BVM13", | ||
"platform": 2, | ||
"os": "Microsoft Windows NT 10.0.19042.0", | ||
"timeTaken": "453", | ||
"branch": "master", | ||
"type": ".Net", | ||
"projectName": "Agoda.Cronos.Accommodation", | ||
"repository": "[email protected]:front-end/dotnet-build-metrics.git", | ||
"date": "2021-06-28T02:53:22.1420552Z" | ||
} | ||
``` |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's gone beyond this. We also have Web server startup time and the test data collection in the repo now.
I think the "build time" I would rephrase (for dotnet) to "the F5 experience". Because it's commonly known to dotnet developers that F5 is the should cut ket to debug your application.
The other part is test run data collection.
Overall the goal is around measuring and improving developer local experience
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, It feels like the base work needed more than just rephrasing.
Let me rework that.