Skip to content
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

test: configure pipeline to run scale test and publish data to app insights #1014

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

alexcastilio
Copy link
Contributor

@alexcastilio alexcastilio commented Nov 15, 2024

Description

Configure pipeline to run scale test and publish data to app insights.
Data published:
timestamp, pod, podCpuInMilliCore, PodMemoryInMB, PodRestarts, node, nodeCpuInMilliCore, nodeMemoryInMB, retinaVersion, clusterName

Related Issue

If this pull request is related to any issue, please mention it here. Additionally, make sure that the issue is assigned to you before submitting this pull request.

Checklist

  • I have read the contributing documentation.
  • I signed and signed-off the commits (git commit -S -s ...). See this documentation on signing commits.
  • I have correctly attributed the author(s) of the code.
  • I have tested the changes locally.
  • I have followed the project's style guidelines.
  • I have updated the documentation, if necessary.
  • I have added tests, if applicable.

Screenshots (if applicable) or Testing Completed

Please add any relevant screenshots or GIFs to showcase the changes made.

Additional Notes

Add any additional notes or context about the pull request here.


Please refer to the CONTRIBUTING.md file for more information on how to contribute to this project.

Signed-off-by: Alex Castilio dos Santos <[email protected]>
@alexcastilio alexcastilio requested a review from a team as a code owner November 15, 2024 12:22
@alexcastilio alexcastilio force-pushed the alexcastilio/scale-test branch 2 times, most recently from 7135f75 to 0466961 Compare November 15, 2024 14:00
Copy link
Contributor

@ritwikranjan ritwikranjan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor comments, looks great overall!

return nil
}

type metric map[string]string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

metric would be numerical values no? wouldn't it be better to enforce that with something like map[string]float64?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's map[string]string because TrackEvent method takes that type as input

require.NotEmpty(t, os.Getenv("APP_INSIGHTS_KEY"))

opt.LabelsToGetMetrics = map[string]string{"k8s-app": "retina"}

// CreateTestInfra
createTestInfra := types.NewRunner(t, jobs.CreateTestInfra(subID, rg, clusterName, location, kubeConfigFilePath, *createInfra))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it feasible to create and delete clusters for scale tests during test runs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part is not yet agreed. Right now this pipeline execution is not automatically triggered by any event, only manual execution, so a cluster can be provided to run the test.

I will delete Cluster creation for now to avoid any confusion since this is not being used.


func (g *GetAndPublishMetrics) Prevalidate() error {
if g.AppInsightsKey == "" {
return fmt.Errorf("AppInsightsKey is required")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to have the possibility to just log the metrics if the key not present for local test/run?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think just logging it would be a good approach as there are many other log messages that would hide this data and make it useless, but optionally output these metrics to a file could be useful. I'll add that.

@alexcastilio alexcastilio force-pushed the alexcastilio/scale-test branch 3 times, most recently from 514a449 to bf6e4a4 Compare November 15, 2024 16:08
Signed-off-by: Alex Castilio dos Santos <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants