-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from allegro/feature/metrics
Allow to collect metrics from CosmosAutoScaler
- Loading branch information
Showing
12 changed files
with
181 additions
and
21 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
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
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
63 changes: 63 additions & 0 deletions
63
...atchUtilities/Allegro.CosmosDb.BatchUtilities/Events/CosmosAutoScalerMetricsCalculated.cs
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,63 @@ | ||
using System; | ||
using Allegro.CosmosDb.BatchUtilities.Configuration; | ||
|
||
namespace Allegro.CosmosDb.BatchUtilities.Events | ||
{ | ||
public delegate void CosmosAutoScalerMetricsCalculatedEventHandler(object sender, CosmosAutoScalerMetricsCalculatedEventArgs e); | ||
|
||
public class CosmosAutoScalerMetricsCalculatedEventArgs : EventArgs | ||
{ | ||
public CosmosAutoScalerMetricsCalculatedEventArgs( | ||
CosmosAutoScaler cosmosAutoScaler, | ||
string? databaseName, | ||
string? containerName, | ||
double limiterMaxRate, | ||
double limiterAvgRate, | ||
double maxThroughput, | ||
CosmosProvisioningMode provisioningMode) | ||
{ | ||
CosmosAutoScaler = cosmosAutoScaler; | ||
DatabaseName = databaseName; | ||
ContainerName = containerName; | ||
LimiterMaxRate = limiterMaxRate; | ||
LimiterAvgRate = limiterAvgRate; | ||
MaxThroughput = maxThroughput; | ||
ProvisioningMode = provisioningMode; | ||
} | ||
|
||
/// <summary> | ||
/// <see cref="CosmosAutoScaler"/> that emitted the event. | ||
/// </summary> | ||
public CosmosAutoScaler CosmosAutoScaler { get; } | ||
|
||
/// <summary> | ||
/// Name of the database that is being auto scaled. | ||
/// </summary> | ||
public string? DatabaseName { get; } | ||
|
||
/// <summary> | ||
/// Name of the container that is being auto scaled. | ||
/// </summary> | ||
public string? ContainerName { get; } | ||
|
||
/// <summary> | ||
/// Max RU/s currently set for this <see cref="CosmosAutoScaler"/>. | ||
/// </summary> | ||
public double LimiterMaxRate { get; } | ||
|
||
/// <summary> | ||
/// Avg RU/s currently calculated for this <see cref="CosmosAutoScaler"/>. | ||
/// </summary> | ||
public double LimiterAvgRate { get; } | ||
|
||
/// <summary> | ||
/// Max RU/s configured for this <see cref="CosmosAutoScaler"/>. | ||
/// </summary> | ||
public double MaxThroughput { get; } | ||
|
||
/// <summary> | ||
/// Cosmos provisioning mode configured for this <see cref="CosmosAutoScaler"/>. | ||
/// </summary> | ||
public CosmosProvisioningMode ProvisioningMode { get; } | ||
} | ||
} |
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
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