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

feat(disk, diskutil): Add new metric type disk and diskutil #2811

Merged
merged 22 commits into from
Apr 10, 2024
Merged

Conversation

geigerj0
Copy link
Contributor

@geigerj0 geigerj0 commented Mar 31, 2024

Feature

This PR introduces two new metric types:

  • disk: scaling based on how many megabytes of the app disk is being used
  • diskutil: scaling based on how much percent of the app disk is being used

Example for disk

{
  "instance_min_count": 1,
  "instance_max_count": 3,
  "scaling_rules": [
    {
      "metric_type": "disk",
      "breach_duration_secs": 60,
      "threshold": 750, // ⬅️ scale up when app uses more than 750MB disk
      "operator": ">",
      "cool_down_secs": 60,
      "adjustment": "+1"
    },
    {
      "metric_type": "disk",
      "breach_duration_secs": 60,
      "threshold": 350, // ⬅️ scale down when app uses less than 350MB disk
      "operator": "<",
      "cool_down_secs": 60,
      "adjustment": "-1"
    }
  ]
}

Example for diskutil

{
  "instance_min_count": 1,
  "instance_max_count": 3,
  "scaling_rules": [
    {
      "metric_type": "diskutil",
      "breach_duration_secs": 60,
      "threshold": 75, // ⬅️ scale up when app uses more than 80% of its available disk
      "operator": ">",
      "cool_down_secs": 60,
      "adjustment": "+1"
    },
    {
      "metric_type": "diskutil",
      "breach_duration_secs": 60,
      "threshold": 35, // ⬅️ scale down when app uses less than 30% of its available disk
      "operator": "<",
      "cool_down_secs": 60,
      "adjustment": "-1"
    }
  ]
}

@geigerj0 geigerj0 added enhancement allow-acceptance-tests This label needs to be added to enable the acceptance tests to run. labels Mar 31, 2024
@geigerj0 geigerj0 marked this pull request as ready for review April 2, 2024 13:56
jobs/golangapiserver/spec Outdated Show resolved Hide resolved
jobs/golangapiserver/spec Outdated Show resolved Hide resolved
Copy link
Contributor

@asalan316 asalan316 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link

sonarcloud bot commented Apr 10, 2024

Quality Gate Passed Quality Gate passed

Issues
4 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@geigerj0 geigerj0 enabled auto-merge (squash) April 10, 2024 07:11
@geigerj0 geigerj0 disabled auto-merge April 10, 2024 07:11
@geigerj0 geigerj0 enabled auto-merge (squash) April 10, 2024 07:11
@geigerj0 geigerj0 merged commit 779a6b2 into main Apr 10, 2024
38 checks passed
@geigerj0 geigerj0 deleted the aas710-2 branch April 10, 2024 07:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
allow-acceptance-tests This label needs to be added to enable the acceptance tests to run. enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants