Skip to content

Commit 6bf49bb

Browse files
authored
Delete unused code in CreateAzureCdnWarehouseReportsJob (#10151)
The only thing this job does now is create stats-totals.json
1 parent c325191 commit 6bf49bb

16 files changed

Lines changed: 47 additions & 1105 deletions

src/Stats.CreateAzureCdnWarehouseReports/ApplicationInsightsHelper.cs

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) .NET Foundation. All rights reserved.
1+
// Copyright (c) .NET Foundation. All rights reserved.
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33

44
using System;
@@ -22,30 +22,20 @@ public ApplicationInsightsHelper(TelemetryConfiguration telemetryConfiguration)
2222
_telemetryClient = new TelemetryClient(telemetryConfiguration);
2323
}
2424

25-
public void TrackReportProcessed(string reportName, string packageId = null)
25+
public void TrackReportProcessed(string reportName)
2626
{
2727
var telemetry = new MetricTelemetry(reportName, 1);
2828

29-
if (!string.IsNullOrWhiteSpace(packageId))
30-
{
31-
telemetry.Properties.Add("Package Id", packageId);
32-
}
33-
3429
_telemetryClient.TrackMetric(telemetry);
3530
_telemetryClient.Flush();
3631
}
3732

38-
public void TrackMetric(string metricName, double value, string logFileName = null)
33+
public void TrackMetric(string metricName, double value)
3934
{
4035
var telemetry = new MetricTelemetry(metricName, value);
4136

42-
if (!string.IsNullOrWhiteSpace(logFileName))
43-
{
44-
telemetry.Properties.Add("LogFile", logFileName);
45-
}
46-
4737
_telemetryClient.TrackMetric(telemetry);
4838
_telemetryClient.Flush();
4939
}
5040
}
51-
}
41+
}
Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) .NET Foundation. All rights reserved.
1+
// Copyright (c) .NET Foundation. All rights reserved.
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33

44
namespace Stats.CreateAzureCdnWarehouseReports
@@ -9,18 +9,10 @@ public class CreateAzureCdnWarehouseReportsConfiguration
99

1010
public string AzureCdnCloudStorageContainerName { get; set; }
1111

12-
public string DataStorageAccount { get; set; }
13-
14-
public string DataContainerName { get; set; }
15-
1612
public string AdditionalGalleryTotalsStorageAccount { get; set; }
1713

1814
public string AdditionalGalleryTotalsStorageContainerName { get; set; }
1915

2016
public int? CommandTimeOut { get; set; }
21-
22-
public int? PerPackageReportDegreeOfParallelism { get; set; }
23-
24-
public string ReportName { get; set; }
2517
}
2618
}

src/Stats.CreateAzureCdnWarehouseReports/CreateAzureCdnWarehouseReportsJob.cs

Lines changed: 26 additions & 342 deletions
Large diffs are not rendered by default.

src/Stats.CreateAzureCdnWarehouseReports/DirtyPackageId.cs

Lines changed: 0 additions & 24 deletions
This file was deleted.

src/Stats.CreateAzureCdnWarehouseReports/DownloadCountData.cs

Lines changed: 0 additions & 12 deletions
This file was deleted.

src/Stats.CreateAzureCdnWarehouseReports/DownloadCountReport.cs

Lines changed: 0 additions & 98 deletions
This file was deleted.

src/Stats.CreateAzureCdnWarehouseReports/DownloadsPerToolVersionReport.cs

Lines changed: 0 additions & 92 deletions
This file was deleted.

src/Stats.CreateAzureCdnWarehouseReports/Formatting/NuGetContractResolver.cs

Lines changed: 0 additions & 20 deletions
This file was deleted.

src/Stats.CreateAzureCdnWarehouseReports/GalleryTotalsReport.cs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) .NET Foundation. All rights reserved.
1+
// Copyright (c) .NET Foundation. All rights reserved.
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33

44
using System;
@@ -28,7 +28,6 @@ public GalleryTotalsReport(
2828
: base(
2929
logger,
3030
targets,
31-
openStatisticsSqlConnectionAsync: null,
3231
openGallerySqlConnectionAsync: openGallerySqlConnectionAsync,
3332
commandTimeoutSeconds: commandTimeoutSeconds)
3433
{
@@ -39,7 +38,7 @@ public async Task Run()
3938
// gather package numbers from gallery database
4039
GalleryTotalsData totalsData;
4140

42-
using (var connection = await OpenGallerySqlConnectionAsync())
41+
using (var connection = await _openGallerySqlConnectionAsync())
4342
using (var transaction = connection.BeginTransaction(IsolationLevel.Snapshot))
4443
{
4544
_logger.LogInformation("Gathering Gallery Totals from {GalleryDataSource}/{GalleryInitialCatalog}...",
@@ -57,16 +56,16 @@ public async Task Run()
5756

5857
var reportText = JsonConvert.SerializeObject(totalsData);
5958

60-
foreach (var storageContainerTarget in Targets)
59+
foreach (var storageContainerTarget in _targets)
6160
{
6261
try
6362
{
6463
var targetBlobContainer = await GetBlobContainer(storageContainerTarget);
6564
var blob = targetBlobContainer.GetBlockBlobReference(ReportNames.GalleryTotals + ReportNames.Extension);
66-
_logger.LogInformation("Writing report to {ReportUri}", blob.Uri.AbsoluteUri);
65+
_logger.LogInformation("Writing report to {ReportUri}", blob.Uri.GetLeftPart(UriPartial.Path));
6766
blob.Properties.ContentType = "application/json";
6867
await blob.UploadTextAsync(reportText);
69-
_logger.LogInformation("Wrote report to {ReportUri}", blob.Uri.AbsoluteUri);
68+
_logger.LogInformation("Wrote report to {ReportUri}", blob.Uri.GetLeftPart(UriPartial.Path));
7069
}
7170
catch (Exception ex)
7271
{
@@ -78,4 +77,4 @@ public async Task Run()
7877
}
7978
}
8079
}
81-
}
80+
}

0 commit comments

Comments
 (0)