-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MetricsAdvisor] Added Event Hubs and Log Analytics data feed sources (…
- Loading branch information
Showing
19 changed files
with
2,777 additions
and
10 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
2 changes: 1 addition & 1 deletion
2
sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureLogAnalyticsDataFeed.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...icsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureLogAnalyticsDataFeedPatch.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
6 changes: 1 addition & 5 deletions
6
sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/DataFeedSourceType.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
69 changes: 69 additions & 0 deletions
69
...ure.AI.MetricsAdvisor/src/Models/DataFeed/DataFeedSources/AzureEventHubsDataFeedSource.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,69 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
using System; | ||
using System.Threading; | ||
using Azure.Core; | ||
|
||
namespace Azure.AI.MetricsAdvisor.Models | ||
{ | ||
/// <summary> | ||
/// Describes an Azure Event Hubs data source which ingests data into a <see cref="DataFeed"/> for anomaly detection. | ||
/// </summary> | ||
public class AzureEventHubsDataFeedSource : DataFeedSource | ||
{ | ||
private string _connectionString; | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="AzureEventHubsDataFeedSource"/> class. | ||
/// </summary> | ||
/// <param name="connectionString">The connection string for authenticating to the Azure Event Hubs resource.</param> | ||
/// <param name="consumerGroup">The Azure Event Hubs consumer group to use.</param> | ||
/// <exception cref="ArgumentNullException"><paramref name="connectionString"/> or <paramref name="consumerGroup"/> is null.</exception> | ||
/// <exception cref="ArgumentException"><paramref name="connectionString"/> or <paramref name="consumerGroup"/> is empty.</exception> | ||
public AzureEventHubsDataFeedSource(string connectionString, string consumerGroup) | ||
: base(DataFeedSourceType.AzureEventHubs) | ||
{ | ||
Argument.AssertNotNullOrEmpty(connectionString, nameof(connectionString)); | ||
Argument.AssertNotNullOrEmpty(consumerGroup, nameof(consumerGroup)); | ||
|
||
ConnectionString = connectionString; | ||
ConsumerGroup = consumerGroup; | ||
} | ||
|
||
internal AzureEventHubsDataFeedSource(AzureEventHubsParameter parameter) | ||
: base(DataFeedSourceType.AzureEventHubs) | ||
{ | ||
Argument.AssertNotNull(parameter, nameof(parameter)); | ||
|
||
ConnectionString = parameter.ConnectionString; | ||
ConsumerGroup = parameter.ConsumerGroup; | ||
} | ||
|
||
/// <summary> | ||
/// The Azure Event Hubs consumer group to use. | ||
/// </summary> | ||
public string ConsumerGroup { get; set; } | ||
|
||
/// <summary> | ||
/// The connection string for authenticating to the Azure Event Hubs resource. | ||
/// </summary> | ||
internal string ConnectionString | ||
{ | ||
get => Volatile.Read(ref _connectionString); | ||
private set => Volatile.Write(ref _connectionString, value); | ||
} | ||
|
||
/// <summary> | ||
/// Updates the connection string. | ||
/// </summary> | ||
/// <param name="connectionString">The new connection string to be used for authentication.</param> | ||
/// <exception cref="ArgumentNullException"><paramref name="connectionString"/> is null.</exception> | ||
/// <exception cref="ArgumentException"><paramref name="connectionString"/> is empty.</exception> | ||
public void UpdateConnectionString(string connectionString) | ||
{ | ||
Argument.AssertNotNullOrEmpty(connectionString, nameof(connectionString)); | ||
ConnectionString = connectionString; | ||
} | ||
} | ||
} |
Oops, something went wrong.