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

[Internal] Autopilot: Add internal autopilot support #1356

Merged
merged 16 commits into from
Apr 10, 2020

Conversation

j82w
Copy link
Contributor

@j82w j82w commented Apr 9, 2020

Pull Request Template

Description

This add autopilot support for internal teams to use.

DatabaseCore database = (DatabaseInlineCore)await this.cosmosClient.CreateDatabaseAsync(
    nameof(CreateDropAutoscaleDatabase) + Guid.NewGuid().ToString(),
    ThroughputProperties.CreateAutoScaleProvionedThroughput(5000));

ThroughputResponse autoscale = await database.ReadThroughputAsync(requestOptions: null);
Assert.IsNotNull(autoscale);
Assert.AreEqual(5000, autoscale.Resource.MaxAutoscaleThroughput);

ThroughputResponse autoscaleReplaced = await database.ReplaceThroughputPropertiesAsync(
    ThroughputProperties.CreateAutoScaleProvionedThroughput(10000));
Assert.IsNotNull(autoscaleReplaced);
Assert.AreEqual(10000, autoscaleReplaced.Resource.MaxAutoscaleThroughput);
 ContainerCore container = (ContainerInlineCore)await database.CreateContainerAsync(
    new ContainerProperties(Guid.NewGuid().ToString(), "/pk"),
    ThroughputProperties.CreateAutoScaleProvionedThroughput(5000));
Assert.IsNotNull(container);

ThroughputResponse autoscale = await container.ReadThroughputAsync(requestOptions: null);
Assert.IsNotNull(autoscale);
Assert.AreEqual(5000, autoscale.Resource.MaxThroughput);

ThroughputResponse autoscaleIfExists = await container.ReadThroughputIfExistsAsync(requestOptions: null);
Assert.IsNotNull(autoscaleIfExists);
Assert.AreEqual(5000, autoscaleIfExists.Resource.MaxThroughput);

ThroughputResponse autoscaleReplaced = await container.ReplaceThroughputPropertiesAsync(
    ThroughputProperties.CreateAutoScaleProvionedThroughput(10000));
Assert.IsNotNull(autoscaleReplaced);
Assert.AreEqual(10000, autoscaleReplaced.Resource.MaxThroughput);
DatabaseCore database = (DatabaseInlineCore)await this.cosmosClient.CreateDatabaseAsync(
    nameof(CreateDropAutoscaleAutoUpgradeDatabase) + Guid.NewGuid(),
    ThroughputProperties.CreateAutoScaleProvionedThroughput(
        startingMaxAutoscaleThroughput: 5000,
        autoUpgradeMaxThroughputIncrementPercentage: 10));

ThroughputResponse autoscale = await database.ReadThroughputAsync(requestOptions: null);
Assert.IsNotNull(autoscale);
Assert.AreEqual(5000, autoscale.Resource.MaxAutoscaleThroughput);
Assert.AreEqual(10, autoscale.Resource.AutoUpgradeMaxThroughputIncrementPercentage);

ThroughputResponse autoUpgradeReplace = await database.ReplaceThroughputPropertiesAsync(
    ThroughputProperties.CreateAutoScaleProvionedThroughput(
        startingMaxThroughput: 7000,
        autoUpgradeMaxThroughputIncrementPercentage: 20));

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

@kirankumarkolli
Copy link
Member

Stream API's overloads also please.
Compute used stream API's only.

@j82w j82w merged commit a2c1f7a into master Apr 10, 2020
@j82w j82w deleted the users/jawilley/autopilot branch April 10, 2020 22:08
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.

3 participants