Skip to content
This repository was archived by the owner on Jul 30, 2024. It is now read-only.

Commit 009a1a6

Browse files
author
Scott Bommarito
authored
Merge pull request #545 from NuGet/master
Merge hardcode tables change and AI hotfix into dev
2 parents 8f3d9fe + 23a4ef9 commit 009a1a6

6 files changed

Lines changed: 22 additions & 11 deletions

File tree

src/Search.GenerateAuxiliaryData/Settings/dev.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"Initialization": {
33
"AzureCdnCloudStorageAccount": "DefaultEndpointsProtocol=https;AccountName=nugetdevlegacy;AccountKey=$$Dev-NuGetDevLegacyStorage-Key$$",
44
"AzureCdnCloudStorageContainerName": "nuget-cdnstats",
5-
"PrimaryDestination": "DefaultEndpointsProtocol=https;AccountName=nugetdev0;AccountKey=$$Dev-NuGetDev0Storage-Key$$"
5+
"PrimaryDestination": "DefaultEndpointsProtocol=https;AccountName=nugetdevlegacy;AccountKey=$$Dev-NuGetDevLegacyStorage-Key$$"
66
},
77

88
"GalleryDb": {

src/Search.GenerateAuxiliaryData/Settings/prod.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"Initialization": {
33
"AzureCdnCloudStorageAccount": "DefaultEndpointsProtocol=https;AccountName=nugetgallery;AccountKey=$$Prod-NuGetGalleryStorage-Key$$",
44
"AzureCdnCloudStorageContainerName": "nuget-cdnstats",
5-
"PrimaryDestination": "DefaultEndpointsProtocol=https;AccountName=nugetprod0;AccountKey=$$Prod-NuGetProd0Storage-Key$$"
5+
"PrimaryDestination": "DefaultEndpointsProtocol=https;AccountName=nugetgallery;AccountKey=$$Prod-NuGetGalleryStorage-Key$$"
66
},
77

88
"GalleryDb": {

src/Stats.CreateAzureCdnWarehouseReports/Scripts/Stats.CreateAzureCdnWarehouseReports.cmd

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ echo "Starting job - #{Jobs.stats.createazurecdnwarehousereports.Title}"
88
title #{Jobs.stats.createazurecdnwarehousereports.Title}
99

1010
start /w stats.createazurecdnwarehousereports.exe ^
11-
-Configuration "#{Jobs.stats.createazurecdnwarehousereports.Configuration}"
12-
-InstrumentationKey "#{Jobs.stats.createazurecdnwarehousereports.InstrumentationKey}" ^
13-
-Interval #{Jobs.stats.createazurecdnwarehousereports.Interval} ^
14-
-verbose true
11+
-Configuration "#{Jobs.stats.createazurecdnwarehousereports.Configuration}" ^
12+
-InstrumentationKey "#{Jobs.stats.createazurecdnwarehousereports.InstrumentationKey}" ^
13+
-Interval #{Jobs.stats.createazurecdnwarehousereports.Interval} ^
14+
-verbose true
1515

1616
echo "Finished #{Jobs.stats.createazurecdnwarehousereports.Title}"
1717

src/Stats.ImportAzureCdnStatistics/DataImporter.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ namespace Stats.ImportAzureCdnStatistics
1010
{
1111
internal class DataImporter
1212
{
13+
public enum Table
14+
{
15+
Fact_Dist_Download,
16+
Fact_Download
17+
}
18+
1319
private readonly Func<Task<SqlConnection>> _openStatisticsSqlConnectionAsync;
1420
private const string _sqlSelectTop1FromTable = "SELECT TOP 1 * FROM [dbo].[{0}]";
1521

@@ -18,8 +24,9 @@ public DataImporter(Func<Task<SqlConnection>> openStatisticsSqlConnectionAsync)
1824
_openStatisticsSqlConnectionAsync = openStatisticsSqlConnectionAsync;
1925
}
2026

21-
public async Task<DataTable> GetDataTableAsync(string tableName)
27+
public async Task<DataTable> GetDataTableAsync(Table table)
2228
{
29+
var tableName = table.ToString();
2330
var dataTable = new DataTable();
2431
var query = string.Format(_sqlSelectTop1FromTable, tableName);
2532

src/Stats.ImportAzureCdnStatistics/Warehouse.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ public async Task<DataTable> CreateAsync(IReadOnlyCollection<PackageStatistics>
126126

127127
// create facts data rows by linking source data with dimensions
128128
var dataImporter = new DataImporter(_openStatisticsSqlConnectionAsync);
129-
var factsDataTable = await dataImporter.GetDataTableAsync("Fact_Download");
129+
var factsDataTable = await dataImporter.GetDataTableAsync(DataImporter.Table.Fact_Download);
130130

131131
var knownOperationsAvailable = operations.Any();
132132
var knownClientsAvailable = clients.Any();
@@ -247,7 +247,7 @@ public async Task<DataTable> CreateAsync(IReadOnlyCollection<ToolStatistics> sou
247247

248248
// create facts data rows by linking source data with dimensions
249249
var dataImporter = new DataImporter(_openStatisticsSqlConnectionAsync);
250-
var dataTable = await dataImporter.GetDataTableAsync("Fact_Dist_Download");
250+
var dataTable = await dataImporter.GetDataTableAsync(DataImporter.Table.Fact_Dist_Download);
251251

252252
var knownClientsAvailable = clients.Any();
253253
var knownPlatformsAvailable = platforms.Any();

src/StatusAggregator/Parse/OutdatedSearchServiceInstanceIncidentParser.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,22 @@
55
using NuGet.Services.Incidents;
66
using NuGet.Services.Status;
77
using System.Collections.Generic;
8+
using System.Linq;
89
using System.Text.RegularExpressions;
910

1011
namespace StatusAggregator.Parse
1112
{
1213
public class OutdatedSearchServiceInstanceIncidentParser : EnvironmentPrefixIncidentParser
1314
{
14-
private const string SubtitleRegEx = "A search service instance is using an outdated index!";
15+
private const string SubtitleRegEx = "All search service instances are using an outdated index!";
1516

1617
public OutdatedSearchServiceInstanceIncidentParser(
1718
IEnumerable<IIncidentParsingFilter> filters,
1819
ILogger<OutdatedSearchServiceInstanceIncidentParser> logger)
19-
: base(SubtitleRegEx, filters, logger)
20+
: base(
21+
SubtitleRegEx,
22+
filters.Where(f => !(f is SeverityFilter)), // The incident is always severity 4.
23+
logger)
2024
{
2125
}
2226

0 commit comments

Comments
 (0)