-
Notifications
You must be signed in to change notification settings - Fork 435
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' of github.com:tailwarden/komiser into improve-…
…dashboard-readme
- Loading branch information
Showing
12 changed files
with
515 additions
and
229 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the | ||
// README at: https://github.com/devcontainers/templates/tree/main/src/go | ||
{ | ||
"name": "Go", | ||
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile | ||
"image": "mcr.microsoft.com/devcontainers/go:1-1.21-bullseye", | ||
"features": { | ||
"ghcr.io/devcontainers-contrib/features/node-asdf:0": {}, | ||
"ghcr.io/devcontainers-contrib/features/typescript:2": {} | ||
}, | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"golang.go-nightly", | ||
"bradlc.vscode-tailwindcss" | ||
] | ||
} | ||
} | ||
|
||
// Features to add to the dev container. More info: https://containers.dev/features. | ||
// "features": {}, | ||
|
||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
// "forwardPorts": [], | ||
|
||
// Use 'postCreateCommand' to run commands after the container is created. | ||
// "postCreateCommand": "go version", | ||
|
||
// Configure tool-specific properties. | ||
// "customizations": {}, | ||
|
||
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. | ||
// "remoteUser": "root" | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
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,37 @@ | ||
package internal | ||
|
||
import ( | ||
"context" | ||
"io" | ||
"testing" | ||
|
||
log "github.com/sirupsen/logrus" | ||
|
||
"github.com/tailwarden/komiser/internal/config" | ||
"github.com/tailwarden/komiser/utils" | ||
) | ||
|
||
// BenchmarkFactorial benchmarks the Factorial function. | ||
func BenchmarkFetchResources(b *testing.B) { | ||
// Setup | ||
ctx := context.TODO() | ||
log.SetOutput(io.Discard) | ||
analytics.Init() | ||
cfg, clients, accounts, err := config.Load("/workspaces/komiser/config.toml", false, analytics, db) | ||
if err != nil { | ||
b.Fatalf("Error during config setup: %v", err) | ||
} | ||
err = setupDBConnection(cfg) | ||
if err != nil { | ||
b.Fatalf("Error during DB setup: %v", err) | ||
} | ||
err = utils.SetupSchema(db, cfg, accounts) | ||
if err != nil { | ||
b.Fatalf("Error during schema setup: %v", err) | ||
} | ||
|
||
// The benchmark function will run b.N times | ||
for i := 0; i < b.N; i++ { | ||
fetchResources(ctx, clients, []string{}, false) | ||
} | ||
} |
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
Oops, something went wrong.