GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — compute: implement autoscaler by stephenplusplus · Pull Request #1137 · googleapis/google-cloud-node

Conversation

@stephenplusplus

@stephenplusplus stephenplusplus commented Feb 26, 2016

Copy link
Copy Markdown
Contributor

For #1073

Fixes #1152

Implements Autoscaler support.

To Dos

  • Docs
  • Tests
    • System
      • Figure out how to create an instance group before the tests run
    • Unit
      • autoscaler.js
      • index.js
      • zone.js

Creating an autoscaler...

// Easy way
var config = {
  coolDown: 30,
  cpu: 80,
  loadBalance: 40,
  maxReplicas: 5,
  minReplicas: 0,
  target: 'instance-group-name'
};

// Hard (but supported) way
var config = {
  autoscalingPolicy: {
    coolDownPeriodSec: 30,
    cpuUtilization: {
      utilizationTarget: 0.8
    },
    loadBalancingUtilization: {
      utilizationTarget: 0.4
    },
    maxNumReplicas: 5,
    minNumReplicas: 0
  },
  target: 'https://content.googleapis.com/compute/v1/projects/{PROJECT_ID}/zones/{ZONE_ID}/instanceGroupMangers/instance-group-name'
};

var zone = compute.zone('us-central1-a');
zone.createAutoscaler('autoscaler-namer', config, function(err, operation, autoscaler, apiResponse) {
  // ...
});

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@stephenplusplus stephenplusplus added the api: compute Issues related to the Compute Engine API. label Feb 26, 2016
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Feb 26, 2016
@stephenplusplus stephenplusplus added the don't merge label Feb 26, 2016
@callmehiphop callmehiphop mentioned this pull request Feb 26, 2016
compute: missing resources #1073
Closed
8 of 20 tasks
@stephenplusplus
stephenplusplus force-pushed the spp--1073-autoscaler branch 2 times, most recently from 5efac05 to 12d00b9 Compare February 26, 2016 19:10
@stephenplusplus stephenplusplus removed the don't merge label Feb 26, 2016
@stephenplusplus
stephenplusplus force-pushed the spp--1073-autoscaler branch from 12d00b9 to eaefbca Compare February 26, 2016 19:22
@stephenplusplus stephenplusplus added the patch label Feb 29, 2016
callmehiphop
callmehiphop reviewed Mar 7, 2016
View reviewed changes
Comment thread lib/compute/index.js
};

