This repository has been archived by the owner on Oct 12, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature: Pre aggregate metrics to reduce cost (#33)
- Loading branch information
1 parent
0df71bb
commit 3c5a89c
Showing
9 changed files
with
132 additions
and
22 deletions.
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
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
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
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
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package batchinsights_test | ||
|
||
import ( | ||
"github.com/Azure/batch-insights/pkg" | ||
"github.com/Microsoft/ApplicationInsights-Go/appinsights" | ||
"github.com/stretchr/testify/assert" | ||
"testing" | ||
) | ||
|
||
func TestGetMetricId(t *testing.T) { | ||
metric := appinsights.NewMetricTelemetry("Disk usage", 134) | ||
metric.Properties["Some #"] = "4" | ||
metric.Properties["Other #"] = "5" | ||
|
||
assert.Equal(t, "Disk usage/Some #=4,Other #=5", batchinsights.GetMetricId(metric)) | ||
|
||
metric = appinsights.NewMetricTelemetry("Disk IO", 543) | ||
assert.Equal(t, "Disk IO/", batchinsights.GetMetricId(metric)) | ||
} |
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
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,3 +1,5 @@ | ||
// +build windows | ||
|
||
package wmi | ||
|
||
import ( | ||
|
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,11 +1,27 @@ | ||
## Script to be used as one liner | ||
# Script to be used as one liner | ||
|
||
# For linux | ||
### For linux | ||
|
||
* `run-linux.sh`: Run a published version for linux | ||
* `dev.sh`: Will install go, git then build and run on the fly | ||
|
||
|
||
# For windows | ||
### For windows | ||
* `run-windows.ps1`: Run a publush version for windows | ||
* `dev-windows.ps1`: Will install go, git then build and run on the fly | ||
* `dev-windows.ps1`: Will install go, git then build and run on the fly | ||
|
||
|
||
## Development | ||
There is some dev script that will install go and other needed dependencies to build and run this project on the fly. | ||
Set `BATCH_INSIGHTS_BRANCH` environment variable to the branch you are testing | ||
|
||
On linux | ||
```bash | ||
/bin/bash -c 'wget -O - https://raw.githubusercontent.com/Azure/batch-insights/$BATCH_INSIGHTS_BRANCH/scripts/dev.sh | bash' | ||
``` | ||
|
||
On windows | ||
|
||
```powershell | ||
cmd /c @"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/Azure/batch-insights/$env:BATCH_INSIGHTS_BRANCH/dev-windows.ps1'))" | ||
``` |
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