/**
* Get a list of autoscalers. For a detailed description of this method's

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@stephenplusplus
stephenplusplus force-pushed the spp--1073-autoscaler branch from eaefbca to ad61314 Compare March 7, 2016 15:58
@stephenplusplus

stephenplusplus commented Mar 7, 2016

Copy link
Copy Markdown
Contributor Author

Fixed those things!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@stephenplusplus
compute: implement autoscaler
ad61314
@callmehiphop

callmehiphop commented Mar 7, 2016

Copy link
Copy Markdown
Contributor

Locally I'm getting an error when testing the docs on v0.12.7.

Uncaught TypeError: The callback's first argument must be a status code

When running against v5.6.0 npm run test seems to be timing out on something. I think this might relate to gRPC, but TBH I didn't look into it very much.

Other than those errors and a few documentation nitpicks, this LGTM!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@stephenplusplus

stephenplusplus commented Mar 7, 2016

Copy link
Copy Markdown
Contributor Author

My gosh, gRPC is haunting us. I'll try to get that error on 0.12.7.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@stephenplusplus

stephenplusplus commented Mar 7, 2016

Copy link
Copy Markdown
Contributor Author

If you strictly run node_modules/mocha/bin/mocha test/docs.js, you get the Uncaught TypeError?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@callmehiphop

callmehiphop commented Mar 7, 2016

Copy link
Copy Markdown
Contributor

If you strictly run node_modules/mocha/bin/mocha test/docs.js, you get the Uncaught TypeError?

Nope!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@callmehiphop

callmehiphop commented Mar 7, 2016

Copy link
Copy Markdown
Contributor

Although it is still hanging on something

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@stephenplusplus

stephenplusplus commented Mar 7, 2016

Copy link
Copy Markdown
Contributor Author

Please check all that apply:

v0.12.7

  • npm test hangs
  • node_modules/mocha/bin/mocha test/docs.js hangs
  • npm test returns Uncaught TypeError: The callback's first argument must be a status code
  • node_modules/mocha/bin/mocha test/docs.js returns Uncaught TypeError: The callback's first argument must be a status code

v5.6.0

  • npm test hangs
  • node_modules/mocha/bin/mocha test/docs.js hangs
  • npm test returns Uncaught TypeError: The callback's first argument must be a status code
  • node_modules/mocha/bin/mocha test/docs.js returns Uncaught TypeError: The callback's first argument must be a status code

As you probably guessed, none of the above happens for me locally. There's obviously something going on, but I don't really know where to start to find it.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@stephenplusplus

stephenplusplus commented Mar 7, 2016

Copy link
Copy Markdown
Contributor Author

Just for reference, found the origin of the status code error: https://github.com/grpc/grpc/blob/72724bce84b4bc027ce8dd3f7508b9216788434b/src/node/ext/call_credentials.cc#L176

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@stephenplusplus

stephenplusplus commented Mar 7, 2016

Copy link
Copy Markdown
Contributor Author

If you run the same tests prior to this commit, will you get the same errors?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@stephenplusplus

stephenplusplus commented Mar 7, 2016

Copy link
Copy Markdown
Contributor Author

I pushed a commit to see if anything improves. Travis is never happy, so I'm not expecting it to win him over. But maybe it'll help what you're getting locally. If it does, I'll send a different PR with that change.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@callmehiphop

callmehiphop commented Mar 7, 2016

Copy link
Copy Markdown
Contributor

If you run the same tests prior to this commit, will you get the same errors?

I don't, I'm somehow magically all green when I run against master.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@stephenplusplus

stephenplusplus commented Mar 7, 2016

Copy link
Copy Markdown
Contributor Author

It makes no sense, man!!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@callmehiphop

callmehiphop commented Mar 7, 2016

Copy link
Copy Markdown
Contributor

I just pulled your latest commit! It helped, lol.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@stephenplusplus

stephenplusplus commented Mar 7, 2016

Copy link
Copy Markdown
Contributor Author

That's awesome. The only thing I can't line up is why this PR revealed the problem. Oh well, as long as it works for us all, that's all that matters. I'll just add a test for it and we can merge it in with this PR. We talked about it most here anyway, so finding it later, this PR would help.

I'm thinking it solves #1140 and #1152 - wdyt?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@callmehiphop

callmehiphop commented Mar 7, 2016

Copy link
Copy Markdown
Contributor

SGTM.. I'm a little lost on what's going on, but maybe we should open a new issue for investigating gRPC stuff since it has been giving us weird/random errors.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@stephenplusplus
prevent GrpcService from doing anything in the sandbox env
407fb8f
@stephenplusplus
stephenplusplus force-pushed the spp--1073-autoscaler branch from 5c46a89 to 407fb8f Compare March 7, 2016 16:38
@stephenplusplus

stephenplusplus commented Mar 7, 2016

Copy link
Copy Markdown
Contributor Author

Yeah, we can leave #1140 open as a place to log issues that might relate to gRPC.

I think this is ready for a merge!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

callmehiphop added a commit that referenced this pull request Mar 7, 2016
@callmehiphop
Merge pull request #1137 from stephenplusplus/spp--1073-autoscaler
71711bd
compute: implement autoscaler
@callmehiphop
callmehiphop merged commit 71711bd into googleapis:master Mar 7, 2016
miguelvelezsa pushed a commit that referenced this pull request Jul 23, 2025
@summer-ji-eng
chore: Update the out-date showcase integration test (#1137)
817f10d
gcf-owl-bot Bot added a commit that referenced this pull request Jan 7, 2026
@gcf-owl-bot
feat: Update Compute Engine v1 API to revision 20251210 (#1137)
54eb96f
Source-Link: googleapis/googleapis@c2ec846

Source-Link: googleapis/googleapis-gen@cdd7c70
Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWNvbXB1dGUvLk93bEJvdC55YW1sIiwiaCI6ImNkZDdjNzAwZjcyMTgyMWI1NjAyN2M2ZTU4ZDNjYTQ1MjEwNWE5ZDQifQ==
@gcf-owl-bot gcf-owl-bot Bot mentioned this pull request Jan 7, 2026
feat: [compute] Update Compute Engine v1beta API to revision 20251210 (#1138) #6968
Merged
1 task
quirogas pushed a commit that referenced this pull request Jan 8, 2026
@gcf-owl-bot @quirogas
feat: Update Compute Engine v1 API to revision 20251210 (#1137)
c5a2a86
Source-Link: googleapis/googleapis@c2ec846

Source-Link: googleapis/googleapis-gen@cdd7c70
Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWNvbXB1dGUvLk93bEJvdC55YW1sIiwiaCI6ImNkZDdjNzAwZjcyMTgyMWI1NjAyN2M2ZTU4ZDNjYTQ1MjEwNWE5ZDQifQ==
miguelvelezsa pushed a commit that referenced this pull request Jan 28, 2026
@renovate-bot
chore(deps): update dependency jsdoc-region-tag to v3 (#1137)
c8efb1e
sofisl pushed a commit that referenced this pull request Feb 3, 2026
@release-please
chore(main): release 6.0.2 (#1137)
238851d
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
sofisl pushed a commit that referenced this pull request Feb 5, 2026
@renovate-bot
chore(deps): update dependency jsdoc-region-tag to v3 (#1137)
dff9ded
sofisl pushed a commit that referenced this pull request Feb 17, 2026
@renovate-bot
chore(deps): update dependency jsdoc-region-tag to v3 (#1137)
8e44045
GautamSharda pushed a commit that referenced this pull request Mar 5, 2026
@daniel-sanche
update submodule (#1137)
e32a606
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

api: compute Issues related to the Compute Engine API. cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@stephenplusplus @callmehiphop @googlebot
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.